Jump to content
  • 0

Problema checkpoint


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

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
22 minutes ago, [emy] said:

arata pe unde mai apare UsedFind.

postează cod. 

dacă folosești SetPlayerPosEx(false, posX, posY, posZ) etc, te rog să îl postezi aici prima oară.

 

ca idee, 

postează și ExitFunction(playerid)

 

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

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.

  • Similar Content

    • By AlexCelTare
      Salut imi poate spune cineva cum fac atunci cand un player intra intr-un checkpoint, sa ii dea alt checkpoint si tot asa?
       
      Eu am facut asa:
      Dar habar nu am cum sa fac mai multe checkpointuri dupa ce intra intr-unul
       
      new bool:onCheck[MAX_PLAYERS];
      public OnPlayerCommandText(playerid, cmdtext[])
          if (strcmp("/startmission", cmdtext, true, 10) == 0)
          {
              if(IsPlayerInRangeOfPoint(playerid, 3.0, 2333.1101,-1072.5065,1049.0234))
              {
              SetPlayerCheckpoint(playerid, -2130.9629,-2061.5767,63.3069, 3.0);
              onCheck[playerid] = true;
              }
              return 1;
          }
       
      public OnPlayerEnterCheckpoint(playerid)
      {
          if(onCheck[playerid]) // if it's true
          {
              GivePlayerMoney(playerid, 10);
              GameTextForPlayer(playerid,"~g~Mission 1 : Discover Dealership Completed!\nAnd Got +10$",3000,4);
              DisablePlayerCheckpoint(playerid);
              onCheck[playerid] = false;
          }
    • By St3f4n36
      Cum as putea fac urmatoarea chestie:
      Daca intr-un dialog imi apare ca primeste x bani daca apasa cazul 1 ( banii formati cu new money = 100 + rand(100); )
      si dupa sa imi trimita un mesaj tot cu aceasi suma de bani x. Trebuie salvata intr-o variabila sau cum?
    • By FlobertRO
      Buna , am si eu o problema . Mi-se restarteaza serverulul random . In server_log am gasit asta : 
      Stie cineva ce pot face  Va rog ❤️ . Multumesc frumos
       
       
      [23:17:26] [join] rezana has joined the server (1:---------------------) [23:17:26] [debug] Run time error 4: "Array index out of bounds" [23:17:26] [debug] Accessing element at index 1 past array upper bound 0 [23:17:26] [debug] AMX backtrace: [23:17:26] [debug] #0 00200b24 in ?? (... <1 argument>) at GM.pwn:8108 [23:17:26] [debug] #1 000aef80 in public MP_OPC (playerid=1) at C:\Users\xda\Desktop\gamemode-impact\gamemode-rpg-impact\pawno\include\YSI\y_hooks/impl.inc:633 [23:17:26] [debug] #2 native CallLocalFunction () from samp03svr [23:17:26] [debug] #3 0000c77c in public SSCANF_OnPlayerConnect (playerid=1) at C:\Users\xda\Desktop\gamemode-impact\gamemode-rpg-impact\pawno\include\mSelection.inc:432 [23:17:26] [debug] #4 00003210 in public Itter_OnPlayerConnect (playerid=1) at C:\Users\xda\Desktop\gamemode-impact\gamemode-rpg-impact\pawno\include\sscanf2.inc:236 [23:17:26] [debug] #5 00001684 in public OnPlayerConnect (playerid=1) at C:\Users\Florin\Dxda\gamemode-impact\gamemode-rpg-impact\pawno\include\YSI\y_iterate.inc:646
    • By CenzoR
      Salut! Am conectat gamemodeul, imi zice ca baza de date s-a conectat cu succes, daaaarrr... cand vreau sa intru pe el... spune ca parola este incorecta ca si cum ai avea baza de date neconectata, datele sunt puse in gamemode, am verificat totul, de la ce poate sa vina problema ma puteti ajuta?
    • By Rby Robert
      cand dau /ad pe server scriu acolo /ad Recrutez in clanul .... nu apare ad pe server apare la staff Preview ad dar pe server la playerii nu apare
      Aceasta este comanda
      YCMD:ad(playerid, params[], help) {
          if(AdTimer[playerid] != 0) return SCM(playerid, COLOR_LGREEN, "Ai pus un anunt recent. Foloseste comanda /myad pentru a-l vedea.");
          new string[264],idx;
          if(!PlayerInfo[playerid][pPhone]) return SCM(playerid, COLOR_LGREEN, "Nu ai un telefon.");
          if(PlayerInfo[playerid][pMuted] == 1) {
              format(string, sizeof(string), "You can't talk right now! You are muted. (%d seconds)",PlayerInfo[playerid][pMuteTime]);
              SCM(playerid, COLOR_GREY, string);
              return true;
          }
          if(PlayerInfo[playerid][pLevel] < 5) return SCM(playerid, COLOR_GREY, "Ai nevoie de nivel 5 pentru a da un anunt!");
          new length = strlen(params);
          while ((idx < length) && (params[idx] <= ' ')) idx++;
          new offset = idx, result[264];
          while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
              result[idx - offset] = params[idx];
              idx++;
          }
          result[idx - offset] = EOS;
          new totalads = TotalAds()+1;
          if(PlayerToPoint(10, playerid, BizzInfo[11][bEntranceX], BizzInfo[11][bEntranceY], BizzInfo[11][bEntranceZ])) {
              if(!strlen(result)) return SCM(playerid, COLOR_GREY, "Usage:{FFFFFF}/ad <Text>");
              if(FaceReclama(result)) return Reclama(playerid, result);
              new payout = BizzInfo[14][bFee];
              if(PlayerMoney(playerid, payout)) {
                  format(string, sizeof(string), "* Ai folosit %d caractere si anuntul costa $%s, Nu ai banii necesari", offset, FormatNumbers(payout));
                  SCM(playerid, COLOR_WHITE, string);
                  return true;
              }
              GivePlayerCash(playerid, 0, payout);
              format(string, sizeof(string), "~r~Ai platit $%d~n~~w~Mesajul contine: %d caractere", payout, idx);
              GameTextForPlayer(playerid, string, 5000, 5);
              format(AdText[playerid], 256, result);
              format(string, sizeof(string), "[PREV AD] %s ({FFFFFF}%d{00D900}): %s", GetName(playerid), playerid, result);
              SendStaffMessage(0xDE1414FF, string);
              AdTimer[playerid] = totalads*60;
              new timer;        
              timer = SetTimerEx("Advertisment", totalads*60000, 0, "d", playerid);
              SetPVarInt(playerid, "AdTimer", timer); 
              format(string, sizeof(string), "Anuntul tau va fi afisat in %d minute (%d secunde).", AdTimer[playerid]/60, AdTimer[playerid]);
              SCM(playerid, -1, string);
              BizzInfo[14][bBalance] += payout;
              new str[128];
              mysql_format(SQL,str,128,"UPDATE bizz SET `Till`='%d',`Products`='%d' WHERE `ID`='1'",BizzInfo[14][bBalance],BizzInfo[14][bProducts]);
              mysql_tquery(SQL,str, "", "");
          }
          else SCM(playerid, -1, "Nu esti la CNN.");
          return true;
      }
      function Advertisment(playerid) {
          if(IsPlayerConnected(playerid) && AdTimer[playerid] != 0) {
              new string[1024];
              format(string, sizeof(string), "Ad by %s (phone: {FFFFFF}%d{00D900}): %s",GetName(playerid),PlayerInfo[playerid][pPhone],AdText[playerid]);
              SendMessage(0x00D900FF, string);
              AdTimer[playerid] = 0;
          }
          return true;
      }
      function TotalAds() {
          new x;
          foreach(Player, i) {
              if(IsPlayerConnected(i) && AdTimer[i] != 0) x++;
          }
          return x;
      }
  • Recently Browsing   0 members

    No registered users viewing this page.

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