Jump to content
  • 0

Checkpoint blocat


cobalt_thekiller

Question

Salut cand folosesc /find sau /wanted pe cineva care este in biz, cand iese din biz ramane bloc cp ul in fata biz ului si nu se modifica.

        case DIALOG_WANTED: {
            if(!response) return 1;            
            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));
            SendClientMessage(playerid,COLOR_YELLOW,string);                    
        }    

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] != 11 && !IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Nu ai jobul 'Detective'.");
    if(sscanf(params, "u",id)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: {FFFFFF}/find [name/playerid]");
    if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
    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 SendClientMessage(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));
    SendClientMessage(playerid,COLOR_YELLOW,string);
    for(new m; m < 2; m++) {
        if(PlayerInfo[playerid][pDailyMission][m] == 12) CheckMission(playerid, m);
        if(PlayerInfo[playerid][pDailyMission][m] == 11) CheckMission(playerid, m);
    }            
     return 1; 
 }

function ExitFunction(playerid) {
    new i;
    if(InHouse[playerid] != -1) {
        i = InHouse[playerid];
        if(PlayerInfo[playerid][pSleeping] == 1) 
            return true;    
        
        if(!PlayerToPoint(2, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
            return true;

        SetPlayerPosEx(false, playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
        SetPlayerFreeze(playerid, 3);
        SetPlayerInterior(playerid,0);
        SetPlayerVirtualWorld(playerid, 0);
        PlayRadio[playerid] = 0;
        StopAudioStreamForPlayer(playerid);
        return true;
    }
    if(InBussines[playerid] != -1) {
        i = InBussines[playerid];
        if(!PlayerToPoint(2, playerid,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ]))
            return true;

        SetPlayerInterior(playerid, 0);
        SetPlayerPosEx(false, playerid,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ]);
        SetPlayerFreeze(playerid, 3);
        PlayerInfo[playerid][pLocal] = 255;
        PlayRadio[playerid] = 0;
        StopAudioStreamForPlayer(playerid);
        SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pTutorial] < 10 ? playerid + 10 : 0);
        return true;
    }
    if(InHQ[playerid] != -1) {
        i = InHQ[playerid];
        if(!PlayerToPoint(2, playerid, DynamicFactions[i][fcX], DynamicFactions[i][fcY], DynamicFactions[i][fcZ]))
            return true;

        SetPlayerPosEx(false, playerid, DynamicFactions[i][extX], DynamicFactions[i][extY], DynamicFactions[i][extZ]);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
        return true;
    }
    if(InClanHQ[playerid] != -1) {
        if(!PlayerToPoint(2, playerid, ClanHQInfo[i][cEnterX], ClanHQInfo[i][cEnterY], ClanHQInfo[i][cEnterZ]))
            return true;

        SetPlayerInterior(playerid, 0);
        SetPlayerFreeze(playerid, 3);
        SetPlayerPosEx(false, playerid, ClanHQInfo[i][cPosX], ClanHQInfo[i][cPosY], ClanHQInfo[i][cPosZ]);
        SetPlayerVirtualWorld(playerid, 0);
    }
    return true;
}

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

ia-o și tu logic. când intră într-un biz, jucătorului i se atribuie valoarea InBussines, InHouse, etc... dupa iesire, adica ExitFunction, i se sterge acea valoare, se schimba de fapt. 

nu mai luati b-hood de la HPQ de pe net daca nu stiti sa-l serviti. simplu. 

function ExitFunction(playerid) {
    new i;
    if(InHouse[playerid] != -1) {
        i = InHouse[playerid];
        if(PlayerInfo[playerid][pSleeping] == 1) 
            return true;    
        
        if(!PlayerToPoint(2, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
            return true;

        SetPlayerPosEx(false, playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
        SetPlayerFreeze(playerid, 3);
        SetPlayerInterior(playerid,0);
        SetPlayerVirtualWorld(playerid, 0);
        PlayRadio[playerid] = 0;
        StopAudioStreamForPlayer(playerid);
        InHouse[playerid] = -1; // uita-te aici.
        return true;
    }
    if(InBussines[playerid] != -1) {
        i = InBussines[playerid];
        if(!PlayerToPoint(2, playerid,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ]))
            return true;

        SetPlayerInterior(playerid, 0);
        SetPlayerPosEx(false, playerid,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ]);
        SetPlayerFreeze(playerid, 3);
        PlayerInfo[playerid][pLocal] = 255;
        PlayRadio[playerid] = 0;
        StopAudioStreamForPlayer(playerid);
        SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pTutorial] < 10 ? playerid + 10 : 0);
        InBussines[playerid] = -1; // uita-te si aici.
        return true;
    }
    if(InHQ[playerid] != -1) {
        i = InHQ[playerid];
        if(!PlayerToPoint(2, playerid, DynamicFactions[i][fcX], DynamicFactions[i][fcY], DynamicFactions[i][fcZ]))
            return true;

        SetPlayerPosEx(false, playerid, DynamicFactions[i][extX], DynamicFactions[i][extY], DynamicFactions[i][extZ]);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
        InHQ[playerid] = -1; // poate intelegi pana la urma.
        return true;
    }
    if(InClanHQ[playerid] != -1) {
        i = InClanHQ[playerid];
        if(PlayerToPoint(2, playerid, ClanHQInfo[i][cEnterX], ClanHQInfo[i][cEnterY], ClanHQInfo[i][cEnterZ])){
            SetPlayerInterior(playerid, 0);
            SetPlayerFreeze(playerid, 3);
            SetPlayerPosEx(false, playerid, ClanHQInfo[i][cPosX], ClanHQInfo[i][cPosY], ClanHQInfo[i][cPosZ]);
            SetPlayerVirtualWorld(playerid, 0);
            InClanHQ[playerid] = -1;  // daca intra, trebuie sa si iasa.     
        } 
    }
    return true;
}

 

Edited by [emy]
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.