PutPlayerInVehicle - 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: PutPlayerInVehicle (
/showthread.php?tid=178948)
PutPlayerInVehicle -
ColdXX - 24.09.2010
Hey!
I have a teleport , /nrg, when i teleport there i want the player to be placed on a NRG!
How can i do that?
Thanks.
Re: PutPlayerInVehicle -
LarzI - 24.09.2010
CreateVehicle
PutPlayerInVehicle
nuf said.
Re: PutPlayerInVehicle -
Hiddos - 24.09.2010
pawn Code:
if(!strcmp(cmdtext, "/nrg", true))
{
SetPlayerPos(playerid, pos);
new Float:Pos[4]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]); GetPlayerFacingAngle(playerid, Pos[3]);
new veh = CreateVehicle(522, Pos[0], Pos[1], Pos[2], Pos[3], -1, -1);
PutPlayerInVehicle(playerid, veh, 0);
//More to do with "veh"
return 1;
}
Re: PutPlayerInVehicle -
ColdXX - 24.09.2010
Yea i know,but i have like 35 parkours,that was just an example.
I was wondering if there is another way of doing it?
Thanks anyways.
Re: PutPlayerInVehicle -
The_Moddler - 24.09.2010
Quote:
Originally Posted by ColdXX
Yea i know,but i have like 35 parkours,that was just an example.
I was wondering if there is another way of doing it?
Thanks anyways.
|
Just that one.
Re: PutPlayerInVehicle -
ColdXX - 24.09.2010
Yea well hiddos posted few seconds before me and i didnt notice it lol

But its not working, lol it places me in a NRG but at the place that i am at that moment
Re: PutPlayerInVehicle -
ColdXX - 24.09.2010
Quote:
Originally Posted by Da_Boss
put setplayerpos in first..
|
Already did that....
Re: PutPlayerInVehicle -
[XST]O_x - 24.09.2010
pawn Code:
forward Timer(playerid);
new Float:x,Float:y,Float:z,Float:a,nrg;
stock CreateNRG(playerid)
{
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
nrg = CreateVehicle(522,x,y,z,a,-1,-1);
SetTimerEx("Timer",3000,false,"i",playerid);
return 1;
}
public Timer(playerid)
{
PutPlayerInVehicle(playerid,nrg,0);
return 1;
}
That's just a simple stock so you won't have to do all these lines every time.
pawn Code:
if(strcmp,cmdtext,"/parkour", true) == 0)
{
SetPlayerPos(playerid,parkourx,parkoury,parkourz);
CreateNRG(playerid);
return 1;
}