03.04.2016, 13:44
Код:
CMD:engine(playerid,params[]) { new string[124]; new id = GetVehicleID(GetPlayerVehicleID(playerid)); new vehicleid = GetPlayerVehicleID(playerid); if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_LIGHTRED, "You are not in any vehicle."); if(GetPlayerVehicleAccess(playerid, id) < 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "You don't have the keys for this vehicle!"); GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); if(GetPlayerState(playerid) == 2) { if(engine != 1) { format(string, sizeof(string), "* %s twists the keys in the ignition.", GetName(playerid)); SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 5.0, 10000); SendClientMessage(playerid, COLOR_PURPLE, string); SetTimerEx("EngineOn", 2000, false, "i", playerid); GameTextForPlayer(playerid, "~g~STARTING...", 2000, 1); } else if(engine != 0) { SetVehicleParamsEx(vehicleid, 0, 0, alarm, doors, bonnet, boot, 0); format(string, sizeof(string), "* %s turns the engine off.", GetName(playerid)); ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } return 1; }