SA-MP Forums Archive
[Help!] Putting player in vehicle when Key pushed - 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: [Help!] Putting player in vehicle when Key pushed (/showthread.php?tid=278117)



[Help!] Putting player in vehicle when Key pushed - WojteQ - 20.08.2011

Hi, I have a problem
Could anybody write me code for a Key function which will put player in vehicle as 1 position (front passenger).

Info:
Key - KEY_LOOK_RIGHT
Distance (player to vehicle) - 15
Vehicles (with which will it work) - 417, 460
Position (in vehicle) - 1 (front passenger)

It's really important to me! Please do it for me! I have tried but no effefcts
WojteQ


Re: [Help!] Putting player in vehicle when Key pushed - sleepysnowflake - 20.08.2011

I do not understand nothing from what you said. But here is something I tihnk it will help:

pawn Code:
if(newkeys == KEY_LOOK_RIGHT && oldkeys == KEY_LOOK_RIGHT)
    {
    new Infernus, Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid,x,y,z);
    GetPlayerFacingAngle(playerid,a);
    Infernus = CreateVehicle(411,x,y,z,a,6,1,100000);
    PutPlayerInVehicle(playerid,Infernus,1);
    LinkVehicleToInterior(Infernus,GetPlayerInterior(playerid));
    return 1;
    }



Re: [Help!] Putting player in vehicle when Key pushed - WojteQ - 20.08.2011

I mean when player's distance to a specified vehicle model it puts him in this vehicle, but when he presses KEY_LOOK_RIGHT.

Example:
I am 30 from leviathan and push E. Nothing happens. I'm 0-15 from leviathan and push E - it puts me in this leviathan as front passenger (1 in pawn).