Cuff release timer
#1

So I want this to happen; after I cuff someone, that player should be free to move again after 20 seconds.

This is the code:
Код:
CMD:cuff(playerid, params[])
{
    new ID; new pname[24]; new opname[24]; new string[200];
    if(!IsPlayerACop(playerid)) return SendClientMessage(playerid, COLOR_RED,"You are not a law enforcement.");
	if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You cannot use this command in a vehicle.");
	if(sscanf(params, "u", ID)) return SendClientMessage(playerid, COLOR_RED, "Usage: /cuff (ID)");
	if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "Invalid ID.");
	GetPlayerName(ID, opname, 24); GetPlayerName(playerid, pname, 24);
	if(GetDistanceBetweenPlayers(playerid, ID) > 3) return SendClientMessage(playerid, COLOR_RED, "That player is too far away to be cuffed.");
	if(IsPlayerInAnyVehicle(ID)) return SendClientMessage(playerid, COLOR_RED, "That player is in a vehicle. You cannot cuff him.");
	if(IsPlayerACop(playerid)) return SendClientMessage(playerid, COLOR_RED, "You cannot cuff other Law Enforcements.");
	TogglePlayerControllable(ID, 0);
	GameTextForPlayer(ID, "~b~HANDCUFFED!", 5000, 1);
	format(string, sizeof(string), "[POLICE] Officer %s(%d) has put hand cuffs on you. You cannot move.", pname, playerid);
	SendClientMessage(ID, COLOR_LIGHTBLUE, string);
	format(string, 200, "[DISPATCH] Officer %s(%d) has cuffed player %s(%d)", pname, playerid, opname, ID);
	
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "[POLICE] You have cuffed a suspect. You have 30 seconds before they get uncuffed.");
I want to make the TogglePlayerControllable(ID,1) after 20 seconds when someone get cuffed. How should I do this?
Please help, reputation will be given.
Reply


Messages In This Thread
Cuff release timer - by Captain_Mani - 09.08.2012, 06:45
Re: Cuff release timer - by Devilxz97 - 09.08.2012, 06:56
Re: Cuff release timer - by Devilxz97 - 09.08.2012, 07:17
Re: Cuff release timer - by XStormiest - 09.08.2012, 07:28
Re: Cuff release timer - by Captain_Mani - 09.08.2012, 08:20
Re: Cuff release timer - by leonardo1434 - 09.08.2012, 08:37
Re: Cuff release timer - by Captain_Mani - 09.08.2012, 08:59

Forum Jump:


Users browsing this thread: 1 Guest(s)