23.01.2012, 19:23
Here:
pawn Код:
CMD:eon(playerid, params[])
{
if(LoggedIn[playerid] == 0)return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
new string[128];
new vehicleid = GetPlayerVehicleID(playerid);
new name = GetVehicleModel(vehicleid) - 400;
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)return SendClientMessage(playerid, COLOUR_GREY, "You are not the driver.");
if(EngineStartStatus[vehicleid] == 1)return SendClientMessage(playerid, COLOUR_GREY, "The engine is already on.");
if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid, COLOUR_GREY, "You are not in a vehicle.");
SetTimer("SpeedoUpdate",300,1);
SetTimer("FuelUpdate",20000,1);
SetTimer("FuelSave", 4000, 1);
if(VehFuel[vehicleid] > 0)
{
EngineStartStatus[vehicleid] = 1;
GameTextForPlayer(playerid, "~g~Engine starting...", 2500, 5);
SetTimerEx("EngineOn", 3000, false, "i", playerid);
format(string, sizeof(string), "* %s turns the %s's ignition key...", GetNameEx(playerid), VehicleNames[name]);
ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
}
else if(VehFuel[vehicleid] == 0)
{
EngineStartStatus[vehicleid] = 0;
SendClientMessage(playerid, COLOUR_REALRED, "Your vehicle is out of fuel..");
format(string, sizeof(string), "* The %s has run out of fuel and failed to start.", VehicleNames[name]);
ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
}
return 1;
}