Jump to content

Cerere+Problema Server


AlexanderSMG

Recommended Posts

Buna ziua,am revenit cu o noua provocare pentru dumneavoastra cei care ma ajutati dar mai ales pentru mine deoarece sunt la inceput. Am un GM cam buguit,dar imi place structura lui si cu el vreau sa imi deschid un server.

Sa trec la subiect. Am intalnit o problema la wanted,pe server maximul de wanted este 10 si nu imi place,vreau sa fie maxim wanted 6 si pe langa asta,wanted-ul dat cu comanda /su "/suspect" unui player e buguita,adica dau cuiva wanted si apare pentru 3 secunde dupa imediat dispare.

Acum vreau sa va cer un FS prin care sunt masurati kilometri parcursi de o masina personala a unui player.

Va multumesc!

Link to comment
Share on other sites

//----------------------------------[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] > 9) return SendClientMessage(playerid, COLOR_GREY, "That player have Maxim Wanted Level! (Wanted 10)");
                        format(string, sizeof(string), "Thay player have Wanted %d , give him a lower wanted level", PlayerInfo[playa][pWanted]);
                        if(PlayerInfo[playa][pWanted] + money > 10) return SendClientMessage(playerid, COLOR_GREY, string);
                        PlayerInfo[playa][pWanted] += money;
                        new wl = PlayerInfo[playa][pWanted];
                        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;
    }

Link to comment
Share on other sites

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); 

Edited by Alberto.
  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.