11.08.2009, 11:29
Im trying to make some explosions on a timer and it crashes the server after about 5 secs so im thinking somethings wrong with the timer or something else i dont know?
pawn Code:
#include <a_samp>
forward AttackTimer();
forward DefenceTimer();
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/AttackStrike", cmdtext, true, 10) == 0)
{
SetTimer("AttackTimer", 5000, 1);
SendClientMessageToAll(0xFF0000, "%s Has Sent an Airstrike, Take Cover!");
GivePlayerMoney(playerid, -1000);
return 1;
}
if (strcmp("/DefenceStrike", cmdtext, true, 10) == 0)
{
SetTimer("OneSecTimer", 5000, 1);
SendClientMessageToAll(0xFF0000, "%s Has Sent an Airstrike, Take Cover!");
GivePlayerMoney(playerid, -1000);
return 1;
}
if (strcmp("/help", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, 0xFF0000, "/DefenceStrike or /AttackStrike. Make sure you choose the right One!");
return 1;
}
return 0;
}
public AttackTimer()
{
CreateExplosion(1316,3371,6,0,5);
CreateExplosion(1320,3350,2,0,3);
CreateExplosion(1300,3333,1,4,4);
CreateExplosion(1292,3353,3,0,4);
}
public DefenceTimer()
{
CreateExplosion(1217,3154,2,0,5);
CreateExplosion(1230,3156,2,0,3);
CreateExplosion(1243,3152,2,4,4);
CreateExplosion(1232,3174,2,0,4);
}