29.06.2013, 05:17
(
Последний раз редактировалось exclide1; 29.06.2013 в 05:56.
)
Hello. I've setup a spawn-kill protection, using OnPlayerLeaveDynamicArea(playerid, areaid) function from Incognito's Streamer Plugin. It works, but 1 out of 10 times it happens that it starts the timer, before player actually leaves the area. Here is the code:
Under OnPlayerSpawn:
Any help will be appreciated!
pawn Код:
forward OnPlayerLeaveDynamicArea(playerid, areaid);
public OnPlayerLeaveDynamicArea(playerid, areaid)
{
SendClientMessage(playerid, COLOR_RED, "Spawn protection countdown has started. You have 10 seconds.");
spawntimer = SetTimerEx("AntiSpawnkill",10000,0,"i",playerid);
timer1 = true;
DestroyAllDynamicAreas();
return 1;
}
pawn Код:
DestroyAllDynamicAreas();
for(new i; i < sizeof(g_CoordSets); i++)
{
CreateDynamicCircle(g_CoordSets[i][xx], g_CoordSets[i][yy], 10, -1, -1, playerid);
}
SetPlayerHealth(playerid, 99999.0);
SendClientMessage(playerid, COLOR_RED, "Spawn protection countdown will start on your movement.");