CTRL for vehicle headlights
#1

I tryied this, but CTRL don't work. I want CTRL for turn headlights on/off.
PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
        if(
newkeys == KEY_ACTION // KEY_SUBMISSION = butonul 2 - Daca apesi 2 vei deschide / inchide farurile
    
{
        if(!
IsPlayerInAnyVehicle(playerid)) return true// Daca playerul nu e in masina oprim 'operatiunea'
        
new enginelightsalarmdoorsbonnetbootobjective// Cream niste variabile pentru a stoca informatiile despre masini
        
new vid GetPlayerVehicleID(playerid); // Cream o variabiabila gen 'shortcut' pentru a nu mai scrie 'GetPlayerVehicleID(playerid)'
        
GetVehicleParamsEx(videnginelightsalarmdoorsbonnetbootobjective); // Stocam informatiile despre masina in variabilile create; // La fel ca mai sus doar ca opusu (o pornim daca e oprita)
        
if(lights == VEHICLE_PARAMS_ONSetVehicleParamsEx(videngineVEHICLE_PARAMS_OFFalarmdoorsbonnetbootobjective); // Daca lumina este pornita , o oprim - Traducere mot-a-mot :P
        
if(lights == VEHICLE_PARAMS_OFFSetVehicleParamsEx(videngineVEHICLE_PARAMS_ONalarmdoorsbonnetbootobjective);
        }
        return 
1;

Reply
#2

KEY_ACTION is generally assigned to Tab.
Reply
#3

But in vehicle is LCTRL.
Reply
#4

https://sampwiki.blast.hk/wiki/Keys
The key is KEY_FIRE
Reply
#5

Still don't work.
Reply
#6

-.-
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) 
{ 
        if(newkeys == KEY_ACTION) // KEY_SUBMISSION = butonul 2 - Daca apesi 2 vei deschide / inchide farurile 
        { 
            if(IsPlayerInAnyVehicle(playerid))  // Daca playerul nu e in masina oprim 'operatiunea' 
            {
                new engine, lights, alarm, doors, bonnet, boot, objective; // Cream niste variabile pentru a stoca informatiile despre masini 
                new vid = GetPlayerVehicleID(playerid); // Cream o variabiabila gen 'shortcut' pentru a nu mai scrie 'GetPlayerVehicleID(playerid)' 

                GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective); // Stocam informatiile despre masina in variabilile create; // La fel ca mai sus doar ca opusu (o pornim daca e oprita) 
                if(lights == VEHICLE_PARAMS_ON) SetVehicleParamsEx(vid, engine, VEHICLE_PARAMS_OFF, alarm, doors, bonnet, boot, objective); // Daca lumina este pornita , o oprim - Traducere mot-a-mot :P 
                if(lights == VEHICLE_PARAMS_OFF) SetVehicleParamsEx(vid, engine, VEHICLE_PARAMS_ON, alarm, doors, bonnet, boot, objective); 
            }
        } 
        return 1; 
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)