[Question] Unknown Command
#3

Quote:
Originally Posted by Swizzzy
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/engine", true) == 0)//start
    {
        if(IsPlayerConnected(playerid))
        {
                new VID;
                VID = GetPlayerVehicleID(playerid);
                //new idcar = GetPlayerVehicleID(playerid);
                if(CarRunning[VID] == 0)
                {
                    if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
                    {
                        return 1;
                    }
                    if(IsASalesVehicle(VID))
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "[INFO]  - You can not take a vehicle from one of the Dealership's");
                        return 1;
                    }
                    if(IsAHarvester(VID))
                    {
                        if(PlayerInfo[playerid][pJob] == 21)
                        {
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            format(string, sizeof(string), "   %s has attempted to Start the vehicle", sendername);
                            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            printf("%s", string);
                            EnterCarTime[playerid] += 1;
                        }
                        return 1;
                    }
                    if(IsAnOwnableCar(VID))
                    {
                        if(PlayerInfo[playerid][pPcarkey] == VID) { }
                        else if(PlayerInfo[playerid][pPcarkey2] == VID) { }
                        else if(PlayerInfo[playerid][pPcarkey3] == VID) { }
                        else if(PlayerInfo[playerid][pPcarkey4] == VID) { }
                        else if(PlayerInfo[playerid][pPcarkey5] == VID) { }
                        else
                        {
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            format(string, sizeof(string), "* %s rips off the ignition cover.", sendername);
                            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            EnterCarTimeH[playerid] += 1;
                            return 1;
                        }
                    }
                    if(IsATaxi(VID))
                    {
                        if(PlayerInfo[playerid][pJob] == 14)
                        {
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            format(string, sizeof(string), "   %s has attempted to Start the vehicle", sendername);
                            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            printf("%s", string);
                            EnterCarTime[playerid] += 1;
                        }
                        return 1;
                    }
                    if(VID >= 1 && VID <= 20)
                    {
                        if(HireCar[playerid] != VID)
                        {
                            return 1;
                        }
                    }
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "   %s has attempted to Start the vehicle", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    printf("%s", string);
                    EnterCarTime[playerid] += 1;
                    return 1;
                }
                else if(CarRunning[VID] == 1)
                {
                    if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
                    {
                        return 1;
                    }
                    if(IsAnOwnableCar(VID))
                    {
                        if(PlayerInfo[playerid][pPcarkey] == VID) { }
                        else if(PlayerInfo[playerid][pPcarkey2] == VID) { }
                        else if(PlayerInfo[playerid][pPcarkey3] == VID) { }
                        else if(PlayerInfo[playerid][pPcarkey4] == VID) { }
                        else if(PlayerInfo[playerid][pPcarkey5] == VID) { }
                        else { return 1; }
                    }
                    if(IsATaxi(VID))
                    {
                        if(PlayerInfo[playerid][pJob] == 14)
                        {
                            GetPlayerName(playerid,sendername,sizeof(sendername));
                            format(string, sizeof(string), "** %s Turns Their Car off.",sendername);
                            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            new engine,lights,alarm,doors,bonnet,boot,objective;
                            GetVehicleParamsEx(VID,engine,lights,alarm,doors,bonnet,boot,objective);
                            SetVehicleParamsEx(VID,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
                            CarRunning[VID] = 0;
                        }
                        return 1;
                    }
                    if(VID >= 1 && VID <= 20)
                    {
                        if(HireCar[playerid] != VID)
                        {
                            return 1;
                        }
                    }
                    GetPlayerName(playerid,sendername,sizeof(sendername));
                    format(string, sizeof(string), "** %s Turns Their Car off.",sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    new engine,lights,alarm,doors,bonnet,boot,objective;
                    GetVehicleParamsEx(VID,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(VID,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
                    CarRunning[VID] = 0;
                }
                else
                {
                SendClientMessage(playerid, COLOR_GREY, " You are not in a car !");
                return 1;
            }
        }
        return 1;
    }
You need to return the original command output as true.
Oh Thanks mate, never noticed it cause it's an old code since I started coding on sa-mp :P
Reply


Messages In This Thread
[Question] Unknown Command - by tony_fitto - 24.09.2011, 00:36
Re: [Question] Unknown Command - by Swizzzy - 04.10.2011, 00:49
Re: [Question] Unknown Command - by tony_fitto - 04.10.2011, 20:49

Forum Jump:


Users browsing this thread: 1 Guest(s)