Anti Spawn Kill
#1

hi,

first, i searched here on the board but i didnt find sth. i didnt find sth. new.
I tried to do an anti spawn kill protection with 2 different methods.

1.

pawn Код:
//OnPlayerSpawn
    SetPlayerHealth(playerid,9999999);
    SendClientMessage(playerid, 0xFF0000AA, "{5DFC0A}You are Spawn-Kill protected for the next {CD3333}10 seconds...");
    SetTimerEx("AntiSpawnKill",10000,false,"i",playerid);

forward AntiSpawnKill(playerid);
public AntiSpawnKill(playerid)
{
    SetPlayerHealth(playerid,100);
    SendClientMessage(playerid, 0xFF0000AA, "{5DFC0A}Anti-Spawnkill protection is over now. {CD3333}Watch out!");
    return 1;
}
2.

pawn Код:
//OnPlayerSpawn
    SetPlayerHealth(playerid,99999999999);
    SendClientMessage(playerid, 0xFF0000AA, "{5DFC0A}You are Spawn-Kill protected for the next {CD3333}10 seconds...");
    SetTimerEx("AntiSpawnKill",10000,false,"i",playerid);
    DRH[playerid] = SetTimerEx("drughealther",100,true,"i",playerid);

forward AntiSpawnKill(playerid);
public AntiSpawnKill(playerid)
{
    SetPlayerHealth(playerid,100);
    SendClientMessage(playerid, 0xFF0000AA, "{5DFC0A}Anti-Spawnkill protection is over now. {CD3333}Watch out!");
        KillTimer(DRH[playerid]);

    return 1;
}

forward drughealther(playerid);
public drughealther(playerid)
{
SetPlayerHealth(playerid, 99999999);
return 1;
}
No method worked! I dont know why. Also the seconds one caused lag like hell with 8 players on the server.
Pls help...

regards.
Reply
#2

hi,
thx for ur answer.
But would this really make a difference?
Ill try it out but i dont think this one will work

but thank u for ur code
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)