How to get the player In his last vehicle that he spawned
#1

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?
Reply
#2

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
Reply
#3

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
Reply
#4

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.
Reply
#5

Just place this when a player purchases a vehicle.

Lastid[playerid] = vehicleid;
Reply
#6

thanks Tyler rep++ for you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)