13.09.2015, 08:00
This
Quote:
|
CMD:engine(playerid, params[]) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) //This here is checking if the player is inside a vehicle as a driver. { new engine, lights, alarm, doors, bonnet, boot, objective; new vehicle = GetPlayerVehicleID(playerid); //This part here is defining the vehicle ID that the player is currently in. new pname[24], string[100], vehicleid, enginestatus[4]; pname = GetName(playerid); GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective); if(VEngine[vehicle] != 1) //This is checking if the engine of the vehicle, is turned off or not. { VEngine[vehicle] = 0; SetVehicleParamsEx(vehicle, 0, lights, alarm, doors, bonnet, boot, 0); } else { VEngine[vehicle] = 1; SetVehicleParamsEx(vehicle, 1, lights, alarm, doors, bonnet, boot, 0); } for(new i = 0; i < MAX_PLAYERS; i++) { if(PlayerToPlayer(playerid,i,7)) { if(VEngine[vehicle] == 0) { enginestatus = "Off"; } else if(VEngine[vehicle] == 1) { enginestatus = "On"; } new model = GetVehicleModel(vehicleid); strreplace(pname, '_', ' '); format(string, sizeof(string), "* %s has turned the engine of his %s %s *", pname, VehicleNames[model - 400], enginestatus); SendClientMessage(i, COLOR_PURPLE, string); } } } else return SendClientMessage(playerid, COLOR_WHITE, "You are not driving a vehicle!"); return 1; } |

