SA-MP Forums Archive
/lights not working propperly - 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: /lights not working propperly (/showthread.php?tid=540339)



/lights not working propperly - weedxd - 04.10.2014

So when i type /lights IG the car lights show for less then a sec and then turnoff, when i exit vehicle they turn on. How to fix this ?

PHP код:
CMD:lights(playeridparam[])
{
    new 
string[128], idx;
    if(!
IsPlayerLoggedIn(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playeridCOLOR_GREY"You are not driving a vehicle.");
    
idx GetPlayerVehicleID(playerid);
    new 
enginelightsalarmdoorsbonnetbootobjective;
    
GetVehicleParamsEx(idxenginelightsalarmdoorsbonnetbootobjective);
    if(!
lights)
    {
        
SetVehicleParamsEx(idxengine1alarmdoorsbonnetbootobjective);
        
format(stringsizeof(string), "* %s turns their vehicle's lights on."RPN(playerid));
        
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
        
GameTextForPlayer(playerid"~g~Lights On"35003);
    }
    else
    {
        
SetVehicleParamsEx(idxengine0alarmdoorsbonnetbootobjective);
        
format(stringsizeof(string), "* %s turns their vehicle's lights off."RPN(playerid));
        
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
        
GameTextForPlayer(playerid"~r~Lights Off"35003);
    }
    return 
1;