11.02.2015, 09:04
you could set a 5 or 10 second timer
pawn Код:
new WaitanimationTimer[MAX_PLAYERS]; // top of your script
forward WaitanimmationTimerOff(playerid); // under new WaitanimationTimer[MAX_PLAYERS];
make a new cmd like
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/dance", cmdtext, true, 5) == 0)
{
if(WaitanimationTimer[playerid] == 1)
{
//some text here - like sendclient message
WaitanimationTimer[playerid] = 1;
SetTimer("WaitanimationTimerOff", 5000, 0); // 5000 is 5 seconds
return 1;
}
return 0;
}
& PUT THIS AT THE BOTTOM OF YOUR SCRIPT
public WaitanimationTimerOff(playerid)
{
if(WaitanimationTimer[playerid] == 1)
{
WaitanimationTimer[playerid] = 0;
return 0;
}
return 1;
}