much better
it's still weird as forget in some places
and this?
GameConnection::spawnPlayer(%cl)if(%cl.spawned = 0) {%cl.spawned = 1;} //instead of doing fancy stuff, I just swapped the place of the two if checks.
if(%cl.spawned = nil) {%cl.spawned = 0;}what in forgets name
just use
GameConnection::onClientEnterGame(%cl)it was made for people like you
i'm not kidding
$pref::server::alwaysspawnmessage is a really crappy pref. i don't like it and i don't think anyone will ever use it. i mean, if the entire centerprint was 100% customizable, sure. i could be wrong, but i'm probably not.
function serverCmdver(%cl)
{
%cl.centerPrint($pref::server::adminxver,3);
}make that
messageclient(%cl, '', $pref::server::adminxver);
findclientbyname(%target).player.addhealth(-%power); are you 100% positive this works?
You still failed to put isObject checks on the
findClientByName(%target).player.
This means that any server running this mod that I'm admin on, I can lag it practically to death by simply spamming this servercmd with an invalid name.
check it-
function serverCmdSlay(%c,%t) //Proper camelCase dammit
{
if(!%c.isAdmin) //Check for admin
return;
if(!isObject(%t = findClientByName(%t))) //target client isobject.
return;
if(!isObject(%p = %t.player)) //player isobject
return;
announce(%c.getPlayerName() SPC "has slain" SPC %t.getPlayerName());
%p.kill();
}There. That's the perfect function. follows all the stuff that i've been taught/learned
note the if(!isObject
more specifically, the !. that means opposite.
so if i do
==> %a = 1; echo(!%a);
0
tada.
%targetname = findclientbyname(%target).name; you're just making things hard on yourself. also this looks stupid.
if(isFile("Add-Ons/System_ReturnToBlockland/server.cs")) //LOOK, CHECKING FOR RTB! DO YOU LOVE ME NOW?no i hate you. you forgot something important: just because RTB exists doesn't mean it's executed!
DON'T loving EXECUTE IT RIGHT HERE DUMBASS
I SAW YOU - you were thinking you'd just throw in a
exec("Add-Ons/System_ReturnToBlockland/server.cs"); weren't you? yes you were! don't deny it!
Do it right.
if(isFile("Add-Ons/System_ReturnToBlockland/server.cs"))
{
if(!$RTB::RTBR_ServerControl_Hook)
exec("Add-Ons/System_ReturnToBlockland/RTBR_ServerControl_Hook.cs");http://www.returntoblockland.com/files/RTB_Documentation.pdf