#include <a_samp>#include <zcmd>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
#include <a_samp>#include <zcmd>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 = false; } 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);}
CMD:lampa(playerid, params[]){if(!IsPlayerInAnyVehicle(playerid)) { return 1; }new vehicleid = GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective;GetVehicleParamsEx(vehicleid, engine,lights,alarm,doors,bonnet,boot,objective);lights = !lights;SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);SendClientMessage(playerid,0xFF6600FF,((lights)?(\"Lámpa felkapcsolva !\")\"Lámpa lekapcsolva !\"))); return 1;}
OnGameModeInit alá szükséges ez:http://wiki.sa-mp.com/wiki/ManualVehicleEngineAndLightsha berakod akkor nem csak a lámpát hanem a motort is külön kezeled ! CMD:lampa(playerid, params[]){if(!IsPlayerInAnyVehicle(playerid)) { return 1; }new vehicleid = GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective;GetVehicleParamsEx(vehicleid, engine,lights,alarm,doors,bonnet,boot,objective);lights = !lights;SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);SendClientMessage(playerid,0xFF6600FF,((lights)?(\"Lámpa felkapcsolva !\")\"Lámpa lekapcsolva !\"))); return 1;} ha kell segítség a motor kezelésben írj...és teszteld le a parancsot hogy megfelelõen mûködik e számodra !
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger){if(!ispassenger){ new engine,lights,alarm,doors,bonnet,boot,objective;GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);SetVehicleParamsEx(vehicleid,1,lights,alarm,doors,bonnet,boot,objective);}return 1;}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger){if(ispassenger){ new engine,lights,alarm,doors,bonnet,boot,objective;GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);SetVehicleParamsEx(vehicleid,1,lights,alarm,doors,bonnet,boot,objective);}return 1;}