if(strcmp(cmd, "/getcar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /getcar [carid]");
return 1;
}
if (PlayerInfo[playerid][pAdmin] >= 3)
{
new Float:plocx,Float:plocy,Float:plocz;
GetPlayerPos(playerid, plocx, plocy, plocz);
SetVehiclePos(CarID[playerid],plocx,plocy+4, plocz);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}
I started working on the tip frp, Yezizhu. but PutPlayerInVehicle places the player on the passengers seet instead of the drivers position. The problem is that the car isn't activated by sitting on the passengers seet.|
Originally Posted by //exora
https://sampwiki.blast.hk/wiki/PutPlayerInVehicle
Make sure to put him into seatid 0. -> (0-driver, 1-co-driver, 2&3-passengers, if the car has enough seats |


if(strcmp(cmd, "/getcar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /getcar [carid]");
return 1;
}
new testcar = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 3)
{
new Float:plocx,Float:plocy,Float:plocz;
GetPlayerPos(playerid, plocx, plocy, plocz);
PutPlayerInVehicle(playerid, testcar, 0);
SendClientMessage(playerid, COLOR_GRAD1, " You have been teleported");
SetVehiclePos (vehicleid, plocx, plocy, plocz);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}