/engine
#4

pawn Код:
if(strcmp(cmd, "/engine", true) == 0)
    {
        new stringddd[50];
        new pNames[MAX_PLAYER_NAME]; //Maximum Player Name Length is 24, use MAX_PLAYER_NAME
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new vehicleid = GetPlayerVehicleID(playerid); //No point in getting the vehicle id if they aren't in a car.
            new engine,lights,alarm,doors,bonnet,boot,objective;
            GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
            if(engine == 1) return SendClientMessage(playerid,COLOR_WHITE,"You're engine is already started.");
            if(gGas[vehicleid] > 0)
            {
                SetVehicleParamsEx(vehicleid,1,lights,alarm,doors,bonnet,boot,objective);
                GetPlayerName(playerid, pNames, MAX_PLAYER_NAME); //Here's the line you missed.
                format(stringddd, 128, "* %s has started their engine.", pNames);
                ProxDetector(30.0, playerid, stringddd, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else return SendClientMessage(playerid, COLOR_WHITE, "This Car Doesn't Have Any Fuel Left.");
        }
        else return SendClientMessage(playerid, COLOR_WHITE, "You need to be the driver of a car!");
        return 1;
    }
Reply


Messages In This Thread
/engine - by Visio - 29.08.2012, 09:23
Re: /engine - by Cjgogo - 29.08.2012, 09:29
Re: /engine - by Visio - 29.08.2012, 09:35
Re: /engine - by clarencecuzz - 29.08.2012, 09:36
Re: /engine - by Visio - 29.08.2012, 09:48
Re: /engine - by clarencecuzz - 29.08.2012, 09:54
Re: /engine - by Visio - 29.08.2012, 09:56
Re: /engine - by romas3110 - 29.08.2012, 10:02
Re: /engine - by Visio - 29.08.2012, 10:03

Forum Jump:


Users browsing this thread: 1 Guest(s)