18.11.2012, 10:54
i put a timer on the command 'breakcuff' they can use it after 3 minutes
but the timer is not working.. can anyone help me ?
but the timer is not working.. can anyone help me ?
pawn Код:
dcmd_breakcuff(playerid, params[])
{
#pragma unused params
new string[128];
if(GetTickCount()-GetPVarInt(playerid,"TimerBreakcuff")>180000)
{
SetPVarInt(playerid,"TimerBreakcuff",GetTickCount());
SendClientMessage(playerid, COLOR_GREY, "You have succesfully escape! Run from Police!!.");
}
else
{
SendClientMessage(playerid, COLOR_ERROR, "Please wait 3 minutes to use this command again");
}
if(IsSpawned[playerid] != 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
return 1;
}
if(IsFrozen[playerid] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You have been frozen by a Server Administrator. You cannot use this command.");
return 1;
}
if(IsKidnapped[playerid] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You are kidnapped. You cannot use this command.");
return 1;
}
if(IsCuffed[playerid] == 0)
{
SendClientMessage(playerid,COLOR_ERROR,"You are not handcuffed. You cannot use this command");
return 1;
}
if(IsKidnapped[playerid] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You are kidnapped. You cannot use this command.");
return 1;
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
SendClientMessage(playerid,COLOR_ERROR,"You cannot use /breakcuff while in a vehicle. Exit the vehicle first.");
return 1;
}
format(string,sizeof(string), "[CRIMINAL ACTION] %s(%d) has used /breakcuff to escape from cops",PlayerName(playerid), playerid);
SendClientMessageToAll(COLOR_ERROR, string);
format(string,sizeof(string),"[POLICE RADIO] Escape Cuff: %s(%d) has escape from cuff Catch And Arrrest Them!",PlayerName(playerid), playerid);
SendClientMessageToAllCops(string);
TogglePlayerControllable(playerid,1);
IncreaseWantedLevel(playerid,8);
IncreasePlayerScore(playerid,1);
IsCuffed[playerid] =0;
SetPlayerSpecialAction(playerid ,SPECIAL_ACTION_NONE);
ClearAnimations(playerid);
return 1;
}