07.09.2013, 06:31
Quote:
For the totalled car system, you canf irst get the vehicle's health using GetVehicleHealth and then after that use SetVehicleParamsEx to switch off it's engine
For the addplayerclass thing, I guess you can make an array with all the id's and then process it 1 by 1 in the addplayerclass function |
Can you give one example?
Here's the engine cmd
Quote:
Код:
dcmd_engine(playerid, params[]) { #pragma unused params new vehicleid, engine, lights, alarm, doors, bonnet, boot, objective, playername[MAX_PLAYER_NAME+1]; GetPlayerName(playerid, playername, sizeof(playername)); vehicleid = GetPlayerVehicleID(playerid); GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective); if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "[ERROR] You must be in a vehicle in order to use this command."); if(GetPlayerVehicleSeat(playerid) != 0) return SendClientMessage(playerid, COLOR_RED, "[ERROR] You must be in the driver seat in order to use this command."); if(engine == 1) { SetVehicleParamsEx(vehicleid,0,lights,alarm,doors,bonnet,boot,objective); SendClientMessage(playerid, COLOR_YELLOW, "[VEHICLE] Engine shut off."); } else { SetVehicleParamsEx(vehicleid,1,lights,alarm,doors,bonnet,boot,objective); SendClientMessage(playerid, COLOR_YELLOW, "[VEHICLE] Engine started."); } return 1; } |