Jump to content

Alberto.

Membru
  • Posts

    153
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by Alberto.

  1. ai inlocuit asta "if(PlayerInfo[playerid][pAdmin] >= 1) " cu asta " if(PlayerInfo[playerid][pAdmin] >= 1) || BigEar[playerid] == 1) " ?

    edit// ti-am dat-o eu gresit, se inchide paranteza dubla la sfarsit

    uite cum e corect: if(PlayerInfo[playerid][pAdmin] >= 1 || BigEar[playerid] == 1))

  2. //----------------------------------[SetCrim]-----------------------------------------------
    if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
        {
            if(IsPlayerConnected(playerid))
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp)) return SendClientMessage(playerid, -1, "USAGE: /(su)spect [PlayerID/PartOfName] [Wanted] [Reason]");
                new playa;
                new money;
                playa = ReturnUser(tmp);
                tmp = strtok(cmdtext, idx);
                money = strval(tmp);
                if (IsACop(playerid))
                {
                    if(IsPlayerConnected(playa))
                    {
                        if(playa != INVALID_PLAYER_ID)
                        {
                            new length = strlen(cmdtext);
                            while ((idx < length) && (cmdtext[idx] <= ' '))
                            {
                                idx++;
                            }
                            new offset = idx;
                            new result[64];
                            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                            {
                                result[idx - offset] = cmdtext[idx];
                                idx++;
                            }
                            result[idx - offset] = EOS;
                            result[0] = toupper(result[0]);
                            if(!strlen(result)) return SendClientMessage(playerid, -1, "USAGE: /(su)spect [PlayerID/PartOfName] [Wanted] [Reason]");
                            if (gTeam[playa] == 2 || IsACop(playa)) return SendClientMessage(playerid, -1, "You can't Suspect a Cop!");
                            if(PlayerInfo[playa][pJailed] == 1 || PlayerInfo[playa][pJailed] == 2) return SendClientMessage(playerid, COLOR_WHITE, "You can't suspect a jailed player");
                            if(money > 10) return SendClientMessage(playerid, COLOR_GREY, "Maximum wanted level is 10!");
                            if(money == 0) return SendClientMessage(playerid, COLOR_GREY, "Minimum wanted level is 0!");
                            if(PlayerInfo[playa][pWanted] > 6) return SendClientMessage(playerid, COLOR_GREY, "That player have Maxim Wanted Level! (Wanted 6)");
                            format(string, sizeof(string), "Thay player have Wanted %d , give him a lower wanted level", PlayerInfo[playa][pWanted]);
                            if(PlayerInfo[playa][pWanted] + money > 6) return SendClientMessage(playerid, COLOR_GREY, string);
                            PlayerInfo[playa][pWanted] += money;
                            new wl = PlayerInfo[playa][pWanted];

                           if(PlayerInfo[playa][pWanted] >= 7)

                            {

                            SetPlayerWantedLevel(playa, 6)

                            }

                            else

                             {
                            SetPlayerWantedLevel(playa, wl);

                            }
                            GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            format(string, sizeof(string), "You commited a crime ( %s ) [+%d],Raportat de: %s",result,money,sendername);
                            SendClientMessage(playa, COLOR_LIGHTRED, string);
                            for(new i = 0; i < MAX_PLAYERS; i++)
                            {
                                if(IsPlayerConnected(i))
                                {
                                    if(PlayerInfo[pMember] == 1 || PlayerInfo[pLeader] == 1 || PlayerInfo[pMember] == 2 || PlayerInfo[pLeader] == 2 || PlayerInfo[pMember] == 3 || PlayerInfo[pLeader] == 3)
                                    {
                                        format(string, sizeof(string), "HQ: All units APB: Reporter: %s.",sendername);
                                        SendClientMessage(i, 0x0000C1FF, string);
                                        format(string, sizeof(string), "HQ: Crime: %s[+%d], Suspect: %s. ",result,money,giveplayer);
                                        SendClientMessage(i, 0x0000C1FF, string);
                                    }
                                }
                            }
                        }
                    }
                } else return SendClientMessage(playerid, COLOR_GREY, "You are not a Cop!");
            }
            return 1;
        }

  3. vezi unde ai conditia:   if(PlayerInfo[playerid][pAdmin] >= 1)

    adaugi:   BigEar[playerid] == 1;

    trebuie sa iti iasa ceva in genul: if(PlayerInfo[playerid][pAdmin] >= 1 || BigEar[playerid] == 1)

    Deci adaugi conditia "BigEar[playerid] == 1" la toate chat-urile.

  4. am analizat mai bine comanda. Cred ca ar fii necesar doar sa ii pui un return atunci cand iti arata acel text

    Comanda: 

    }
        if(strcmp(cmd, "/editcarmodel", true) == 0)
        {
            if(IsPlayerConnected(playerid))
            {
                if(PlayerInfo[playerid][pAdmin] < 4)
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "   Nu esti Admin !");
                    return 1;
                }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /editcarmodel [modelid]");
                    return 1;
                }
                new proplev = strval(tmp);
                for(new i = 0; i < sizeof(CarInfo); i++)
                {
                    if(IsAnOwnableCar(idcar))
                    {
                        CarInfo[idcar][cModel] = proplev;
                        format(string, sizeof(string), "Car: %d is now %d",idcar,CarInfo[idcar][cModel]);
                        SendClientMessage(playerid, COLOR_GRAD2, string);
                        OnPropUpdate();

                      return 1; // asta am adaugat 
                    }
                }
            }
            return 1;
        }

  5. ok, o luam incet, si eu sunt nou pe aici si nici nu ma prea pricep la explicat.

    bun, ai linia asta in gm-ul tau:

    new wl = PlayerInfo[playa][pWanted];   // aici, variabila "wl" ia valoarea pWanted (adica sa vada cat de urmarit e player-ul, daca pot spune asa)

      SetPlayerWantedLevel(playa, wl);  // aici, aceasta comanda seteaza acele stelute de urmarire in functie de numarul de wanted)

    Eu ti-am sugerat ca sa fac adaugi in gm urmatorul lucru:

    new wl = PlayerInfo[playa][pWanted]; // asta ti-am zis mai sus ce face
     SetPlayerWantedLevel(playa, wl);  // asta ti-am zis mai sus ce face

    if (PlayerInfo[playa][pWanted] >= 6) // aici pui condiatia (daca player-ului are nivelul de urmarire mai mare sau egal cu 6 faci urmatoarea instructiune)

    {
     SetPlayerWantedLevel(playa, 6); // aceasta instructiune seteaza numarul de stele automat la 6, daca acesta il depaseste

    }

    Sper ca te-am lamurit si ca ti-am fost de ajutor. Ca o paranteza:

    Adaugi acest lucru:

    if (PlayerInfo[playa][pWanted] >= 6)

    {
    ;                        SetPlayerWantedLevel(playa, 6);

    }

    De preferabil sub linia: 

    SetPlayerWantedLevel(playa, wl); 

    • Upvote 1
  6.  

    ia incearca asa.

     if(strcmp(cmd, "/editcarmodel", true) == 0)
        {

                new proplev = strval(tmp);
                for(new i = 0; i < sizeof(CarInfo); i++)
                if(PlayerInfo[playerid][pAdmin] >= 5)
                {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))

               {
                    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /editcarmodel [modelid]");
                    return 1;
                    if(IsAnOwnableCar(idcar))
                    {
                        CarInfo[idcar][cModel] = proplev;
                        format(string, sizeof(string), "Car: %d is now %d",idcar,CarInfo[idcar][cModel]);
                        SendClientMessage(playerid, COLOR_GRAD2, string);
                        OnPropUpdate();

                      return 0;
                    }
                }
            }

           else return SendClientMessage(playerid, COLOR_GRAD2, "Nu esti admin.");
            return 1;
        }

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.