26.10.2012, 14:50
(
Последний раз редактировалось Swyft™; 26.10.2012 в 15:24.
)
Well I am experiencing some issues with my /lights command, here it is
This command works for any other type of part... I have /hood, /trunk, /engine and etc and it works fine but not lights. Any ideas?
pawn Код:
CMD:lights(playerid, params[]) {
new vehicleid = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
if(GetPlayerState(playerid) == 2)
{
if(playerVariables[playerid][pCarLights] == 1) return SendClientMessage(playerid, COLOR_RED,"ERROR: The vehicle's hood is already opened!");
if(IsPlayerInAnyVehicle(playerid)) {
switch(playerVariables[playerid][pCarLights]) {
case 0: {
playerVariables[playerid][pCarLights] = 1;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,engine,true,alarm,doors,bonnet,boot,objective);
format(szMessage, sizeof(szMessage), "* %s has pushed a button on his steering wheel, turning on their headlights.", szPlayerName);
nearByMessage(playerid, COLOR_PURPLE, szMessage);
}
default: {
playerVariables[playerid][pCarLights] = 0;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);//this will check that what is the state of engine.That is is on or off.We can use it for multiple things like doors,alarms etc.But In this case I am using this for the engine only.
SetVehicleParamsEx(vehicleid,engine,false,alarm,doors,bonnet,boot,objective);
format(szMessage, sizeof(szMessage), "* %s has pushed a button on his steering wheel, turning off their headlights.", szPlayerName);
nearByMessage(playerid, COLOR_PURPLE, szMessage);
}
}
}
}
return 1;
}