Instalar con sampctl
sampctl package install RogueDrifter/Tech_Lights
Ejecútalo en la carpeta de tu proyecto. sampctl descarga el paquete y sus dependencias.
Depende de 1 paquete
- sampctl/samp-stdlibno está en este directorio
README.md
Tech_Lights
This is an include that allows you to manipulate lights better, simply put this creates lights that only light up when someone
is near them within a range you can control.
UPDATED: June 16th - 2019
Installation:
You simply include it in the script you want to use the lights in and use the functions as simple as that.
Testing:
All can be done through the test.pwn folder which already
contains the include and a simple test use of the functions.
Version: 3.0
Installation
sampctl package install RogueDrifter/Tech_Lights
#include <Tech_Lights>
Usage
#define MAX_RTLIGHTS (NUMBER)
//Use this for types:
#define LIGHT_TYPE_WHITE 0
#define LIGHT_TYPE_RED 1
#define LIGHT_TYPE_BLUE 2
So yeah make sure your LightID is never below 0 or above the MAX_RTLIGHTS The second one (LightType) there are currently 3 types and the 4th one will be released soon, the current three ones (ranging from 0 to 2 as in 0,1,2) are white lights, red lights and blue lights in this respective order.
LightType:
0- Normal white lights
1- Colored lights red
2- Colored lights blue
Almost all of the functions are self explanatory so the last thing here is:
#define RTL_MAX_PLAYER_RANGE (RANGE)
Which as it says defines the range the player needs to be within the position of the light in order to 'trigger' as in lighten it up. Quick example (included in test.pwn):
// generated by "sampctl package generate"
#include "Tech_Lights.inc"
main() {
CreateLights (0, 0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0);
}
Testing
sampctl package run
Contains:
Functions:
CreateLights (LightType, LightID, Float:PosX, Float:PosY, Float:PosZ, Float:PosRX, Float:PosRY, Float:PosRZ, Float:DrawDistance = RTL_MAX_PLAYER_RANGE);
DestroyLights (LightID, LightType);
DestroyAllLights (LightType);
HideLights (LightID, LightType);
ShowLights (LightID, LightType);
BlinkLights (LightID, LightType, Toggle);
KeepLightsOn (LightID, LightType, Toggle);
KeepAllLightsOn (LightType, Toggle);
IsLightKeptOn (LightID, LightType);
IsLightValid (LightID, LightType);
IsLightBlinking (LightID, LightType);
IsLightOn (LightID, LightType);
IsPlayerTriggeringLight (playerid, LightID, LightType);
ToggleLightForPlayer (playerid, LightID, LightType, Toggle);
PointLights(LightID, LightType, Direction);
ShowAllLights (LightType);
HideAllLights (LightType);
BlinkToDestroyLights (LightID, LightType);
GetLightObjectID(LightID, LightType);
DanceLights(LightID, LightType, bool:toggle);
MoveLights (LightID, LightType, Float:ToX, Float:ToY, Float:ToZ, Float:ToRX, Float:ToRY, Float:ToRZ);
Callbacks:
OnPlayerTriggerLight(playerid, LightID, LightType);
OnLightGoOff(LightID, LightType);
How to update:
sampctl package ensure
Example usage:
Lights_Event: https://github.com/RogueDrifter/Lights_Event
Non sampctl users:
Go get sampctl! But for now: 1- Download the repository from the github link. 2- Take the .inc file and put it in your pawno/include. 3- Open the script you want to use the lights in and use #include <Tech_Lights> 4- Use the functions provided above as you like.
Esta página se genera con lo que GitHub publica sobre el repositorio. samp.directory no aloja el código. Informar de un problema con esta ficha