GTA Közösség - A magyar GTA fórum
San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => Segítségkérés => A témát indította: norbee0170 - 2011. május 02. - 09:32:39
-
üdv
megint kérdezek xD
olyan FS kéne nekem ami nappal is bekapcsol a lámpa (jámûvön)
innen vlahonnan leszedtem egy fs-t ami ctrl-gombra bekapcsol sajna már nem tudom h honnan szedtem le
de itt az fs és ha vlaki megírná h mit kell még hozzátenni megköszönném :)
[pawn]/*
Vehicle Headlight\'s Filterscript
Toggle you vehicles lights on/off :)
Created by: Anwix (http://forum.sa-mp.com/index.php?action=profile;u=12730)
Thanks to:
~ JernejL (RedShirt) - Encode Lights Script
*/
#include <a_samp>
new bool: VehicleLightsOn[MAX_VEHICLES];
new panels, doors, lights, tires;
#define PRESSED(%0) \\
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" Vehicle Lights Filterscript Loaded\");
print(\"--------------------------------------\\n\");
for (new x = 1; x < MAX_VEHICLES; x++)
{
VehicleLightsOn
}
return 1;
}
public OnFilterScriptExit()
{
print(\"\\n--------------------------------------\");
print(\" Vehicle Lights Filterscript Unloaded\");
print(\"--------------------------------------\\n\");
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if (newstate == PLAYER_STATE_DRIVER)
{
if (VehicleLightsOn[GetPlayerVehicleID(playerid)] == false)
{
GetVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, lights, tires);
UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, encode_lights(1, 1, 1, 1), tires);
VehicleLightsOn[GetPlayerVehicleID(playerid)] = false;
}
else
{
GetVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, lights, tires);
UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, encode_lights(0, 0, 0, 0), tires);
VehicleLightsOn[GetPlayerVehicleID(playerid)] = true;
}
}
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_ACTION))
{
if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if (VehicleLightsOn[GetPlayerVehicleID(playerid)] == false)
{
GetVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, lights, tires);
UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, encode_lights(0, 0, 0, 0), tires);
VehicleLightsOn[GetPlayerVehicleID(playerid)] = true;
}
else
{
GetVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, lights, tires);
UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, encode_lights(1, 1, 1, 1), tires);
VehicleLightsOn[GetPlayerVehicleID(playerid)] = false;
}
}
}
return 1;
}
/* Thanks to JernejL (RedShirt) for encode_lights */
stock encode_lights(light1, light2, light3, light4)
{
return light1 | (light2 << 1) | (light3 << 2) | (light4 << 3);
}[/pawn]
-
Hozzátenni semmit sem kell, el kell venni a nagy részét.
Így amint beszáll valaki az autóba, világítani kezd a lámpája, és nem kapcsol le soha(ha kiszállt sem, mint SP-ben)
[pawn]
#include <a_samp>
new bool: VehicleLightsOn[MAX_VEHICLES];
new panels, doors, lights, tires;
#define PRESSED(%0) \\
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnFilterScriptInit()
{
print(\"\\nKocsi lámpa világítás script betöltve.\\n\");
for (new x = 1; x < MAX_VEHICLES; x++)
{
VehicleLightsOn
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if (newstate == PLAYER_STATE_DRIVER)
{
GetVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, lights, tires);
UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, encode_lights(1, 1, 1, 1), tires);
VehicleLightsOn[GetPlayerVehicleID(playerid)] = true;
}
}
stock encode_lights(light1, light2, light3, light4)
{
return light1 | (light2 << 1) | (light3 << 2) | (light4 << 3);
}[/pawn]
-
öm vlami nmejó mer nemhogy világosban nem kapcsól be hanem sötétben sem :)