Jump to content
  • 0

Checkpoint (AddStaticVehicle) =D


XpLoD

Question

if(CP[playerid] == 87)
	{
	    SetPlayerVirtualWorld(playerid,1);
		DisablePlayerCheckpoint(playerid);
		SetPlayerCheckpoint(playerid,1905.7734,2775.6323,10.2457,3.0);
		GetPlayerPos(playerid,X,Y,Z);
		GetPlayerFacingAngle(playerid,A);
		Vehicle[playerid] = AddStaticVehicle(411,X,Y,Z,A,-1,-1);
		SetVehicleVirtualWorld(Vehicle[playerid], 1);
		LinkVehicleToInterior(Vehicle[playerid], 0);
		PutPlayerInVehicle(playerid,Vehicle[playerid],0);
		CP[playerid] = 88;
	}

Cand intru in el(Checkpoint),in loc sa-mi dea o singura masina, se creeaza milioane de masini (Fara sa se mai opreasca) si se blocheaza jocu...

Aveti o idee,ce as putea face? xD Thanks.

ll364l6j8dg3et84ks3w.png

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.
  • 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 GamerulFOX
      Deci, cand intru in primul checkpoint nu imi apare urmatorul ! Imi apare primul dar cand intru in el dispare si nu apare urmatorul !

      https://imgur.com/a/4lUvC4Z
    • By Colentinian
      Salut, am facut un sistem de drag racing cu acelasi CP pentru ambii jucatori, insa daca cel care a dat /drag (id) intra primul in CP, acesta nu se dezactiveaza, se dezactiveaza doar daca intra cel care a dat /accept drag.
      YCMD:drag(playerid, params[], help) {
          new userID, szMessage[180];
          if(!PlayerToPoint(10, playerid, 748.0566,-2379.0576,12.9100)) return SCM(playerid, COLOR_GREY, "Nu te aflii pe pista de drag.");
          if(GetPlayerState(playerid)!=PLAYER_STATE_DRIVER) return SCM(playerid, COLOR_ORANGE, "Nu esti la volanul unei masini!");
          if(sscanf(params, "u", userID)) return SCM(playerid, COLOR_GREY, "Syntax: {FFFFFF}/drag <playerid/name>");
          if(!IsPlayerConnected(userID) && userID == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY, "Acel player nu este conectat.");
          if(!PlayerToPoint(10, userID, 748.0566,-2379.0576,12.9100)) return SCM(playerid, -1, "Acel player nu este pe pista de drag!");
          if(GetPlayerState(userID)!=PLAYER_STATE_DRIVER) return SCM(playerid, COLOR_ORANGE, "Acel player nu este la volanul unei masini!");
          if(userID == playerid) return SCM(playerid, COLOR_GREY, "Nu poti folosi aceasta comanda asupra ta!");
          if(!ProxDetectorS(10.0, playerid, userID)) return SCM(playerid, COLOR_GREY, "Nu esti langa acel jucator.");
          if(DragID[userID] == playerid) return SCM(playerid, COLOR_LGREEN, "Eroare: I-ai trimis deja o invitatie acestui player!");
          DragID[userID] = playerid;
          format(szMessage, 256, "%s(%d) te-a invitat sa faci o cursa cu el cu el! (/accept drag %d).", GetName(playerid), playerid, playerid);
          SCM(userID, 0xFAD4D4FF, szMessage);
          format(szMessage, 256, "L-ai invitat pe %s(%d) sa faca o cursa cu tine.", GetName(userID), userID);
          SCM(playerid, 0xFAD4D4FF, szMessage);
          return 1;
      }    
       
      if( strcmp ( x_job, "drag" , true ) == 0 )
          {
              new userID = id;
              if(DragID[playerid] == -1) return SCM(playerid,COLOR_WHITE,"Nimeni nu te-a invitat sa faci o cursa.");
              if(id == playerid) return SCM(playerid, COLOR_GREY, "Nu poti folosi aceasta comanda asupra ta!");
              if(!PlayerToPoint(10, playerid, 748.0566,-2379.0576,12.9100)) return SCM(playerid, COLOR_GREY, "Nu te aflii pe pista de drag.");
              if(GetPlayerState(playerid)!=PLAYER_STATE_DRIVER) return SCM(playerid, COLOR_ORANGE, "Nu esti la volanul unei masini!");
              if(GetPVarInt(userID, "InDrag") == 1) return SCM(playerid, -1, "Acel player este deja intr-o cursa.");
              if(IsPlayerConnected(id)) {
                  if(DragID[playerid] == id)
                  {
                      new vehuserid = GetPlayerVehicleID(userID);
                      new    vehplayerid = GetPlayerVehicleID(playerid);
                      if(!ProxDetectorS(10.0, playerid, id)) return SCM(playerid, COLOR_GREY, "Nu te aflii langa acel jucator!");
                      SetPVarInt(playerid, "InDrag", 1);
                      SetPVarInt(userID, "InDrag", 1);
                      SetVehiclePosEx(userID, vehuserid, 756.0446,-2377.2810,12.6371);
                      SetVehicleZAngleEx(vehuserid, 180);
                      SetPlayerFacingAngle(userID, 183.8938);
                      SetVehiclePosEx(playerid, vehplayerid, 740.3959,-2377.2373,12.6371);
                      SetVehicleZAngleEx(vehplayerid, 180);
                      SetPlayerFacingAngle(playerid, 183.8938);
                      PutPlayerInVehicle(playerid, GetPlayerVehicleID(playerid), 0);
                      PutPlayerInVehicle(userID, GetPlayerVehicleID(userID), 0);
                      TogglePlayerControllable(playerid, 0);
                      TogglePlayerControllable(userID, 0);
                      TextDrawShowForPlayer(playerid, CountTD);
                      Countnr = 5;
                      Count();
                      TextDrawShowForPlayer(userID, CountTD);
                      Countnr = 5;
                      Count();
                      SetTimerEx("drag", 5000, false, "i", playerid);
                      SetTimerEx("drag", 5000, false, "i", userID);
                      foreach(new i : Player)
                      {
                          SetPlayerRaceCheckpoint(i, 1, 748.2872,-2689.0310,12.8837, 0.0,0.0,0.0, 25); 
                          CP[playerid] = 618;
                          
                      }
          if(CP[playerid] == 618) {
              foreach(new i : Player)
              {
                  DisablePlayerRaceCheckpoint(i);
                  SetPVarInt(i, "InDrag", 0);    
              }
          }
    • By cobalt_thekiller
      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;
      }
    • By cobalt_thekiller
      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; 
       }
  • 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.