Problema PD
#7

LOOOL.. eu m-am referit la altceva =))

dupa return1; mai ai "}" ,care inchide comanda respectiva... tu cand ne-ai dat comenzile,ne-ai dat pana la return 1;,eu ti-am zis ca trebuie sa dai pana la "}" (unde se inchide comanda),ca sa nu te incurci cand o pui la loc modificata cum ti-o dam noi ..... la asta m-am referit...


Deci sa inteleg ca ,,, /cuff e in regula,, la /arrest te da in celula,dar nu ii ia banii...


Incearca: si vezi daca ii ia banii


Code:
if(strcmp(cmd, "/arrest", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gTeam[playerid] == 2  || IsACop(playerid))
            {
                if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
                {
                    SendClientMessage(playerid, COLOR_GREY, "{ffffff}you are not on duty!");
                    return 1;
                }
                if(!PlayerToPoint(6.0, playerid, 1526.8973,-1678.2036,5.8906))
                {// Jail spot
                    SendClientMessage(playerid, COLOR_GREY, "{ffffff}Nu esti langa inchisoare,nu poti aresta !");
                    return 1;
                }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, " {FFA500}[INFO]:{ffffff} /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
                    return 1;
                }
                moneys = strval(tmp);
                if(moneys < 1 || moneys > 1000) { SendClientMessage(playerid, COLOR_GREY, "{ffffff}Pretul nu poate fi mai mic de 1$ sau mai mare de 1000$ !"); return 1; }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, " {FFA500}[INFO]:{ffffff} /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
                    return 1;
                }
                new time = strval(tmp);
                if(time < 1 || time > 6000) { SendClientMessage(playerid, COLOR_GREY, "{ffffff}Secundele arestarii nu pot fi mai putine de 1, sau mai mare de 6000, !"); return 1; }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, " {FFA500}[INFO]:{ffffff} /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
                    return 1;
                }
                new bail = strval(tmp);
                if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, "{ffffff}Bail nu poate fi mai putin de 0 sau mai mult de 1 !"); return 1; }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, " {FFA500}[INFO]:{ffffff} /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
                    return 1;
                }
                new bailprice = strval(tmp);
                if(bailprice < 0 || bailprice > 1000) { SendClientMessage(playerid, COLOR_GREY, "{ffffff}Amenda nu poate fi mai mica de 0$ sau mai mare de 1000$ !"); 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) return SendClientMessage(playerid, COLOR_GREY, "{ffffff}Playerul trebuie sa aiba macar level 1 wanted !");
                        if(IsACop(suspect)) return SendClientMessage(playerid,COLOR_GREY,"Nu poti aresta politisti");
                        format(string, sizeof(string), "* You arrested %s !", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        GetPlayerMoney(suspect, moneys);
                        new string2[256];
                        format(string2,sizeof(string2), "Ai fost taxat cu %d $", moneys);
                        SendClientMessage(suspect,COLOR_GRAD2,string2);
                        format(string, sizeof(string), "arrested by %s ~n~    for $%d", sendername, moneys);
                        GameTextForPlayer(suspect, string, 5000, 5);
                        ResetPlayerWeapons(suspect);
                        if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)
                        {
                            format(string, sizeof(string), "<< Ofiterul %s a arestat suspectul %s >>", sendername, giveplayer);
                            OOCNews(COLOR_RED, string);
                        }
                        else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
                        {
                            format(string, sizeof(string), "<<Agentul FBI %s a arestat suspectul %s >>", sendername, giveplayer);
                            OOCNews(COLOR_RED, string);
                        }
                        else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3)
                        {
                            format(string, sizeof(string), "<< Soldatul %s a arestat suspectul %s >>", sendername, giveplayer);
                            OOCNews(COLOR_RED, string);
                        }
                        new rand;
                        SetPlayerInterior(suspect, 6 );
                        rand = random(sizeof(gTurmaProg));
                        SetPlayerPos(suspect,264.6288,77.5742,1001.0391);
                        SetPlayerWorldBounds(suspect,219.44728088379,69.380714416504,1005.0390625); //Оa~?a`?дa*нe`a* i"?оa~. зонu^
                        PlayerInfo[suspect][pJailTime] = time;
                        if(bail == 1)
                        {
                            JailPrice[suspect] = bailprice;
                            format(string, sizeof(string), "Ai fost arestat pentru %d secunde. Cautiune: $%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
                            SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
                        }
                        else
                        {
                            JailPrice[suspect] = 0;
                            format(string, sizeof(string), "Ai fost arestat pentru %d secunde. Cautiune: 0", PlayerInfo[suspect][pJailTime]);
                            SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
                        }
                        PlayerInfo[suspect][pJailed] = 1;
                        PlayerInfo[suspect][pArrested] += 1;
                        SetPlayerFree(suspect,playerid, "ai fost arestat");
                        WantedPoints[suspect] = 0;
                        WantedLevel[suspect] = 0;
                        WantLawyer[suspect] = 1;
                    }//distance
                }//not connected
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "{ffffff}Nu exista acest player");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "{ffffff}Nu esti Cop / FBI / National Guard !");
                return 1;
            }
        }//not connected
        return 1;
}
Reply


Messages In This Thread
Problema PD - by W0rm - 03.08.2012, 21:08
Re: Problema PD - by Flashhiee - 03.08.2012, 21:12
Re: Problema PD - by Babica - 03.08.2012, 21:31
Re: Problema PD - by W0rm - 03.08.2012, 21:34
Re: Problema PD - by Babica - 03.08.2012, 21:58
Re: Problema PD - by W0rm - 03.08.2012, 22:13
Re: Problema PD - by Babica - 03.08.2012, 22:18
Re: Problema PD - by W0rm - 04.08.2012, 11:30
Re: Problema PD - by IuLyAnBoSs - 04.08.2012, 12:07
Re: Problema PD - by W0rm - 04.08.2012, 12:27

Forum Jump:


Users browsing this thread: 1 Guest(s)