Turn signal problem
#1

Well , alot of problems i have lol

I tried to make kinda of turn signals system but it's not working so well

OnPlayerKeyStateChange:
PHP код:
if(PRESSED(KEY_LOOK_RIGHT))
    {
        new 
vehicleid GetPlayerVehicleID(playerid);
        if(
IsPlayerInVehicle(playeridvehicleid))
        {
            if(!
IsVehicleAirVehicleEx(vehicleid))
            {
                
FlashTimerR[vehicleid] = SetTimerEx("FlashLightR"120true,"i",vehicleid);
                
DestroyFlashTimerR[vehicleid] = SetTimerEx("DestroyFlashLightR"700false,"i",vehicleid);
            }
        }
    }
    if(
PRESSED(KEY_LOOK_LEFT))
    {
        new 
vehicleid GetPlayerVehicleID(playerid);
        if(
IsPlayerInVehicle(playeridvehicleid))
        {
            if(!
IsVehicleAirVehicleEx(vehicleid))
            {
                
FlashTimerL[vehicleid] = SetTimerEx("FlashLightL"120true,"i",vehicleid);
                
DestroyFlashTimerL[vehicleid] = SetTimerEx("DestroyFlashLightL"700false,"i",vehicleid);
            }
        }
    } 
Timers:
PHP код:
forward FlashLightR(vehicleid);
public 
FlashLightR(vehicleid)
{
    new 
panels,doors,lights,tires;
    
GetVehicleDamageStatus(vehicleidpanelsdoorslightstires);
    if(
lights == 1)
    {
        
UpdateVehicleDamageStatus(vehicleidpanelsdoors5tires);
        
lights 5;
    }
    else if(
lights == 5)
    {
        
UpdateVehicleDamageStatus(vehicleidpanelsdoors1tires);
        
lights 1;
    }
    return 
1;
}
forward DestroyFlashLightR(vehicleid);
public 
DestroyFlashLightR(vehicleid)
{
    new 
panels,doors,lights,tires;
    
GetVehicleDamageStatus(vehicleidpanelsdoorslightstires);
    
UpdateVehicleDamageStatus(vehicleidpanelsdoors5tires);
    
KillTimer(FlashTimerR[vehicleid]);
    return 
1;
}
forward FlashLightL(vehicleid);
public 
FlashLightL(vehicleid)
{
    new 
panels,doors,lights,tires;
    
GetVehicleDamageStatus(vehicleidpanelsdoorslightstires);
    if(
lights == 4)
    {
        
UpdateVehicleDamageStatus(vehicleidpanelsdoors5tires);
        
lights 5;
    }
    else if(
lights == 5)
    {
        
UpdateVehicleDamageStatus(vehicleidpanelsdoors4tires);
        
lights 4;
    }
    return 
1;
}
forward DestroyFlashLightL(vehicleid);
public 
DestroyFlashLightL(vehicleid)
{
    new 
panels,doors,lights,tires;
    
GetVehicleDamageStatus(vehicleidpanelsdoorslightstires);
    
UpdateVehicleDamageStatus(vehicleidpanelsdoors5tires);
    
KillTimer(DestroyFlashTimerL[vehicleid]);
    return 
1;

It's not stoping and when i press to activate the right one its activating the left one...And the right one it's never stops
Reply


Messages In This Thread
Turn signal problem - by Banditul18 - 12.03.2017, 20:24
Re: Turn signal problem - by Vince - 12.03.2017, 21:03
Re: Turn signal problem - by Banditul18 - 12.03.2017, 22:50
Re: Turn signal problem - by Banditul18 - 14.03.2017, 19:26
Re: Turn signal problem - by Spmn - 14.03.2017, 19:30

Forum Jump:


Users browsing this thread: 3 Guest(s)