Same numbers
#5

You know...Like fuel system.

PHP код:
if(GetPlayerSpeed(playerid) > 0)
    {
        if(
PRESSED(KEY_LEFT))
        {
            
PlayerInfo[playerid][Turning] = 1;
        }
        else
        {
            
PlayerInfo[playerid][Turning] = 0;
        }
        if(
PRESSED(KEY_JUMP))
        {
            
PlayerInfo[playerid][Turning] = 1;
        }
        else
        {
            
PlayerInfo[playerid][Turning] = 0;
        }
        if(
PRESSED(KEY_RIGHT))
        {
            
PlayerInfo[playerid][Turning] = 1;
        }
        else
        {
            
PlayerInfo[playerid][Turning] = 0
PHP код:
public MainTimer()
{
    new 
string[128];
    new 
Float:xFloat:yFloat:z;
    for(new 
i=0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            if(
GetPlayerState(i) == PLAYER_STATE_DRIVER)
            {
                new 
vehicleid GetPlayerVehicleID(i);
                if(!
IsBicycle(vehicleid) && Fuel[vehicleid] > 0)
                {
                    if(
GetPlayerSpeed(i) > 0)
                    {
                        if(
TireInfo[vehicleid][Front_Left_Tire] != || TireInfo[vehicleid][Front_Right_Tire] != || TireInfo[vehicleid][Rear_Right_Tire] != || TireInfo[vehicleid][Rear_Left_Tire] != 0)
                        {
                            if(
PlayerInfo[i][Turning] == 1)
                            {
                                new 
string0[100],string1[100],string2[100],string3[100];
                                
TireInfo[vehicleid][Front_Left_Tire] -= random(TireInfo[vehicleid][Front_Left_Tire]);
                                
TireInfo[vehicleid][Front_Right_Tire] -= random(TireInfo[vehicleid][Front_Right_Tire]);
                                
TireInfo[vehicleid][Rear_Left_Tire] -= random(TireInfo[vehicleid][Rear_Left_Tire]);
                                
TireInfo[vehicleid][Rear_Right_Tire] -= random(TireInfo[vehicleid][Rear_Right_Tire]);
                                
format(string0 sizeof(string0) , "{33ff66}%d {ff0000} priekine kaire padanga.",TireInfo[vehicleid][Front_Left_Tire]); ///ERORR
                                
format(string1 sizeof(string1) , "{33ff66}%d {ff0000} priekine desine padanga.",TireInfo[vehicleid][Front_Right_Tire]); ///ERORR
                                
format(string2 sizeof(string2) , "{33ff66}%d {ff0000} galine kaire padanga.",TireInfo[vehicleid][Rear_Left_Tire]); ///ERORR
                                
format(string3 sizeof(string3) , "{33ff66}%d {ff0000} galine desine padanga.",TireInfo[vehicleid][Rear_Right_Tire]); ///ERORR
                                
SendClientMessage(i,COLOR_RED,string0);
                                
SendClientMessage(i,COLOR_RED,string1);
                                
SendClientMessage(i,COLOR_RED,string2);
                                
SendClientMessage(i,COLOR_RED,string3);
                            }
                        }
                     }
                    
//////////////////////////////////////////////
                    
Fuel[vehicleid] -= GetPlayerSpeed(i)/1000.0;
                    
////////////////////////////////////////////////////////////////
                    
if(TireInfo[vehicleid][Front_Left_Tire] <= 0)
                    {
                        new 
panelsdoorslightstires;
                        
GetVehicleDamageStatus(vehicleidpanelsdoorslightstires);
                        
UpdateVehicleDamageStatus(vehicleidpanelsdoorslights, (tires 0b1000));
                    }
                    if(
TireInfo[vehicleid][Front_Right_Tire] <= 0)
                    {
                        new 
panelsdoorslightstires;
                        
GetVehicleDamageStatus(vehicleidpanelsdoorslightstires);
                        
UpdateVehicleDamageStatus(vehicleidpanelsdoorslights, (tires 0b0010));
                    }
                    if(
TireInfo[vehicleid][Rear_Left_Tire] <= 0)
                    {
                        new 
panelsdoorslightstires;
                        
GetVehicleDamageStatus(vehicleidpanelsdoorslightstires);
                        
UpdateVehicleDamageStatus(vehicleidpanelsdoorslights, (tires 0b0100));
                    }
                    if(
TireInfo[vehicleid][Rear_Right_Tire] <= 0)
                    {
                        new 
panelsdoorslightstires;
                        
GetVehicleDamageStatus(vehicleidpanelsdoorslightstires);
                        
UpdateVehicleDamageStatus(vehicleidpanelsdoorslights, (tires 0b0001));
                    }
                }
            }
        }
    } 
Reply


Messages In This Thread
Same numbers - by Dziugsas - 23.04.2014, 13:30
Re: Same numbers - by Konstantinos - 23.04.2014, 13:51
Re: Same numbers - by Dziugsas - 23.04.2014, 13:58
Re: Same numbers - by Konstantinos - 23.04.2014, 14:08
Re: Same numbers - by Dziugsas - 23.04.2014, 14:11
Re: Same numbers - by Dziugsas - 23.04.2014, 14:13
Re: Same numbers - by Konstantinos - 23.04.2014, 14:20
Re: Same numbers - by Dziugsas - 23.04.2014, 14:28
Re: Same numbers - by Dziugsas - 23.04.2014, 14:31
Re: Same numbers - by BroZeus - 23.04.2014, 15:07

Forum Jump:


Users browsing this thread: 1 Guest(s)