PutPlayerInVehicle
#1

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

CreateVehicle
PutPlayerInVehicle

nuf said.
Reply
#3

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

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

Quote:
Originally Posted by ColdXX
View Post
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.
Reply
#6

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

Quote:
Originally Posted by Da_Boss
View Post
put setplayerpos in first..
Already did that....
Reply
#8

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)