Unknown command
#5

PHP код:
CMD:engine(playeridparams[])
{
    new 
vehicleidcaridmodel;
    if(!
IsPlayerInAnyVehicle(playerid)) return SendErrorMessage(playerid"You are not in any vehicle.");
    if(!
IsEngineVehicle(vehicleid)) return SendErrorMessage(playerid"This vehicle doesn't have an engine.");
    if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendErrorMessage(playerid"You can't do this as you're not the driver.");
    if(
PlayerData[playerid][pInjured]) return SendErrorMessage(playerid"You can't do this while being injured or dead.");
    if(
ReturnVehicleHealth(vehicleid) <= 300) return SendErrorMessage(playerid"This vehicle is totalled and can't be started.");
    if(
CoreVehicles[vehicleid][vehFuel] < 1) return SendErrorMessage(playerid"The fuel tank is empty.");
    if(
carid != -&& Car_IsOwner(playeridcarid) || CoreVehicles[vehicleid][vehTemporary] || CoreVehicles[vehicleid][vehRental]  && PlayerData[playerid][pRentedVehicle] == vehicleid || CoreVehicles[vehicleid][vehJob] || (PlayerData[playerid][pFaction] != -&& CarData[carid][carFaction] == GetFactionType(playerid)) || PlayerData[playerid][pCarKeys] == carid)
    {
        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(model));
            }
            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(model));
            }
        }
    }
    
SendErrorMessage(playerid"You don't have the keys to this vehicle.");
    return 
1;

Show us the used stocks like IsVehicleEngine...ect
Are you putting the code inside OnPlayerCommandText brackets? if you have some lines there show us
Reply


Messages In This Thread
Unknown command - by GoldenLion - 01.08.2016, 18:46
Re: Unknown command - by Luicy. - 01.08.2016, 18:48
Re: Unknown command - by FuNkYTheGreat - 01.08.2016, 19:17
Re: Unknown command - by GoldenLion - 02.08.2016, 08:31
Re: Unknown command - by Shinja - 02.08.2016, 09:31
Re: Unknown command - by Juvanii - 02.08.2016, 09:57
Re: Unknown command - by GoldenLion - 02.08.2016, 11:09
Re: Unknown command - by Stinged - 02.08.2016, 11:15
Re: Unknown command - by Juvanii - 02.08.2016, 11:59
Re: Unknown command - by GoldenLion - 02.08.2016, 12:21

Forum Jump:


Users browsing this thread: 1 Guest(s)