05.12.2016, 13:17
For Example...
Anti-Spawn Protection By ALiScripter.
PHP код:
forward SpawnProtect(playerid);
public SpawnProtect(playerid)
{
SetPlayerHealth(playerid, FLOAT_INFINITY);
AntiSKr[playerid] = random(3);
switch(AntiSKr[playerid])
{
case 0:
{
AntiSKa[playerid] = 10*1000; // 10 multiplied by 1000 mili-secs = 10 seconds.
SendClientMessage(playerid, 0x8F8F8FFF, "[SPAWN]: {FFFFFF}You have spawn protection for 10 seconds.");
}
case 1:
{
AntiSKa[playerid] = 15*1000; // 15 multiplied by 1000 mili-secs = 15 seconds.
SendClientMessage(playerid, 0x8F8F8FFF, "[SPAWN]: {FFFFFF}You have spawn protection for 15 seconds.");
}
case 2:
{
AntiSKa[playerid] = 20*1000; // 20 multiplied by 1000 mili-secs = 20 seconds.
SendClientMessage(playerid, 0x8F8F8FFF, "[SPAWN]: {FFFFFF}You have spawn protection for 20 seconds.");
}
}
AntiSK[playerid] = 1;
AntiSKt[playerid] = SetTimerEx("AntiSKfunc", AntiSKa[playerid], false, "i", playerid);
SendClientMessage(playerid, 0x8F8F8FFF, "[SPAWN]: {FFFFFF}Press key '{781F59}N{FFFFFF}' to end spawn protection.");
return 1;
}