how can i put player in vehicle they just spawned
#1

i know there are lots of existing FS out there tht do this but im learning so i have this

Code:
CMD:spawn(playerid, params[])
{
  new idx;
  new cid;
  new tmp[256];
  new Float:x, Float:y, Float:z;
  GetPlayerPos(Pid,x,y,z);

  tmp = strtok(params, idx);
  if(isnull(params))
  {
    SendClientMessage(Pid, 0x00ff00FF, "usage /spawn [vehicleid]");
    return 1;
  }
  else
  {
  new Float:Xv;
  Xv = x -5.0;
  cid = strval(tmp);
  AddStaticVehicleEx(cid,Xv,y,z,180.0,-1,-1,0);
  return 1;
  }
}
so if someone would be so kind as to tell me how the fook to put the player in the vehicle that was spawned i b most greatfull thanks.

ps. im not being lazy iv tryed a few things none work
Reply
#2

pawn Code:
CMD:spawn(playerid, params[])
{
  new idx;
  new cid, vid;
  new tmp[256];
  new Float:x, Float:y, Float:z;
  GetPlayerPos(Pid,x,y,z);

  tmp = strtok(params, idx);
  if(isnull(params))
  {
    SendClientMessage(Pid, 0x00ff00FF, "usage /spawn [vehicleid]");
    return 1;
  }
  else
  {
  new Float:Xv;
  Xv = x -5.0;
  cid = strval(tmp);
  vid = AddStaticVehicleEx(cid,Xv,y,z,180.0,-1,-1,0);
  PutPlayerInVehicle(playerid, vid, 0);
  return 1;
  }
}
Reply
#3

lol thanks for fast reply so simple was thinking to much into it nice1
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)