SA-MP Forums Archive
Does anyone know how to make this key state only done by the driver? - 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: Does anyone know how to make this key state only done by the driver? (/showthread.php?tid=369741)



Does anyone know how to make this key state only done by the driver? - Tass007 - 18.08.2012

pawn Код:
if ((newkeys & KEY_ANALOG_UP) && !(oldkeys & KEY_ANALOG_UP) && IsPlayerInAnyVehicle(playerid) ){
        if(PlayerInfo[playerid][Level] >=2) {
            {
                new Float:vx, Float:vy, Float:vz;
                GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);
                SetVehicleVelocity(GetPlayerVehicleID(playerid) ,vx*1.3,vy*1.3 ,vz*1.3);
            }
        }
    }
    if ((newkeys & KEY_ANALOG_DOWN) && !(oldkeys & KEY_ANALOG_DOWN) && IsPlayerInAnyVehicle(playerid) ){
        if(PlayerInfo[playerid][Level] >=7) {
            {
                new Float:vx, Float:vy, Float:vz;
                GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);
                SetVehicleVelocity(GetPlayerVehicleID(playerid) ,vx/2.8,vy/2.8 ,vz/2.8);
            }
        }
    }
Hi i want it so only the player that is driving can press these bottons. please help and of course +1 rep.


Re: Does anyone know how to make this key state only done by the driver? - Tass007 - 18.08.2012

Thanks i will hopefully test it soon.