26 Errors with Array
#4

try this

PHP код:
CMD:engine(playeridparams[])
{
    if(
IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new 
vehicleidstring[128];
        
vehicleid GetPlayerVehicleID(playerid);
        if(
GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
        
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
        if(
engine == VEHICLE_PARAMS_ON)
        {
            
SetVehicleEngine(vehicleidplayerid);
        }
        else if((
engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
        {
            if(
Fuel[vehicleid] < 1.0)
            {
                
SendClientMessageEx(playeridCOLOR_GRAD2" Your vehicle is out of fuel, it won't start!");
            }
            else
            {
                    for(new 
i=0d<MAX_PLAYERVEHICLESi++)
                    {
                        if(
PlayerVehicleInfo[i][d][pvId] == vehicleid)
                        {
                            if(
== playerid)
                            {
                                else if(
== PlayerInfo[playerid][pVehicleKeysFrom])
                                {
                                    if(!
IsABike(vehicleid))
                                    {
                                        
SendClientMessageEx(playeridCOLOR_WHITE"Vehicle engine starting, please wait...");
                                        
SetTimerEx("SetVehicleEngine"10000"dd",  vehicleidplayerid);
                                        
format(stringsizeof(string), "* %s twists the key in the ignition, turning the engine on."GetPlayerNameEx(playerid));
                                        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                        return 
1;
                                    }
                                    else
                                    {
                                        
SendClientMessageEx(playeridCOLOR_WHITE"Vehicle engine starting, please wait...");
                                        
SetTimerEx("SetVehicleEngine"7000"dd",  vehicleidplayerid);
                                        
format(stringsizeof(string), "* %s flips the killswitch to the on position and depresses the ignition switch, turning the engine on."GetPlayerNameEx(playerid));
                                        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                        return 
1;
                                    }
                                }
                            }
                            else if(
!= playerid)
                            {
                                if(
PlayerInfo[playerid][pHasCarJack] == 1)
                                {
                                    if(
PlayerInfo[playerid][pJackingCar] == 1)
                                    {
                                        
SendClientMessageEx(playeridCOLOR_GRAD2"  You are already attempting to jack the car, please wait!");
                                        return 
1;
                                    }
                                    else
                                    {
                                        
format(stringsizeof(string), "* %s takes out a set of tools and attempts to wire the ignition."GetPlayerNameEx(playerid));
                                        
ProxDetector(20.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                        
SendClientMessageEx(playeridCOLOR_WHITE"Attempting to wire the ignition...");
                                        
GameTextForPlayer(playerid"~r~Attempting to wire the ignition..."100003);
                                        
SetTimerEx("WireIgnition"100000"id"playeridvehicleid);
                                        
PlayerInfo[playerid][pJackingCar] =1;
                                        
PlayerInfo[playerid][pJackAttempts] --;
                                        if(
PlayerInfo[playerid][pJackAttempts] == 0)
                                        {
                                            
PlayerInfo[playerid][pHasCarJack] =0;
                                            
SendClientMessageEx(playeridCOLOR_WHITE"This is your last attempt, the tool kit has worn down...");
                                        }
                                        return 
1;
                                    }
                                }
                                else
                                {
                                    
SendClientMessageEx(playeridCOLOR_GRAD2"  You do not have the keys for this vehicle / any car jacking items to start the ignition!");
                                }
                            }
                        }
                    }
                }
            }
        }
          return 
1;
  } 
Reply


Messages In This Thread
26 Errors with Array - by cedizon - 24.05.2014, 11:04
Re : 26 Errors with Array - by yusei - 24.05.2014, 11:28
Re: 26 Errors with Array - by cedizon - 24.05.2014, 11:44
Re : 26 Errors with Array - by yusei - 24.05.2014, 12:15

Forum Jump:


Users browsing this thread: 1 Guest(s)