[Pomoc] /arrest

Započeo ▂ ▃ ▅ Rudimental ▅ ▃ ▂, Maj 18, 2012, 21:39:51 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Scripta koju koristim: moja..
Detaljan opis problema:posto mi je /arrest namesten tako da policajac moze da bira na kolko ce sekundi da zatvori i kolko para kako bi ja mogao da napravim da on kad kuca /arrest da se automatski ode u zatvor i da mu se po wantedu odluci kaznaa i to da nemora on da kuca vreme i novac ?
Deo scripte:


if(strcmp(cmd, "/arrest", true) == 0 || strcmp(cmd, "/ar", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
if(gTeam[playerid] == 2  || IsACop(playerid))
{
if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
{
    SendClientMessage(playerid, COLOR_GREY, "   Nisi na duznosti !");
    return 1;
}
if(PlayerToPoint(6.0, playerid, 268.3327,77.8972,1001.0391) || PlayerToPoint(15.0, playerid,1537.2515,-1674.9572,13.3828) || PlayerToPoint(6.0, playerid, 1528.9080,-1678.0759,5.8906) || PlayerToPoint(6.0, playerid, 268.3102,77.8113,1001.0391) || PlayerToPoint(6.0, playerid, 268.3290,77.6766,1001.0391))
{//New arrest system

tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /(ar)rest [cena] [vreme (minute)] [kaucija (0= ne | 1= da)] [cena kaucije]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 99999) { SendClientMessage(playerid, COLOR_GREY, "   Ne moze manje od $1 ili vece od $99999!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /(ar)rest  [cena] [vreme (minute)] [kaucija(0= ne | 1= da)] [cena kaucije]");
return 1;
}
new time = strval(tmp);
if(time < 1 || time > 60) { SendClientMessage(playerid, COLOR_GREY, "   Ne moze manje od 1 ili vece od 20 (ako smatrate da je zasluzio vise, onda AREA)!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /(ar)rest  [cena] [vreme (minute)] [kaucija (0= ne | 1= da)] [cena kaucije]");
return 1;
}
new bail = strval(tmp);
if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, "   Ne moze manje od 0 ili vece od 1!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /(ar)rest  [cena] [vreme (minute)] [kaucija (0= ne | 1= da)] [cijena kaucija]");
return 1;
}
new bailprice = strval(tmp);
if(bailprice < 0 || bailprice > 3000000) { SendClientMessage(playerid, COLOR_GREY, "   Ne moze manje od $0 ili vece od $3000000!"); return 1; }
new suspect = GetClosestPlayer(playerid);
if(IsPlayerConnected(suspect))
{
if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Uhapsio si %s!", giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
GivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "uhapseni od strane %s ~n~Iznos kazne $%d", sendername, moneys);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeapons(suspect);
if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)
{
    new currank[64];
    if(PlayerInfo[playerid][pRank] == 1) { currank = "Kadet"; }
else if(PlayerInfo[playerid][pRank] == 2) { currank = "Pomorski policajac"; }
else if(PlayerInfo[playerid][pRank] == 3) { currank = "Prometni policajac"; }
else if(PlayerInfo[playerid][pRank] == 4) { currank = "Interventni policajac"; }
else if(PlayerInfo[playerid][pRank] == 5) { currank = "Inspektor"; }
        else if(PlayerInfo[playerid][pRank] == 6) { currank = "Visi Inspektor"; }
        else if(PlayerInfo[playerid][pRank] == 7) { currank = "Inspektor prometne policije"; }
        else if(PlayerInfo[playerid][pRank] == 8) { currank = "Nacelnik policije"; }
        else if(PlayerInfo[playerid][pRank] == 9) { currank = "Nacelnik MUP-a"; }
else { currank = "Kadet"; }
format(string, sizeof(string), "[Policija] %s %s je uhapsio kriminalca %s", currank ,sendername, giveplayer);
OOCNews(COLOR_BLUE, string);
}
else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
{
format(string, sizeof(string), "Spec Force Agent %s uhapsio je osumnjicenog %s", sendername, giveplayer);
OOCNews(COLOR_BLUE, string);
}
else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3)
{
format(string, sizeof(string), "Sluzbenik MUP-a %s uhapsio je osumnjicenog %s", sendername, giveplayer);
OOCNews(COLOR_BLUE, string);
}
SetPlayerInterior(suspect, 6);
SetPlayerPos(suspect,264.6288,77.5742,1001.0391);
PlayerInfo[suspect][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Zatvoren si na %d sekundi. : $%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_WHITE, string);
}
else
{
    JailPrice[suspect] = 0;
format(string, sizeof(string), "Zatvoren si na %d sekundi. : Nemoguca", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, COLOR_WHITE, string);
}
PlayerInfo[suspect][pJailed] = 1;
          PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "Uhicen");
WantedPoints[suspect] = 0;
WantedLevel[suspect] = 0;
WantLawyer[suspect] = 1;
}//distance
}//not connected
else
{
    SendClientMessage(playerid, COLOR_GREY, "   Osoba nije blizu tebe.");
    return 1;
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "   Nisi na mestu.");
    return 1;
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "   Nisi clan MUP-a !");
    return 1;
}
}//not connected
return 1;
};