28.01.2011, 00:16
Код:
new EngineStatus[MAX_PLAYERS], LightsStatus[MAX_PLAYERS], AlarmStatus[MAX_PLAYERS], DoorsStatus[MAX_PLAYERS], BonnetStatus[MAX_PLAYERS], BootStatus[MAX_PLAYERS], ObjectiveStatus[MAX_PLAYERS]; public OnGameModeInit() { ManualVehicleEngineAndLights(); AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); return 1; } CMD:car(playerid, params[]) { new engine,lights,alarm,doors,bonnet,boot,objective,veh; veh = GetPlayerVehicleID(playerid); if(strcmp(params, "Engine", true) == 0) { if(IsPlayerInAnyVehicle(playerid)) { if(veh != INVALID_VEHICLE_ID) { if(VehicleInfo[playerid][Engine] == 0) { GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(veh,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective); VehicleInfo[playerid][Engine] = 1; SendClientMessage(playerid, MSGCOMM_COLOR, "You've turned the vehicle's engine on!"); } else if(VehicleInfo[playerid][Engine] == 1) { GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective); VehicleInfo[playerid][Engine] = 0; SendClientMessage(playerid, MSGCOMM_COLOR, "You've turned the vehicle's engine off!"); } } } else { SendClientMessage(playerid, MSGFAIL_COLOR, "You are not in a vehicle!"); } }