09.07.2009, 10:59
I made something like a bomb which needs to explode, and its explodes but i dont know how to set timer that she(the bomb) explodes after 10 seconds after i type /c4 so pls if someone can add it here?
public C4(playerid, cmdtext[])
{
//-------------------------------[C4]-------------------------------------------
if(strcmp(cmdtext, "/c4", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
ApplyAnimation(playerid,"ped","bomber",4.1,0,1,1,1 ,1);
SendClientMessage(playerid, COLOR_ROB, "C4 set, in 10 seconds it will explode");
new Float
cx, Float
cy, Float
cz;
GetPlayerPos(playerid,scx, scy, scz);
CreateExplosion(scx+1,scy+1,scz+1,7,100);
}
return 1;
}
return 0;
}
public C4(playerid, cmdtext[])
{
//-------------------------------[C4]-------------------------------------------
if(strcmp(cmdtext, "/c4", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
ApplyAnimation(playerid,"ped","bomber",4.1,0,1,1,1 ,1);
SendClientMessage(playerid, COLOR_ROB, "C4 set, in 10 seconds it will explode");
new Float
![confused](images/smilies/confused.gif)
![confused](images/smilies/confused.gif)
![confused](images/smilies/confused.gif)
GetPlayerPos(playerid,scx, scy, scz);
CreateExplosion(scx+1,scy+1,scz+1,7,100);
}
return 1;
}
return 0;
}