| Tematy otagowane jako: zmianą |
| 1. Tekstura zmienia kąt w raz ze zmianą położenia postaci. |
Mam tu taki fragment skryptu po stronie klienta, który ustawia teksturę w konkretnym miejscu. Tekstura jest ustawiona, jednak kiedy postać zmienia położenie to zmienia się też kierunek tej tekstury. Czy wie ktoś jak ustawić żeby tekstura była ustawiona cały czas pozioma i skierowana w górę?
[code]-- Ustawienie pozycji tarczy
local targetPosition = {1290.50659, -1119.45020, 53.00852}
local targetTexture = nil
local isDrawingTarget = false
local targetBlip = nil
-- Funkcja rysująca poziomą teksturę
local function drawHorizontalTexture(x, y, z, texture, size)
local x1, y1, z1 = x - size, y, z
local x2, y2, z2 = x + size, y, z
dxDrawMaterialLine3D(x1, y1, z1, x2, y2, z2, texture, size * 2, tocolor(255, 255, 255, 255))
end
-- Funkcja do sprawdzenia, czy gracz jest w strefie tarczy
local function isPlayerInTargetZone()
local x, y, z = getElementPosition(localPlayer)
local tx, ty, tz = targetPosition[1], targetPosition[2], targetPosition[3]
local distance = getDistanceBetweenPoints3D(x, y, z, tx, ty, tz)
return distance <= 3
end
-- Funkcja do obsługi lądowania gracza
local function handlePlayerLanding()
if isDrawingTarget then
if isPlayerInTargetZone() then
-- Gracz wylądował w strefie tarczy
isDrawingTarget = false
if targetTexture then
destroyElement(targetTexture)
targetTexture = nil
end
if targetBlip then
... |
| 2. Proszę o pomoc z zmianą leveli |
Gdy mam wymagan? ile?? exp levele si? nie zmieniaj?.
Kod:
[lua]local lvl =
{
50, -- 1
500, -- 2
1000, -- 3
2000, -- 4
3000, -- 5
4500, -- 6
6000, -- 7
8000, -- 8
9500, -- 9
11000, -- 10
13000, -- 11
15000, -- 12
17000, -- 13
18000, -- 14
20000, -- 15
22500, -- 16
25000, -- 17
27500, -- 18
30000, -- 19
35000, -- 20
50000, -- 21
60000, -- 22
70000, -- 23
80000, -- 24
100000 -- 25
}
addEvent ( "onZombieWasted", true )
addEventHandler ( "onZombieWasted", root,
function ( killer )
addPlayerZombieKills ( killer )
end
)
function addPlayerZombieKills ( killer )
local account = getPlayerAccount ( killer )
if isGuestAccount ( account ) then
return
end
local H = tonumber ( getElementData ( killer, "Exp" ) ) or 0
local L = tonumber ( getElementData ( killer, "Level" ) ) or 0
setElementData ( killer, "Exp", tonumber ( H ) + 1 )
local H = ( H + 5 )
local L = ( L + 1 )
if ( L <= #lvl ) and ( lvl [ L ] ) and ( tonumber ( H ) >= tonumber ( lvl [ L ] ) ) then
setElementData ( killer, "Level", L )
triggerClientEvent(killer, "CreateBox", getRootElement(), "info", "Osi?gn??e? nast?pny level! Gratulacje!")
end
end
function addPlayerKills ( totalAmmo, killer, killerWeapon, bodypart )
if isElement(killer) and g... |
|