Author Topic: my player type wont change back to normal  (Read 1242 times)

Should work. %cl.obj.datablock is nothing.
Err.. Can't you use %obj like %player? For example it's the object of %client, as is the player.

If the client's player is dead then that will cause console errors. Also what Jetz quoted pretty much makes this useless.
Fixed.

I actually tested this code.
EDIT: Damn, I feel stupid. After I posted this I tested it out while I was dead and there was errors in the console.
EDIT2: Fixed, I used isObject() instead of getState().
Code: [Select]
//==================================================================\\
// Title: Self Delete-Proof Player                                      \\
// Author: HellsHero                                                \\
// No Self Delete player type with no Self Delete support, 'noSelf Delete=true' \\
//==================================================================\\
datablock PlayerData(PlayerNSelf Delete : PlayerStandardArmor)
{
canJet = 0;
noSelf Delete = 1;
uiName = "No-Self Delete Player";
};

//Self Delete-Proof Package
package noSelf Delete
{
function serverCmdSelf Delete(%client)
{
if(!isObject(%client.player))
return;
else
{
if(%client.player.getDataBlock().noSelf Delete)
commandToClient(%client, 'centerPrint', "\c6You cannot Self Delete.", 1);
else
parent::serverCmdSelf Delete(%client);
}
}
};
activatePackage(noSelf Delete);
« Last Edit: May 10, 2010, 06:48:43 PM by HellsHero »