DrawSpotLight
DocsDrawSpotLight(posX, posY, posZ, dirX, dirY, dirZ, colorR, colorG, colorB, distance, brightness, hardness, radius, falloff)Description
Parameters:
* pos - coordinate where the spotlight is located
* dir - the direction vector the spotlight should aim at from its current position
* r,g,b - color of the spotlight
* distance - the maximum distance the light can reach
* brightness - the brightness of the light
* roundness - "smoothness" of the circle edge
* radius - the radius size of the spotlight
* falloff - the falloff size of the light's edge (example: www.i.imgur.com/DemAWeO.jpg)
Example in C# (spotlight aims at the closest vehicle):
Vector3 myPos = Game.Player.Character.Position;
Vehicle nearest = World.GetClosestVehicle(myPos , 1000f);
Vector3 destinationCoords = nearest.Position;
Vector3 dirVector = destinationCoords - myPos;
dirVector.Normalize();
Function.Call(Hash.DRAW_SPOT_LIGHT, pos.X, pos.Y, pos.Z, dirVector.X, dirVector.Y, dirVector.Z, 255, 255, 255, 100.0f, 1f, 0.0f, 13.0f, 1f);Parameters
| Name | Type | Description |
|---|---|---|
posX | float | — |
posY | float | — |
posZ | float | — |
dirX | float | — |
dirY | float | — |
dirZ | float | — |
colorR | int | — |
colorG | int | — |
colorB | int | — |
distance | float | — |
brightness | float | — |
hardness | float | — |
radius | float | — |
falloff | float | — |
Quick Snippet: Get CoordinatesposXposYposZdirX
posXposYposZdirXAdd this command to your client script to retrieve precise locations in-game.
-- Add this to your client.lua. Type /pos in-game to copy coords.
RegisterCommand('pos', function()
local ped = PlayerPedId()
local coords = GetEntityCoords(ped)
local heading = GetEntityHeading(ped)
local output = string.format("vector4(%.2f, %.2f, %.2f, %.2f)", coords.x, coords.y, coords.z, heading)
print(output)
TriggerEvent('chat:addMessage', { args = { '^4[COORD]^0', output } })
end)Returns
voidThis native does not return a value.