[FilterScript] Spawn protection system - unique
#10

Well its bad idea to use Random function some of the player have more protection and some has less thats unfair system.

Код:
forward AntiSKfunc(playerid);
public  AntiSKfunc(playerid)
{
        SetPlayerHealth(playerid, 99.0);
        SetPlayerArmour(playerid, 99.0);
        SendClientMessage(playerid, -1, "* Spawn protection ended.");
        return 1;
}
 
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
        if(newkeys & KEY_NO && AntiSK[playerid] == 1)
        {
            KillTimer(AntiSKt[playerid]);//if you're killing timer here
            AntiSKt[playerid] = SetTimerEx("AntiSKfunc", 100, false, "i", playerid);//why you using timer again here? 
            SendClientMessage(playerid, -1, "* You have ended your spawn protection.");
        }
        return 1;
}
You don't need timer to kill it. You can just add Function name like this.

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
        if(newkeys & KEY_NO && AntiSK[playerid] == 1)
        {
            KillTimer(AntiSKt[playerid]);//if you're killing timer here
            AntiSKfunc(playerid);// this is better
            SendClientMessage(playerid, -1, "* You have ended your spawn protection."); 
        }
        return 1;
}
But anyway good.
Reply


Messages In This Thread
Spawn protection system - unique - by Logic_ - 21.05.2016, 04:34
Re: Spawn protection system - unique - by Luicy. - 21.05.2016, 06:12
Re: Spawn protection system - unique - by Infinity - 21.05.2016, 06:46
Re: Spawn protection system - unique - by oMa37 - 21.05.2016, 07:03
Re: Spawn protection system - unique - by SyS - 21.05.2016, 07:21
Re: Spawn protection system - unique - by Logic_ - 21.05.2016, 07:32
Re: Spawn protection system - unique - by PrO.GameR - 21.05.2016, 07:39
Re: Spawn protection system - unique - by Infinity - 21.05.2016, 07:44
Re: Spawn protection system - unique - by Logic_ - 21.05.2016, 07:55
Re: Spawn protection system - unique - by MBilal - 21.05.2016, 08:00

Forum Jump:


Users browsing this thread: 1 Guest(s)