Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2018-02-13, 14:03


IgorPL222

LUA






Wiek: 26
Na forum: 3112 dni
Posty: 133
Nick w MP: mxgvr

Piwa: 746

Respekt: 55,3

Tak jak w temacie!
Zrobi?em marker, i normalnie si? stworzy?, lecz po wejsciu w marker mimo zastosowania funkcji OnClientMarkerHit nic si? nie dzieje.
Skrypt jest po Client Side
W DB3 Wyskakuje tylko b??d
Kod:


Bad argument @ addEventHandler [Expected element at argument 2, got nil]


Oto ca?y skrypt:

local cel createMarker(255.29895, -1366.5781353.10938"checkpoint"400255)



function cele(thePlayer)
          if thePlayer == getLocalPlayer() then 
            outputChatBox("elo marker0")
          end
        end
        addEventHandler("onClientMarkerHit"celcele)

[/code]

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-13, 14:34


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Sprawd? czy na pewno masz go po stronie clienta, gdy? u mnie wszystko dzia?a, rezultat:

https://i.imgur.com/Ff86rYI.jpg

A, oto kod kt?ry u?y?em:


local cel createMarker(-2400.62280, -580.35413132.76778"checkpoint"400255)

function cele(thePlayer)
          if thePlayer == getLocalPlayer() then 
            outputChatBox("elo marker0")
            outputDebugString("Komunikat: elo marker0")
          end
        end
        addEventHandler("onClientMarkerHit"celcele)


Czyli ten Tw?j. Tylko czy Ty tworzysz osobno marker po stronie clienta i osobno funckcje? Je?eli tak to zastosuj si? do tego co pokaza?em powy?ej

Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
IgorPL222
Wysłany: 2018-02-13, 15:00


IgorPL222

LUA






Wiek: 26
Na forum: 3112 dni
Posty: 133
Nick w MP: mxgvr

Piwa: 746

Respekt: 55,3

Ciastuu?, wydaj? mi si?, ?e to jedna funkcja, a mimo tego po wej?ciu w marker nic nie wyskakuje.

function losowanko()
local losuj math.random(13)
if losuj == 1 then    
local cel createMarker(1762.54773, -2103.9511713.54688"checkpoint"400255)
local cel1 createMarker(2379.85718, -1785.3542513.54688"checkpoint"400255)
local cel2 createMarker(2485.92212, -1020.8197665.33580"checkpoint"400255)
local cel3 createMarker(1496.94690, -690.8402794.75000"checkpoint"400255)
local cel4 createMarker(374.57281, -77.657661.38281"checkpoint"400255)
local blip createBlipAttachedTo(cel41)
local blip1 createBlipAttachedTo(cel141)
local blip2 createBlipAttachedTo(cel241)
local blip3 createBlipAttachedTo(cel341)
local blip4 createBlipAttachedTo(cel441)
elseif
losuj == 2 then
local cel createMarker(803.38690, -1793.6621113.09170"checkpoint"400255)
local cel1 createMarker(1290.66272, -1870.1969013.54688"checkpoint"400255)
local cel2 createMarker(682.21771, -475.6467916.33594"checkpoint"400255)
local cel3 createMarker(2089.214841450.8624310.82031"checkpoint"400255)
local cel4 createMarker(-242.40549, -236.325202.42969"checkpoint"400255)
local blip createBlipAttachedTo(cel41)
local blip1 createBlipAttachedTo(cel141)
local blip2 createBlipAttachedTo(cel241)
local blip3 createBlipAttachedTo(cel341)
local blip4 createBlipAttachedTo(cel441)
elseif
losuj == 3 then
local cel createMarker(255.29895, -1366.5781353.10938"checkpoint"400255)
local cel1 createMarker(768.01074, -504.1111818.01293"checkpoint"400255)
local cel2 createMarker(172.03481, -152.534131.57525"checkpoint"400255)
local cel3 createMarker(-508.30368, -541.3541325.52344"checkpoint"400255)
local cel4 createMarker(-2031.92529156.8423829.04611"checkpoint"400255)
local blip createBlipAttachedTo(cel41)
local blip1 createBlipAttachedTo(cel141)
local blip2 createBlipAttachedTo(cel241)
local blip3 createBlipAttachedTo(cel341)
local blip4 createBlipAttachedTo(cel441)

function cele(thePlayer)
          if thePlayer == getLocalPlayer() then 
            outputChatBox("elo marker0")
            outputDebugString("Komunikat: elo marker0")
          end
        end
        addEventHandler("onClientMarkerHit"celcele)

function cele1(thePlayer)
          if thePlayer == getLocalPlayer() then 
            outputChatBox("elo marker1")
            outputDebugString("Komunikat: elo marker1")
          end
        end
        addEventHandler("onClientMarkerHit"cel1cele1)

function cele2(thePlayer)
          if thePlayer == getLocalPlayer() then 
            outputChatBox("elo marker2")
            outputDebugString("Komunikat: elo marker2")
          end
        end
        addEventHandler("onClientMarkerHit"cel2cele2)

function cele3(thePlayer)
          if thePlayer == getLocalPlayer() then 
            outputChatBox("elo marker3")
            outputDebugString("Komunikat: elo marker3")
          end
        end
        addEventHandler("onClientMarkerHit"cel3cele3)

function cele4(thePlayer)
          if thePlayer == getLocalPlayer() then 
            outputChatBox("elo marker4")
            outputDebugString("Komunikat: elo marker4")
          end
        end
        addEventHandler("onClientMarkerHit"cel4cele4)
end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-13, 15:08


Hades.

Łiiiiiiiiii






Wiek: 22
Na forum: 4699 dni
Posty: 372
Nick w MP: Hades

Piwa: 3214

Respekt: 337,8
Respekt: 337,8Respekt: 337,8Respekt: 337,8


function cele(el)
          if el == localPlayer then return end
            outputChatBox("elo marker0")
          end
addEventHandler("onClientMarkerHit"celcele)


Podpis
Skrypty/Grafiki na zamówienie!
Kontakt: Discord R35#5507

Discord związany z pomocą: https://discord.gg/ttkQTsc
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
IgorPL222
Wysłany: 2018-02-13, 15:17


IgorPL222

LUA






Wiek: 26
Na forum: 3112 dni
Posty: 133
Nick w MP: mxgvr

Piwa: 746

Respekt: 55,3

Damian2511, Nie dzia?a :(

Podpis
discord: mxgvr
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-13, 15:32


boszboszek

HEY






Wiek: 14
Na forum: 3505 dni
Posty: 146
Nick w MP: boszboszek

Piwa: 2172

Respekt: 261
Respekt: 261Respekt: 261Respekt: 261

"IgorPL222" napisał/a:

Tak jak w temacie!
Zrobi?em marker, i normalnie si? stworzy?, lecz po wejsciu w marker mimo zastosowania funkcji OnClientMarkerHit nic si? nie dzieje.
Skrypt jest po Client Side
W DB3 Wyskakuje tylko b??d
Kod:


Bad argument @ addEventHandler [Expected element at argument 2, got nil]


Oto ca?y skrypt:

local cel createMarker(255.29895, -1366.5781353.10938"checkpoint"400255)



function cele(thePlayer)
          if thePlayer == getLocalPlayer() then 
            outputChatBox("elo marker0")
          end
        end
        addEventHandler("onClientMarkerHit"celcele)

[/code]



Kod:

function cele(thePlayer,Tomasz)
if Tomasz ~= cel then return end
if thePlayer == getLocalPlayer() then
outputChatBox("elo marker0")
end
end
addEventHandler("onClientMarkerHit", getRootElement(), cele)


Spr?buj tak

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
IgorPL222
Wysłany: 2018-02-13, 15:39


IgorPL222

LUA






Wiek: 26
Na forum: 3112 dni
Posty: 133
Nick w MP: mxgvr

Piwa: 746

Respekt: 55,3

boszboszek, nadal nic.

[ Dodano: 2018-02-13, 16:13 ]
Dzi?ki wszystkim za pomoc!
Uda?o mi si?.
Problemem by? math.random.
Za pomoc daj? ka?demu po piwie!

Podpis
discord: mxgvr
Postaw piwo autorowi tego posta
 

 
Tagi: onclientmarkerhit :: nie :: działa!
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » OnClientMarkerHit nie działa! Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku