27.05.2012, 19:23
My /lights command is bugged. When ever I type /lights, the lights remain the same, they don't turn on, but the gametext is showed correctly. Also, if my lights are set to "on" and I exit my car, the lights turn on. When I enter it again, the lights turn off. Can anyone help me out please?
This is my /lights command
This is my /lights command
pawn Код:
if(!strcmp(cmd, "/lights", true))
{
if(GetPlayerState(playerid) == 2)
{
new vid = GetPlayerVehicleID(playerid);
new engine = 0, light = 0, alarm = 0, doors = 0, bonnet = 0, boot = 0, objective = 0;
GetVehicleParamsEx(vid, engine, light, alarm, doors, bonnet, boot, objective);
if(!light)
{
GameTextForPlayer(playerid, "~w~Lights ~g~On", 2000, 4);
SetVehicleParamsEx(vid, engine, 1, alarm, doors, bonnet, boot, objective);
}
else
{
GameTextForPlayer(playerid, "~w~Lights ~r~Off", 2000, 4);
SetVehicleParamsEx(vid, engine, 0, alarm, doors, bonnet, boot, objective);
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "[ERROR:] You are not in a vehicle as a driver.");
}
return 1;
}