Command doesn't work for me
#8

try this:
PHP код:
CMD:engine(playeridparams[])
{
    new
        
vehicleid GetPlayerVehicleID(playerid),
        
carid,
         
vehiclemodel;
    if (!
IsPlayerInAnyVehicle(playerid))
        {
    
SendErrorMessage(playerid"You are not in any vehicle.");
        }
    if (!
IsEngineVehicle(vehicleid))
        {
        
SendErrorMessage(playerid"This vehicle doesn't have an engine.");
        }
    if (
GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
        {
    
SendErrorMessage(playerid"You can't do this as you're not the driver.");
        }    
    if (
PlayerData[playerid][pInjured])
       {
        
SendErrorMessage(playerid"You can't do this while being injured or dead.");
        }
    if (
ReturnVehicleHealth(vehicleid) <= 300)
        {
        
SendErrorMessage(playerid"This vehicle is totalled and can't be started.");
        }
        
    if (
CoreVehicles[vehicleid][vehFuel] < 1)
        {
        
SendErrorMessage(playerid"The fuel tank is empty.");
        }    
    
carid Car_GetID(vehicleid);
    
    if (
carid != -&& Car_IsOwner(playeridcarid) || CoreVehicles[vehicleid][vehTemporary] || (PlayerData[playerid][pFaction] != -&& CarData[carid][carFaction] == GetFactionType(playerid)) || IsAJobVehicle(vehicleid) || PlayerData[playerid][pCarKeys] == carid// line 28644
    
{
        
vehiclemodel GetVehicleModel(vehicleid);
        
        switch (
GetEngineStatus(vehicleid))
        {
            case 
false:
            {
                
SetEngineStatus(vehicleidtrue);
                
ShowPlayerFooter(playerid"You have ~g~started~w~ the engine!");
                
SendNearbyMessage(playerid30.0COLOR_PURPLE"** %s inserts the key into the ignition and starts the engine of the %s."ReturnName(playerid0), ReturnVehicleModelName(vehiclemodel));
            }
            case 
true:
            {
                
SetEngineStatus(vehicleidfalse);
                
ShowPlayerFooter(playerid"You have ~r~stopped~w~ the engine!");
                
SendNearbyMessage(playerid30.0COLOR_PURPLE"** %s inserts the key into the ignition and stops the engine of the %s."ReturnName(playerid0), ReturnVehicleModelName(vehiclemodel));
            }
        }
    }
    else 
SendErrorMessage(playerid"You don't have the keys to this vehicle.");
    return 
1;

Reply


Messages In This Thread
Command doesn't work for me - by GoldenLion - 16.07.2016, 12:31
Re: Command doesn't work for me - by Stinged - 16.07.2016, 12:36
Re: Command doesn't work for me - by Konstantinos - 16.07.2016, 12:43
Re: Command doesn't work for me - by GoldenLion - 16.07.2016, 12:49
Re: Command doesn't work for me - by Konstantinos - 16.07.2016, 12:54
Re: Command doesn't work for me - by GoldenLion - 16.07.2016, 13:05
Re: Command doesn't work for me - by Konstantinos - 16.07.2016, 13:15
Re: Command doesn't work for me - by FuNkYTheGreat - 16.07.2016, 13:25
Re: Command doesn't work for me - by GoldenLion - 16.07.2016, 13:25
Re: Command doesn't work for me - by Konstantinos - 16.07.2016, 13:36

Forum Jump:


Users browsing this thread: 2 Guest(s)