[POMOC] Arrest

Započeo Farkias, Avgust 22, 2012, 11:40:43 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: Explosion RP
Opis Problema: Meni samo lideri moze /arrest a clanovi nikako ne kontam kako to da napravim ?
Dio Skripte: 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 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3)
{
    SendClientMessage(playerid, COLOR_GREY, "   Niste na duznosti!");
    return 1;
}
if(PlayerToPoint(8.0, playerid, 1276.4187,-1656.6719,13.5469) || PlayerToPoint(8.0, playerid,1528.6143,-1678.0155,5.8906) || PlayerToPoint(8.0, playerid,1770.9257,-1546.8690,9.9217))
{

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 > 99999) { SendClientMessage(playerid, COLOR_GREY, "   Novcana kazna ne moze biti ispod $1 ni iznad $99999!"); 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 < 1 || time > 60) { SendClientMessage(playerid, COLOR_GREY, "   Zatvorska kazna ne moze biti ispod 1 ni iznad 20 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 > 3000000) { SendClientMessage(playerid, COLOR_GREY, "   Kaucija ne moze biti ispod $0 ni iznad $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));
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);
SafeJBC_GivePlayerMoney(playerid,1000);
                            SendClientMessage(playerid, COLOR_GREY, "{0080FF}Uhapsili ste osumljicenog i zaradili ste 1000$!");
SafeJBC_GivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "Uhapsio vas je %s ~n~    za $%d", sendername, moneys);
GameTextForPlayer(suspect, string, 5000, 5);
SafeJBC_ResetPlayerWeapons(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), "Vijesti | Pripadnik LSPD %s %s je uhapsio traženog zlocinca  %s-a.", currank ,sendername, giveplayer);
BroadCast(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
{
format(string, sizeof(string), "Vijesti | Pripadnik FBI %s je uhapsio traženog zlocinca %s-a.", sendername, giveplayer);
BroadCast(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3)
{
format(string, sizeof(string), "Vijesti | Pripadnik Cobra 11 %s je uhapsio traženog zlocinca  %s-a.", sendername, giveplayer);
BroadCast(COLOR_LIGHTRED, string);
}
KillTimer(DragTimer[playerid]);
SetPlayerInterior(suspect, 0);
// -------------------------
SetPlayerSkin(suspect, 62);
// -------------------------
                            new rand = random(sizeof(gRandomJailSpawns));
    JBC_SetPlayerPos(suspect, gRandomJailSpawns[rand][0], gRandomJailSpawns[rand][1], gRandomJailSpawns[rand][2]);
                            TogglePlayerControllable(suspect, 0);
SetTimerEx("Zatvor",4000, false, "i", suspect);
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_LIGHTRED, string);
}
else
{
    JailPrice[suspect] = 0;
format(string, sizeof(string), "Uhapseni ste na %d sekundi.   Kaucija: Nedostupna", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, COLOR_WHITE, string);
}
KillTimer(DragTimer[playerid]);
PlayerInfo[suspect][pJailed] = 1;
          PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "Uhapsen");
WantedPoints[suspect] = 0;
WantedLevel[suspect] = 0;
//WantLawyer[suspect] = 1;
}
}
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;
}
}
}
  SendClientMessage(playerid,  COLOR_YELLOW2, "[EuroGaming AC] Komanda koju ste unijeli ne postoji na serveru. Za pomoc komandi vise na /help");
  return 1;
}

Cekaj ako sam upravu tebi kada si obican clan pise "Niste na duznosti." jel da :D?
Probaj ovako nisam siguran da ce raditi ali mozda...


if(strcmp(cmd, "/arrest", true) == 0 || strcmp(cmd, "/uhapsi", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
if(gTeam[playerid] == 2  || IsACop(playerid))
{
if(OnDuty[playerid] != 1)
{
    SendClientMessage(playerid, COLOR_GREY, "   Niste na duznosti!");
    return 1;
}
if(PlayerToPoint(8.0, playerid, 1276.4187,-1656.6719,13.5469) || PlayerToPoint(8.0, playerid,1528.6143,-1678.0155,5.8906) || PlayerToPoint(8.0, playerid,1770.9257,-1546.8690,9.9217))
{

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 > 99999) { SendClientMessage(playerid, COLOR_GREY, "   Novcana kazna ne moze biti ispod $1 ni iznad $99999!"); 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 < 1 || time > 60) { SendClientMessage(playerid, COLOR_GREY, "   Zatvorska kazna ne moze biti ispod 1 ni iznad 20 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 > 3000000) { SendClientMessage(playerid, COLOR_GREY, "   Kaucija ne moze biti ispod $0 ni iznad $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));
if(WantedLevel[suspect] < 1)
{
    SendClientMessage(playerid, COLOR_GREY, "   Igrac mora imati barem Wanted Level 1!");
    return 1;
}
                                                        if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3)
                                                        {
format(string, sizeof(string), "* Uhapsili ste %s-a!", giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
SafeJBC_GivePlayerMoney(playerid,1000);
                            SendClientMessage(playerid, COLOR_GREY, "{0080FF}Uhapsili ste osumljicenog i zaradili ste 1000$!");
SafeJBC_GivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "Uhapsio vas je %s ~n~    za $%d", sendername, moneys);
GameTextForPlayer(suspect, string, 5000, 5);
SafeJBC_ResetPlayerWeapons(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), "Vijesti | Pripadnik LSPD %s %s je uhapsio traženog zlocinca  %s-a.", currank ,sendername, giveplayer);
BroadCast(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
{
format(string, sizeof(string), "Vijesti | Pripadnik FBI %s je uhapsio traženog zlocinca %s-a.", sendername, giveplayer);
BroadCast(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3)
{
format(string, sizeof(string), "Vijesti | Pripadnik Cobra 11 %s je uhapsio traženog zlocinca  %s-a.", sendername, giveplayer);
BroadCast(COLOR_LIGHTRED, string);
}
KillTimer(DragTimer[playerid]);
SetPlayerInterior(suspect, 0);
// -------------------------
SetPlayerSkin(suspect, 62);
// -------------------------
                            new rand = random(sizeof(gRandomJailSpawns));
    JBC_SetPlayerPos(suspect, gRandomJailSpawns[rand][0], gRandomJailSpawns[rand][1], gRandomJailSpawns[rand][2]);
                            TogglePlayerControllable(suspect, 0);
SetTimerEx("Zatvor",4000, false, "i", suspect);
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_LIGHTRED, string);
}
else
{
    JailPrice[suspect] = 0;
format(string, sizeof(string), "Uhapseni ste na %d sekundi.   Kaucija: Nedostupna", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, COLOR_WHITE, string);
}
KillTimer(DragTimer[playerid]);
PlayerInfo[suspect][pJailed] = 1;
          PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "Uhapsen");
WantedPoints[suspect] = 0;
WantedLevel[suspect] = 0;
//WantLawyer[suspect] = 1;
}
}
}
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;
}
}
}
  SendClientMessage(playerid,  COLOR_YELLOW2, "[EuroGaming AC] Komanda koju ste unijeli ne postoji na serveru. Za pomoc komandi vise na /help");
  return 1;
}

Vidi jesu li ti rankovi za policajce pravilno napravljeni i vidi je li imas rankove za PD