SA-MP Forums Archive
How to get the player In his last vehicle that he spawned - 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)
+--- Thread: How to get the player In his last vehicle that he spawned (/showthread.php?tid=417186)



How to get the player In his last vehicle that he spawned - Gamer_007 - 20.02.2013

So the topic says all,is there any cmd that when a player do /lvget he will get in his last car purchased by him.I mean teleport his car to that place where the player is.Is any command exist for it?


Re: How to get the player In his last vehicle that he spawned - FUNExtreme - 20.02.2013

There is no pre-made command that will do what you ask for your gamemode. Make it, this is a help section, not a request section


Re: How to get the player In his last vehicle that he spawned - Jstylezzz - 20.02.2013

here's an example

pawn Код:
new Lastid[MAX_PLAYERS];

public OnPlayerExitVehicle(playerid,vehicleid)
{
Lastid[playerid] = vehicleid;
}
CMD:lvget(playerid,params[])
{
if(Lastid[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"You haven't left any vehicles yet!");
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
SetVehiclePos(Lastid[playerid],x+3,y,z);
SendClientMessage(playerid,COLOR_GREEN,"The last vehicle you exited was teleported to you!");
return 1;
It would be something like this


Re: How to get the player In his last vehicle that he spawned - Gamer_007 - 20.02.2013

Quote:
Originally Posted by Jari_Johnson*
Посмотреть сообщение
here's an example

pawn Код:
new Lastid[MAX_PLAYERS];

public OnPlayerExitVehicle(playerid,vehicleid)
{
Lastid[playerid] = vehicleid;
}
CMD:lvget(playerid,params[])
{
if(Lastid[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"You haven't left any vehicles yet!");
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
SetVehiclePos(Lastid[playerid],x+3,y,z);
SendClientMessage(playerid,COLOR_GREEN,"The last vehicle you exited was teleported to you!");
return 1;
It would be something like this
This is somewhat near to it but its not teleporting the last car to me.Need to get a bit closer in it.Btw a rep++; for you.


Re: How to get the player In his last vehicle that he spawned - tyler12 - 20.02.2013

Just place this when a player purchases a vehicle.

Lastid[playerid] = vehicleid;


Re: How to get the player In his last vehicle that he spawned - Gamer_007 - 21.02.2013

thanks Tyler rep++ for you