SA-MP Forums Archive
Doesn't work. - 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)
+--- Thread: Doesn't work. (/showthread.php?tid=282310)



Doesn't work. - Lynn - 10.09.2011

So this doesn't work, and I don't know why.
pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new newkeys, oldkeys;
    if (IsKeyJustDown(KEY_JUMP, newkeys, oldkeys))
    {
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        SetPlayerPos(playerid, X, Y, Z+5);
    }
    return 1;
}
I get not warnings or errors, but when I go In-Game, and press shift, when entering a car. It does nothing.


Re: Doesn't work. - =WoR=Varth - 10.09.2011

OnPlayerEnterVehicle called in no time/so fast and once when player press f/g near car on default. How can you predict it?
What are you trying to make btw?


Re: Doesn't work. - Lynn - 10.09.2011

I am trying to make it so if they are pressing SHIFT on entering a vehicle,
It places them at their X, Y, Z +5, In-order to prevent Ninja-Jacking.