27.06.2012, 05:44
Put this on your OnGameModeInit()
Here's a simple /lights command
pawn Код:
ManualVehicleEngineAndLights();
pawn Код:
if(strcmp(cmd, "/lights", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
new engine, light, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vid, engine, light, alarm, doors, bonnet, boot, objective);
if(light != VEHICLE_PARAMS_ON)
{
GameTextForPlayer(playerid, "~w~Lights ~g~On", 2000, 4);
SetVehicleParamsEx(vid, engine, VEHICLE_PARAMS_ON, alarm, doors, bonnet, boot, objective);
return 1;
}
GameTextForPlayer(playerid, "~w~Lights ~r~Off", 2000, 4);
SetVehicleParamsEx(vid, engine, VEHICLE_PARAMS_OFF, alarm, doors, bonnet, boot, objective);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "[ERROR:] You are not in a vehicle as a driver.");
}
return 1;
}