/lights not working propperly
#1

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;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)