AlexanderSMG Posted December 12, 2015 Report Share Posted December 12, 2015 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! Quote Link to comment Share on other sites More sharing options...
VenoWW Posted December 12, 2015 Report Share Posted December 12, 2015 Prezinta liniile script-ului . Quote Link to comment Share on other sites More sharing options...
AlexanderSMG Posted December 12, 2015 Author Report Share Posted December 12, 2015 //----------------------------------[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; } Quote Link to comment Share on other sites More sharing options...
Alberto. Posted December 12, 2015 Report Share Posted December 12, 2015 inlocuieste linia asta: if(money > 6) return SendClientMessage(playerid, COLOR_GREY, "Maximum wanted level is 6!"); Quote Link to comment Share on other sites More sharing options...
AlexanderSMG Posted December 12, 2015 Author Report Share Posted December 12, 2015 Da dar de exemplu,daca un player face 10 killuri el i-a wanted 10. Adica vreau ca orice ai face mai mult de wanted 6 sa nu iei. Quote Link to comment Share on other sites More sharing options...
Alberto. Posted December 12, 2015 Report Share Posted December 12, 2015 aa, inteleg ce vreau sa zici. Uite un mod: if (PlayerInfo[playa][pWanted] >= 6) {; SetPlayerWantedLevel(playa, 6); } Quote Link to comment Share on other sites More sharing options...
AlexanderSMG Posted December 13, 2015 Author Report Share Posted December 13, 2015 Nu prea mi-ai fost de ajutor,nu am inteles ce ai vrut sa zici... Quote Link to comment Share on other sites More sharing options...
Alberto. Posted December 13, 2015 Report Share Posted December 13, 2015 (edited) 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 December 13, 2015 by Alberto. 1 Quote Link to comment Share on other sites More sharing options...
AlexanderSMG Posted December 13, 2015 Author Report Share Posted December 13, 2015 Multumesc,am rezolvat cu Wanted-ul,acum cine stie sau are,cum implementez un kilometraj pentru masinile personale,sa indice cati kilometri ai facut cu masini personala. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.