SA-MP Forums Archive
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=177583)



PutPlayerInVehicle - FireCat - 18.09.2010

it teleports but it dosnt put him in the vehicle why?
Код:
if (strcmp("/home", cmdtext, true, 10) == 0)
    {
        if (IsPlayerInAnyVehicle(playerid))
        SetVehiclePos(GetPlayerVehicleID(playerid), 1475.8315,-2927.7690,11.1834);
        SetPlayerPos(playerid,1475.8315,-2927.7690,11.1834);
        return 1;
}



Re: PutPlayerInVehicle - Dime - 18.09.2010

you didnt use putplayerinvehicle


Re: PutPlayerInVehicle - Mike_Peterson - 18.09.2010

indeed

Код:
if (strcmp("/home", cmdtext, true, 10) == 0)
    {
        if (IsPlayerInAnyVehicle(playerid))
        SetVehiclePos(GetPlayerVehicleID(playerid), 1475.8315,-2927.7690,11.1834);
        PutPlayerInVehicle(playerid,GetPlayerVehicleID(playerid),0);
        SetPlayerPos(playerid,1475.8315,-2927.7690,11.1834);
        return 1;
}



Re: PutPlayerInVehicle - [XST]O_x - 18.09.2010

What?
No, you just put SetPlayerPos, which removes the player from the vehicle.
pawn Код:
if (strcmp("/home", cmdtext, true, 10) == 0)
    {
        if (IsPlayerInAnyVehicle(playerid))
        SetVehiclePos(GetPlayerVehicleID(playerid), 1475.8315,-2927.7690,11.1834);
        else SetPlayerPos(playerid,1475.8315,-2927.7690,11.1834);
        return 1;
     }
}