10.07.2018, 23:29
Hello I've some problem I've making a command for when someone be arrested he can use /bc but the problem is:
After someone by being arrested and using /bc They will tell him in the message Example: Rock(0) has been arrested by S.W.A.T Rock(0) They are choosing the same names in row! I don't know why BUT I need using a CIVILAN NAME and Police NAME name What's wrong? help me
After someone by being arrested and using /bc They will tell him in the message Example: Rock(0) has been arrested by S.W.A.T Rock(0) They are choosing the same names in row! I don't know why BUT I need using a CIVILAN NAME and Police NAME name What's wrong? help me
PHP код:
CMD:breakcuff(playerid, params[])
{
if(PoliceTeam(GetPlayerSkin(playerid))) return SendClientMessage(playerid, -1, "{FF0000}[NayaBOT]: {FFFFFF}You cannot use this command.");
{
new pName[MAX_PLAYER_NAME],tName[MAX_PLAYER_NAME],targetid;
new string[170], ArrestReward = random(15000) + 2500;
if(TryingArrested[targetid] == 1 && Civilian(GetPlayerSkin(targetid)))
{
switch(random(100))
{
case 0..35:
{
GetPlayerName(targetid, tName, sizeof(tName));
KillTimer(SecdonsToJail[targetid]);
TryingArrested[targetid] = 0;
SetPlayerWantedLevel(targetid, 3);
SetPlayerColor(targetid, COLOR_YELLOW);
format(string,sizeof(string), "{808000}%s(%d) {FFFFFF}has {808000}escaped {FFFFFF}from his HANDCUFFS!! {808000}(Being Arrested)", tName,targetid);
SendClientMessageToAll(-1, string);
GameTextForPlayer(targetid, "~g~ESCAPED ~W~FROM ~R~ARRESTED!!", 5000, 5);
}
case 36..100:
{
if(ArrestReward > GetPlayerCash(playerid))
GetPlayerName(targetid, tName, sizeof(tName));
GetPlayerName(playerid, tName, sizeof(tName));
TryingArrested[targetid] = 0;
ResetPlayerWeapons(targetid);
format(string, sizeof(string), "{808000}%s(%d) {ffffff}has been {808000}ARRESTED {ffffff}by {00FFFF}S.W.A.T %s(%d){ffffff}!! Wanted Level: {00FFFF}%d.", tName,targetid, pName,playerid,GetPlayerWantedLevel(targetid));
SendClientMessageToAll(yellow, string);
format(string, sizeof(string), "~y~ARRESTED BY %s(%d)~n~~W~YOU LOST ~R~$%d", pName, playerid, -ArrestReward);
GameTextForPlayer(targetid, string, 4000, 5);
format(string, sizeof(string), "~g~ARRESTED ~y~%s(%d)~n~~W~YOU GOT ~R~$%d", tName, targetid, ArrestReward);
GameTextForPlayer(playerid, string, 4000, 5);
format(string, sizeof(string), "{808000}%s(%d) {ffffff}has {ff0000}failed {ffffff}to escaped from his Handcuffs!! {808000}(Being Arrested)", tName,targetid);
SendClientMessageToAll(yellow, string);
GivePlayerMoney(targetid, -ArrestReward);
GivePlayerMoney(playerid, ArrestReward);
}
}
}
else SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}You can use this command only while being cuffed or arrested.");
}
return 1;
}