Engine
#1

I made this engine function (in a command):

pawn Код:
switch (GetEngineStatus(vehicleid))
        {
            case false:
            {
                new rand = random(3);
                if(rand != 0)
                {
                    PlayNearbySound(playerid, 11200);
                    SetPVarInt(playerid,"CmdTime",GetTickCount()+5000);
                    SetEngineStatus(vehicleid, true);
                    SendNearbyMessage(playerid, 10.0, COLOR_FACTION, "* %s inserts the key into the ignition lock and starts the engine of %s %s.", ReturnName(playerid, 0), CheckSex(playerid), ReturnVehicleName(vehicleid));
                }
                else
                {
                    GameTextForPlayer(playerid, "~r~ENGINE COULDN'T STARTED~n~~w~Try it again!", 3000, 4);
                }
            }
            case true:
            {
                SetPVarInt(playerid,"CmdTime",GetTickCount()+5000);
                SetEngineStatus(vehicleid, false);
                SendNearbyMessage(playerid, 10.0, COLOR_FACTION, "* %s leaves the key from ignition lock and stops the engine of %s %s.", ReturnName(playerid, 0), CheckSex(playerid), ReturnVehicleName(vehicleid));
            }
            }
        }
But i'm getting this:

Quote:

error 040: duplicate "case" label (value 7)
error 040: duplicate "case" label (value 8 )

Reply


Messages In This Thread
Engine - by KinderClans - 06.10.2018, 23:40
Re: Engine - by Leaky - 06.10.2018, 23:48
Re: Engine - by KinderClans - 06.10.2018, 23:51
Re: Engine - by Undef1ned - 07.10.2018, 00:09
Re: Engine - by UFF - 07.10.2018, 04:58
Re: Engine - by Gammix - 07.10.2018, 05:35
Re: Engine - by SyS - 07.10.2018, 06:29
Re: Engine - by KinderClans - 07.10.2018, 08:45

Forum Jump:


Users browsing this thread: 2 Guest(s)