23.01.2013, 15:54
I have a break cuff command and it works fine but how can i make so its like 50 % chance to fail breaking the cuffs ? because now its 100 % that u break , and how can i make so they get 2 level wanted + everytime they try to break the cuffs
pawn Код:
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] =1;
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;
}