Nikita6866
Дебютант
Приветствую всех. У меня возникла проблема с командой /arrest. Когда сажаю преступника на 1 одну звезду, то его ник отображается красным шрифтом, если же сажаю на 2 и более звезды, то Ник Нейм отображается только законника.
На скрине ниже:
И собственно сама команда:
На скрине ниже:
Код:
c:arrest;
{
if(IsACop(playerid))
{
if(PlayerToPoint(15.0, playerid, 268.3327,77.8972,1001.0391) || PlayerToPoint(6.0, playerid, 227.7436,114.5075,999.0156) || PlayerToPoint(6.0, playerid, 188.7124,157.6917,1003.0234)|| PlayerToPoint(6.0, playerid, 218.2263,114.9286,999.0156) || PlayerToPoint(6.0, playerid, 198.3940,157.9389,1003.0234) || PlayerToPoint(6.0, playerid, 1164.2365,371.2711,1002.1660))
{
if(sscanf(params,"d",params[0])) return SendClientMessage(playerid, COLOR_WHITE, " Ââåäèòå: /arrest [1-6]");
new wantedtime;
if(params[0] < 1 || params[0] > 6) { SendClientMessage(playerid, COLOR_GREY, "Îò 1 çâåçäû äî 6!"); return true; }
else if(params[0] == 1) { wantedtime = 600; }
else if(params[0] == 2) { wantedtime = 1200; }
else if(params[0] == 3) { wantedtime = 1800; }
else if(params[0] == 4) { wantedtime = 2400; }
else if(params[0] == 5) { wantedtime = 3000; }
else if(params[0] == 6) { wantedtime = 3600; }
new suspect = GetClosestPlayer(playerid);
if(!IsPlayerConnected(suspect)) return SendClientMessage(playerid, COLOR_GREY, "Èãðîê íå íàéäåí");
{
if(!ProxDetectorS(4.0, playerid, suspect)) return SendClientMessage(playerid, COLOR_GREY, "Ðÿäîì ñ âàìè íèêîãî íåò!");
{
if(PlayerInfo[suspect][pWanted] < 1) return SendClientMessage(playerid, COLOR_GREY, "×åëîâåê äîëæåí èìåòü õîòÿ áû îäèí óðîâåíü ðîçûñêà!");
format(strcmd,sizeof(strcmd), "Âû ïîñàäèëè â òþðüìó %s íà %d ñåêóíä", PlayerInfo[params[0]][pNames], wantedtime);
SendClientMessage(playerid, 0x6ab1ffaa, strcmd);
format(strcmd,sizeof(strcmd), "Âàñ ïîñàäèë â òþðüìó %s íà %d ñåêóíä", PlayerInfo[playerid][pNames], wantedtime);
SendClientMessage(suspect, 0x6ab1ffaa, strcmd);
PlayerInfo[suspect][pCash]-=1;
PlayerInfo[playerid][pCash]+=1;
format(strcmd,sizeof(strcmd), "~g~+$1", PlayerInfo[playerid][pNames]);
GameTextForPlayer(playerid, strcmd, 5000, 1);
format(strcmd,sizeof(strcmd), "~r~-$1", PlayerInfo[params[0]][pNames]);
GameTextForPlayer(suspect, strcmd, 5000, 1);
Delgun(suspect);
ResetPlayerWeapons(suspect);
SetPlayerSpecialAction(suspect,SPECIAL_ACTION_NONE);
RemovePlayerAttachedObject(suspect,0);
TogglePlayerControllable(suspect, 1);
PlayerCuffed[suspect] = 0;
if(PlayerInfo[playerid][pMRInections]==1||PlayerInfo[playerid][pLRInections]==1) { format(strcmd,sizeof(strcmd), "<< Офицер %s арестовал %s >>", PlayerInfo[playerid][pNames], PlayerInfo[params[0]][pNames]); SendClientMessageToAll(COLOR_LIGHTRED, strcmd); }
else if(PlayerInfo[playerid][pMRInections]==10||PlayerInfo[playerid][pLRInections]==10) { format(strcmd,sizeof(strcmd), "<< Офицер %s арестовал %s >>", PlayerInfo[playerid][pNames], PlayerInfo[params[0]][pNames]); SendClientMessageToAll(COLOR_LIGHTRED, strcmd); }
else if(PlayerInfo[playerid][pMRInections]==21 || PlayerInfo[playerid][pLRInections]==21) { format(strcmd,sizeof(strcmd), "<< Офицер %s арестовал %s >>", PlayerInfo[playerid][pNames], PlayerInfo[params[0]][pNames]); SendClientMessageToAll(COLOR_LIGHTRED, strcmd); }
else if(PlayerInfo[playerid][pMRInections]==2||PlayerInfo[playerid][pLRInections]==2) { format(strcmd,sizeof(strcmd), "<< Агент ФБР %s арестовал %s >>", PlayerInfo[playerid][pNames], PlayerInfo[params[0]][pNames]); SendClientMessageToAll(COLOR_LIGHTRED, strcmd); }
if(PlayerToPoint(15.0, playerid, 268.3327,77.8972,1001.0391))
{
SetPlayerInterior(suspect, 6);
PlayerInfo[suspect][pInt] = 6;
SetPPos(suspect,264.1425,77.4712,1001.0391);
SetPlayerFacingAngle(suspect, 263.0160);
PlayerInfo[suspect][pMestoJail] = 1;
}
else if(PlayerToPoint(6.0, playerid, 218.2263,114.9286,999.0156))
{
SetPlayerInterior(suspect, 10);
PlayerInfo[suspect][pInt] = 10;
SetPPos(suspect,219.5400,109.9767,999.0156);
SetPlayerFacingAngle(suspect, 1.0000);
PlayerInfo[suspect][pMestoJail] = 2;
}
else if(PlayerToPoint(6.0, playerid, 198.3940,157.9389,1003.0234))
{
SetPlayerInterior(suspect, 3);
PlayerInfo[suspect][pInt] = 3;
SetPPos(suspect,198.3642,161.8103,1003.0300);
SetPlayerFacingAngle(suspect, 1.0000);
PlayerInfo[suspect][pMestoJail] = 3;
}
else if(PlayerToPoint(6.0, playerid, 1164.2365,371.2711,1002.1660))
{
SetPlayerInterior(suspect, 3);
PlayerInfo[suspect][pInt] = 3;
SetPPos(suspect,1164.2365,371.2711,1002.1660);
SetPlayerFacingAngle(suspect, 1.0000);
PlayerInfo[suspect][pMestoJail] = 3;
}
SetPlayerWantedLevel(suspect, 0);
PlayerInfo[suspect][pJailTime] = params[0]*600;
WantedPoints[suspect] = 0;
PlayerInfo[suspect][pWanted] = 0;
PlayerInfo[suspect][pZakonp] -= 1;
SetPlayerSpecialAction(suspect,SPECIAL_ACTION_NONE);
RemovePlayerAttachedObject(suspect,0);
TogglePlayerControllable(suspect, 1);
PlayerInfo[suspect][pJailed] = 1;
PlayerCuffed[suspect] = 0;
}
}
}
else { SendClientMessage(playerid, COLOR_GREY, "Вы далеко от тюрьмы"); return true; }
}
else { SendClientMessage(playerid, COLOR_GREY, "Вы не член полиции/ФБР!"); return true; }
return true;
}
