Author Topic: Preventing a player from suiciding  (Read 580 times)

I'm making a /freeze command and I'm having trouble preventing the frozen player from suiciding.
This is what I have:

Code: [Select]
package toggleSelf Delete {
function serverCmdSelf Delete(%c)
{
if(%c.player.isFrozen)
return;
parent::serverCmdSelf Delete(%c);
}
};
activatePackage(toggleSelf Delete);

Code: [Select]
package toggleSelf Delete
{
    function servercmdSelf Delete(%this)
    {
        if(!%this[.player].isfrozen)
            return parent::servercmdSelf Delete(%this);
    }
};activatepackage(toggleSelf Delete);

I don't see anything that would prevent the code in OP from working, maybe isFrozen isn't being set correctly?

%this[.player].isfrozen
What's the point of the brackets, and does that even work?

What's the point of the brackets, and does that even work?

No point, and it also doesn't work.

The package you have there will correctly prevent the player from suiciding if "isFrozen" is set to one on the player. It must be somewhere else in the code.


What's the point of the brackets, and does that even work?
I didn't know whether the player or the client shall have the variable