Jump to content
  • 0

Comenzi /wanted /find


TheGodfather

Question

Salut, am o problema cu aceste 2 comenzi. Imi pune checkpoint gresit cand cineva se afla intr-o casa/hq/biz

YCMD:wanted(playerid, params[], help) {
    if(!IsACop(playerid)) return SCM(playerid, COLOR_GREY, "Nu faci parte din factiunea politiei.");
    if(OnDuty[playerid] == 0) return SCM(playerid, COLOR_LGREEN, "Nu poti folosi aceasta comanda deoarece nu esti la datorie!");
    new iString[1024],string[300],count = 0,online[50];
    strcat(iString, "Name\tWanted level\tChased by\n");
    if(IsPlayerConnected(playerid)) {
        foreach(Player,i) {
            if(PlayerInfo[pWantedLevel] >= 1) {
                SelectedPlayers[playerid][count] = i;
                string[0] = 0;
                format(string, sizeof(string), "%s (%d)\tWanted level %d\t%d cops\n",GetName(i),i,PlayerInfo[pWantedLevel],ChasedBy(i));
                count++;
                strcat(iString,string);
            }
        }
        format(online, sizeof(online),"Wanted online: %d",count);
        if(count == 0) return SCM(playerid,COLOR_GREY, "Nu sunt suspecti conectati.");
        ShowPlayerDialog(playerid, DIALOG_WANTED, DIALOG_STYLE_TABLIST_HEADERS, online, iString , "Ok", "Exit");
    }
    return 1;
}

 

YCMD:find(playerid, params[], help) {
    if(JobWorking[playerid] == 1) return 1;
    if(CP[playerid] != 0 || targetfind[playerid] != -1) return ShowPlayerDialog(playerid, DIALOG_CHECKPOINT, DIALOG_STYLE_MSGBOX, "Checkpoint", "Ai deja un checkpoint activ.\nDoresti sa-l anulezi? Daca da, apasa pe 'Ok'.", "Ok", "Exit");
    new id,giveplayer[30],string[100];
    if(PlayerInfo[playerid][pJob] != 6 && PlayerInfo[playerid][pMember] != 1 && PlayerInfo[playerid][pMember] != 2 && PlayerInfo[playerid][pMember] != 14 && !IsACop(playerid)) return SCM(playerid, COLOR_GREY, "Nu ai jobul 'Detective'.");
    if(sscanf(params, "u",id)) return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/find <playerid/name>");
    if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY, "Acel player nu este conectat.");
    if(Spectate[id] != 255) return SCM(playerid, COLOR_GREY, "Acel player este ocupat!");
    if(id == playerid) return SCM(playerid, COLOR_GREY, "Nu poti folosi aceasta comanda asupra ta!");
    if(togfind[id] == 1) return SCM(playerid,COLOR_GREY, "Acel player nu poate fi urmarit!");
    if(GetPVarInt(id, "Undercover") == 1) return SCM(playerid, COLOR_GREY, "Acel player este ocupat!");
    if(BizRobbed[playerid] != 0) return 1;
    if(togfind[id] == 1 && OnDuty[playerid] == 0 && PlayerHit[playerid] == -1) return SCM(playerid, COLOR_LGREEN, "Eroare: Acel player nu poate fi urmarit!");
    UsedFind[playerid] = 1;
    GetPlayerName(id, giveplayer, sizeof(giveplayer));
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(id, X,Y,Z);
    SetPlayerCheckpointEx(playerid, X,Y,Z, 3.5);
    targetfind[playerid] = id;
    CP[playerid] = 53;
    format(string, sizeof(string), "* Punctul rosu a fost setat pe %s (%d) care se afla in zona %s.",giveplayer,id,GetPlayerZone(id));
    SCM(playerid,COLOR_YELLOW,string);
    for(new m; m < 2; m++) {
        if(PlayerInfo[playerid][pDailyMission][m] == 12) CheckMission(playerid, m);
    }
     return 1;
}

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

    new Float: x, Float: y, Float: z; GetPlayerPos(id, x, y, z);
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, x, y, z, 3.5);

la /find inlocuieste cu alea si la /wanted da-mi dialog-ul DIALOG_WANTED

 

 

Cand eram mic, eram mare zdreanta Eu fut*am femei, vara miu umbla prin casa

LINIE-3.gif.f4c03161035b1ce4c431755a78bed2ae.gif.aacf6e45f3894429f134b2e37f997f6f.gif

Discord: ㍿ Luca лол㍿ツ#5482

Sunt de moda veche inca mai cred in Respect!

LINIE-3.gif.f4c03161035b1ce4c431755a78bed2ae.gif.bcf86dadd9b43351554dd738f470725f.gif

 

Link to comment
Share on other sites

  • 0

O sa incerc imediat comanda /find cu modificarile mentionate. 

case DIALOG_WANTED: {
            if(!response) return true;            
            new id = SelectedPlayers[playerid][listitem];
            if(PlayerInfo[id][pWantedLevel] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Acel player nu mai are wanted!");
            ShowMDC(playerid, id);
            UsedFind[playerid] = 1;
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(id, X,Y,Z);
            SetPlayerCheckpointEx(playerid, X,Y,Z, 3.5);
            targetfind[playerid] = id;
            CP[playerid] = 53;
            format(string, sizeof(string), "* Punctul rosu a fost setat pe %s (%d) care se afla in zona %s.",GetName(id),id,GetPlayerZone(id));
            SCM(playerid,COLOR_YELLOW,string);
        
        }

Link to comment
Share on other sites

  • 0

@LucaPawnL Ii dai bine dar el vrea sa umble dupa persoana cautata, adica faci un timer si ii tot pui CP pe el si daca intra in HQ ii pui in fata la intrare.

Ce inseamna cuvantul "Unic" este atunci cand Chestia / Obiectul / Idea / etc... nu exista in alta parte.

Copii, nu mai veniti cu vorbe de "Am gamemode unic", nu exista asa ceva, la ora actuala totul este pe net.

Aveti grija pe cine ajutati, majoritatea sunt caini.

Link to comment
Share on other sites

  • 0
Acum 15 ore, TheGodfather a spus:

Nu merge bine /find, cand e in hq la factiune sau clan hq. In rest la casa/biz merge ok. In poza asta trebuia sa imi puna cp unde scrie Los Santos ...

image.png

iti trebuiesc niste variabile care sa stocheze id casei/bizz-ului/hq-ului in care se afla. Acele variabile le actualizezi la enter exit si la comenzile de teleport. Daca in acea variabila este o valoare diferita decat cea default(cand nu se afla intr-un interior) atunci nu vei mai folosi GetPlayerPos ci vei folosi coordonate de la intrararea respectiva. In comanda ta /find iti trebuie un case ca sa faci asta. BTW o sa ti trebuiasca si un timer ca sa actualizezi pozitia pt ambele comezi.

Link to comment
Share on other sites

  • 0
La 30.06.2020 la 15:31, valivaly96 a spus:

iti trebuiesc niste variabile care sa stocheze id casei/bizz-ului/hq-ului in care se afla. Acele variabile le actualizezi la enter exit si la comenzile de teleport. Daca in acea variabila este o valoare diferita decat cea default(cand nu se afla intr-un interior) atunci nu vei mai folosi GetPlayerPos ci vei folosi coordonate de la intrararea respectiva. In comanda ta /find iti trebuie un case ca sa faci asta. BTW o sa ti trebuiasca si un timer ca sa actualizezi pozitia pt ambele comezi.

Daca e gm meu poți să îmi dai un mesaj pe discord HPQ123(</>)8114 te ajut eu.

Edited by HPQ123
  • Like 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
Answer this question...

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