04.01.2013, 19:46
I made a breakcuff command for stevo127's script , it autobreaks the cuff as soon as you get cuffed? You dont even need to type /breakcuffs , idk why .. Please help ..
pawn Code:
dcmd_breakcuffs(playerid,params[])
{
new string[128];
#pragma unused params
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(IsCuffed[playerid] == 0)
{
SendClientMessage(playerid,COLOR_ERROR,"You are not Cuffed. You cannot 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(AttemptedToBreakCuffsRecently[playerid] >= 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You are too tired from your last break attempt. Please wait before trying to break your cuffs again.");
return 1;
}
SendClientMessage(playerid,COLOR_DEADCONNECT,"[[_Cuffs Breaked_]]");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have successfully broke the cuffs, run before the cop see's it!");
IsCuffed[playerid] =0;
TogglePlayerControllable(playerid,1);
TextDrawSetString(MessageTD[playerid],"ESCAPED");
TextDrawShowForPlayer(playerid,MessageTD[playerid]);
MessageTDTime[playerid] =5;
format(string,sizeof(string),"[Cuff ESCAPE] %s(%d) Has broke his cuffs to escape from the cops.",PlayerName(playerid),playerid);
SendClientMessageToAll(COLOR_LIGHTBLUE,string);
return 1;
}