17.04.2012, 04:06
i need help me a problem it's been buzzing me for years..(months) i cant make it work!a lights sistem!no errors
no warnings just no work i go in game at 1:00am and i press button 2(not numpad)and no work
PS:in gamemode under ongamemodeinit i have ManualVehicleEngineAndLights();[/quote]
i post it at thread and no oe answer i got it 10 days..
no warnings just no work i go in game at 1:00am and i press button 2(not numpad)and no work
PHP код:
#include <a_samp>
new bool: VehicleLightsOn[MAX_VEHICLES];
new engine, lights, alarm, doors, bonnet, boot, objective;
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if (newstate == PLAYER_STATE_DRIVER)
{
if (VehicleLightsOn[GetPlayerVehicleID(playerid)] == true)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, engine, true, alarm, doors, bonnet, boot, objective);
VehicleLightsOn[GetPlayerVehicleID(playerid)] = true;
}
else
{
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, engine, false, alarm, doors, bonnet, boot, objective);
VehicleLightsOn[GetPlayerVehicleID(playerid)] = false;
}
}
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_SUBMISSION))
{
if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if (VehicleLightsOn[GetPlayerVehicleID(playerid)] == false)
{
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, engine, true, alarm, doors, bonnet, boot, objective);
VehicleLightsOn[GetPlayerVehicleID(playerid)] = true;
}
else
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, engine, false, alarm, doors, bonnet, boot, objective);
VehicleLightsOn[GetPlayerVehicleID(playerid)] = false;
}
}
}
return 1;
}
i post it at thread and no oe answer i got it 10 days..