Lights
#1

i need help me a problem it's been buzzing me for years..(months) i cant make it work!a lights sistem!no errors
no warnings just no work i go in game at 1:00am and i press button 2(not numpad)and no work

PHP код:
#include <a_samp>
new boolVehicleLightsOn[MAX_VEHICLES];
new 
enginelightsalarmdoorsbonnetbootobjective;
#define PRESSED(%0) \
    
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public 
OnPlayerStateChange(playeridnewstateoldstate)
{
    if (
newstate == PLAYER_STATE_DRIVER)
    {
        if (
VehicleLightsOn[GetPlayerVehicleID(playerid)] == true)
        {
            new 
vehicleid;
            
vehicleid GetPlayerVehicleID(playerid);
            
GetVehicleParamsEx(vehicleidenginelightsalarmdoorsbonnetbootobjective);
            
SetVehicleParamsEx(vehicleidenginetruealarmdoorsbonnetbootobjective);
            
VehicleLightsOn[GetPlayerVehicleID(playerid)] = true;
        }
        else
        {
            
GetVehicleParamsEx(vehicleidenginelightsalarmdoorsbonnetbootobjective);
            
SetVehicleParamsEx(vehicleidenginefalsealarmdoorsbonnetbootobjective);
             
VehicleLightsOn[GetPlayerVehicleID(playerid)] = false;
        }
    }
}
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if (
PRESSED(KEY_SUBMISSION))
    {
        if (
IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            if (
VehicleLightsOn[GetPlayerVehicleID(playerid)] == false)
            {
                
GetVehicleParamsEx(vehicleidenginelightsalarmdoorsbonnetbootobjective);
                
SetVehicleParamsEx(vehicleidenginetruealarmdoorsbonnetbootobjective);
                
VehicleLightsOn[GetPlayerVehicleID(playerid)] = true;
            }
            else
            {
                new 
enginelightsalarmdoorsbonnetbootobjective;
                
GetVehicleParamsEx(vehicleidenginelightsalarmdoorsbonnetbootobjective);
                
SetVehicleParamsEx(vehicleidenginefalsealarmdoorsbonnetbootobjective);
                
VehicleLightsOn[GetPlayerVehicleID(playerid)] = false;
            }
        }
    }
    return 
1;

PS:in gamemode under ongamemodeinit i have ManualVehicleEngineAndLights();[/quote]

i post it at thread and no oe answer i got it 10 days..
Reply


Messages In This Thread
Lights - by Dan_Barocu - 17.04.2012, 04:06
Re: Lights - by RollTi - 17.04.2012, 04:09
Re: Lights - by ReneG - 17.04.2012, 04:20
Re: Lights - by Dan_Barocu - 17.04.2012, 04:23
Re: Lights - by Dan_Barocu - 17.04.2012, 18:38
Re: Lights - by Dan_Barocu - 18.04.2012, 00:39
Re: Lights - by Lilcuete - 18.04.2012, 00:53
Re: Lights - by Lilcuete - 18.04.2012, 00:55
Re: Lights - by Dan_Barocu - 18.04.2012, 00:58
Re: Lights - by Lilcuete - 18.04.2012, 01:00

Forum Jump:


Users browsing this thread: 1 Guest(s)