[Pomoc] Oko arresta :D

Započeo Novica, Maj 20, 2012, 10:26:14 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Scripta koju koristim: moja..
Detaljan opis problema:Moze neko da mi kaze kako da napravim da npr ako ima 3 wl da ga zatvori na 300 sec ili sl da ne moram da kucam vreme kauciju itd ?
Deo scripte: Nema sta da se da :D
Video/Slike://
RESPECT FOR MILANCE !

vlado_plavsic

Daj komandu arrest da ti je prepravim.

eo brt :D
if(strcmp(cmd, "/arrest", true) == 0 || strcmp(cmd, "/uhapsi", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
if(gTeam[playerid] == 2  || IsACop(playerid))
{
if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
{
    SendClientMessage(playerid, COLOR_GREY, "   Niste 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))
{// Jail spot
    SendClientMessage(playerid, COLOR_GREY, "   You are not near the Jail, can't Arrest!");
    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, -1606.9096,677.2825,-5.2421))
{//New arrest system

tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /uhapsi [novcana kazna] [vrijeme (minuta)] [kaucija (0=ne 1=da)] [iznos kaucije]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 20000) { SendClientMessage(playerid, COLOR_GREY, "   Novcana kazna ne moze biti ispod $1 ni iznad $20000!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /uhapsi [novcana kazna] [vrijeme (minuta)] [kaucija (0=ne 1=da)] [iznos kaucije]");
return 1;
}
new time = strval(tmp);
if(time < 5 || time > 60) { SendClientMessage(playerid, COLOR_GREY, "   Zatvorska kazna ne moze biti ispod 5 ni iznad 60 minuta!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /uhapsi [novcana kazna] [vrijeme (minuta)] [kaucija (0=ne 1=da)] [iznos kaucije]");
return 1;
}
new bail = strval(tmp);
if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, "   Da se dozvoli ili ponisti kaucija, kucajte 0 ili 1!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /uhapsi [novcana kazna] [vrijeme (minuta)] [kaucija (0=ne 1=da)] [iznos kaucije]");
return 1;
}
new bailprice = strval(tmp);
if(bailprice < 0 || bailprice > 20000) { SendClientMessage(playerid, COLOR_GREY, "   Kaucija ne moze biti ispod $0 ni iznad $20000!"); return 1; }
new suspect = GetClosestPlayer(playerid);
if(IsPlayerConnected(suspect))
{
if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedLevel[suspect] < 1)
{
    SendClientMessage(playerid, COLOR_GREY, "   Igrac mora imati barem Wanted Level 1!");
    return 1;
}
format(string, sizeof(string), "* Uhapsili ste %s-a!", giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
SafeGivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "uhapsio vas je %s ~n~    za $%d", sendername, moneys);
GameTextForPlayer(suspect, string, 5000, 5);
SafeResetPlayerWeapons(suspect);
if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)
{
    new currank[64];
    if(PlayerInfo[playerid][pRank] == 1) { currank = "Cadet"; }
else if(PlayerInfo[playerid][pRank] == 2) { currank = "Police Officer"; }
else if(PlayerInfo[playerid][pRank] == 3) { currank = "Corporal"; }
else if(PlayerInfo[playerid][pRank] == 4) { currank = "Sergeant"; }
else if(PlayerInfo[playerid][pRank] == 5) { currank = "Lieutenant"; }
        else if(PlayerInfo[playerid][pRank] == 6) { currank = "Captain"; }
        else if(PlayerInfo[playerid][pRank] == 7) { currank = "Deputy Chief"; }
        else if(PlayerInfo[playerid][pRank] == 8) { currank = "Chief"; }
else { currank = "Cadet"; }
format(string, sizeof(string), "[Policija] %s %s je uhapsio %s-a", currank ,sendername, giveplayer);
OOCNews(COLOR_BLUE, string);
}
else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
{
format(string, sizeof(string), "[Policija] Agent %s je uhapsio %s-a", sendername, giveplayer);
OOCNews(COLOR_BLUE, string);
}
SetPlayerInterior(suspect, 0);
SetPlayerWorldBounds(suspect,-1052.6142,-1179.6550,-931.2334,-1058.4941)
SetPlayerPos(suspect,-1123.5748,-999.8547,129.2187);
//SetPlayerHealth(suspect,0)
TogglePlayerControllable(suspect, 1);
PlayerCuffed[suspect] = 0;
PlayerInfo[suspect][pJailTime] = time * 60;
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "Uhapseni ste na %d sekundi.   Kaucija: $%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_WHITE, string);
}
else
{
    JailPrice[suspect] = 0;
format(string, sizeof(string), "Uhapseni ste na %d sekundi.   Kaucija: Nedostupna", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, COLOR_WHITE, string);
}
PlayerInfo[suspect][pJailed] = 1;
          PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "Uhapsen");
WantedPoints[suspect] = 0;
WantedLevel[suspect] = 0;
WantLawyer[suspect] = 1;
}//distance
}//not connected
else
{
    SendClientMessage(playerid, COLOR_GREY, "   Nema nikoga u blizini za hapsenje.");
    return 1;
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "   Niste na mjestu za hapsenje.");
    return 1;
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "   Niste Policajac / FBI!");
    return 1;
}
}//not connected
return 1;
}
RESPECT FOR MILANCE !