SA-MP Forums Archive
Teleport Private vehicles - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Teleport Private vehicles (/showthread.php?tid=252143)



Teleport Private vehicles - NitoPSG - 30.04.2011

I have created some private vehicles using this codes:

Код:
vls = AddStaticVehicle(468,-2622.9917,2286.4600,7.8810,357.9488,0,0);
Код:
new terryw[24]; // We create a variable which will contain the players name.
  GetPlayerName(playerid, terryw, sizeof(terryw)); // We use GetPlayerName to store the name in 'PlayerName'.

  if(newstate == PLAYER_STATE_DRIVER) // Check the new state, since he's the driver in this case, we continue.
  {
   new Vehicle = GetPlayerVehicleID(playerid); // This saves the player's vehicle id into the variable 'vehicle'
   if(Vehicle == vls) // We check if the vehicle is the one we don't want everyone to enter
   { // It is, so we continue.
     if(strcmp(terryw,"vls",true)) // We use strcmp to check if the player who entered the car is the same as 'Matthias'
     {
      RemovePlayerFromVehicle(playerid); // It's not, so we remove the player from the car.
      SendClientMessage(playerid, 0x33AA33AA, "This is only for vls"); // And we inform him about why he got removed from the car.
     }
   }
  }
so now i need a command that will teleport the player's private vehicle to him when he type /telemycar
how to make this command? :/


Re: Teleport Private vehicles - NitoPSG - 30.04.2011

Quote:
Originally Posted by NitoPSG
Посмотреть сообщение
I have created some private vehicles using this codes:

Код:
vls = AddStaticVehicle(468,-2622.9917,2286.4600,7.8810,357.9488,0,0);
Код:
new terryw[24]; // We create a variable which will contain the players name.
  GetPlayerName(playerid, terryw, sizeof(terryw)); // We use GetPlayerName to store the name in 'PlayerName'.

  if(newstate == PLAYER_STATE_DRIVER) // Check the new state, since he's the driver in this case, we continue.
  {
   new Vehicle = GetPlayerVehicleID(playerid); // This saves the player's vehicle id into the variable 'vehicle'
   if(Vehicle == vls) // We check if the vehicle is the one we don't want everyone to enter
   { // It is, so we continue.
     if(strcmp(terryw,"vls",true)) // We use strcmp to check if the player who entered the car is the same as 'Matthias'
     {
      RemovePlayerFromVehicle(playerid); // It's not, so we remove the player from the car.
      SendClientMessage(playerid, 0x33AA33AA, "This is only for vls"); // And we inform him about why he got removed from the car.
     }
   }
  }
so now i need a command that will teleport the player's private vehicle to him when he type /telemycar
how to make this command? :/
pleaseeee!!!! helpp!!!!!!!


Re: Teleport Private vehicles - Steven82 - 30.04.2011

Get the players position and use the SetVehiclePos function...