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
local cel = createMarker(-2400.62280, -580.35413, 132.76778, "checkpoint", 4, 0, 0, 255)
function cele(thePlayer)
if thePlayer == getLocalPlayer() then
outputChatBox("elo marker0")
outputDebugString("Komunikat: elo marker0")
end
end
addEventHandler("onClientMarkerHit", cel, cele)
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
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(1, 3)
if losuj == 1 then
local cel = createMarker(1762.54773, -2103.95117, 13.54688, "checkpoint", 4, 0, 0, 255)
local cel1 = createMarker(2379.85718, -1785.35425, 13.54688, "checkpoint", 4, 0, 0, 255)
local cel2 = createMarker(2485.92212, -1020.81976, 65.33580, "checkpoint", 4, 0, 0, 255)
local cel3 = createMarker(1496.94690, -690.84027, 94.75000, "checkpoint", 4, 0, 0, 255)
local cel4 = createMarker(374.57281, -77.65766, 1.38281, "checkpoint", 4, 0, 0, 255)
local blip = createBlipAttachedTo(cel, 41)
local blip1 = createBlipAttachedTo(cel1, 41)
local blip2 = createBlipAttachedTo(cel2, 41)
local blip3 = createBlipAttachedTo(cel3, 41)
local blip4 = createBlipAttachedTo(cel4, 41)
elseif
losuj == 2 then
local cel = createMarker(803.38690, -1793.66211, 13.09170, "checkpoint", 4, 0, 0, 255)
local cel1 = createMarker(1290.66272, -1870.19690, 13.54688, "checkpoint", 4, 0, 0, 255)
local cel2 = createMarker(682.21771, -475.64679, 16.33594, "checkpoint", 4, 0, 0, 255)
local cel3 = createMarker(2089.21484, 1450.86243, 10.82031, "checkpoint", 4, 0, 0, 255)
local cel4 = createMarker(-242.40549, -236.32520, 2.42969, "checkpoint", 4, 0, 0, 255)
local blip = createBlipAttachedTo(cel, 41)
local blip1 = createBlipAttachedTo(cel1, 41)
local blip2 = createBlipAttachedTo(cel2, 41)
local blip3 = createBlipAttachedTo(cel3, 41)
local blip4 = createBlipAttachedTo(cel4, 41)
elseif
losuj == 3 then
local cel = createMarker(255.29895, -1366.57813, 53.10938, "checkpoint", 4, 0, 0, 255)
local cel1 = createMarker(768.01074, -504.11118, 18.01293, "checkpoint", 4, 0, 0, 255)
local cel2 = createMarker(172.03481, -152.53413, 1.57525, "checkpoint", 4, 0, 0, 255)
local cel3 = createMarker(-508.30368, -541.35413, 25.52344, "checkpoint", 4, 0, 0, 255)
local cel4 = createMarker(-2031.92529, 156.84238, 29.04611, "checkpoint", 4, 0, 0, 255)
local blip = createBlipAttachedTo(cel, 41)
local blip1 = createBlipAttachedTo(cel1, 41)
local blip2 = createBlipAttachedTo(cel2, 41)
local blip3 = createBlipAttachedTo(cel3, 41)
local blip4 = createBlipAttachedTo(cel4, 41)
function cele(thePlayer)
if thePlayer == getLocalPlayer() then
outputChatBox("elo marker0")
outputDebugString("Komunikat: elo marker0")
end
end
addEventHandler("onClientMarkerHit", cel, cele)
function cele1(thePlayer)
if thePlayer == getLocalPlayer() then
outputChatBox("elo marker1")
outputDebugString("Komunikat: elo marker1")
end
end
addEventHandler("onClientMarkerHit", cel1, cele1)
function cele2(thePlayer)
if thePlayer == getLocalPlayer() then
outputChatBox("elo marker2")
outputDebugString("Komunikat: elo marker2")
end
end
addEventHandler("onClientMarkerHit", cel2, cele2)
function cele3(thePlayer)
if thePlayer == getLocalPlayer() then
outputChatBox("elo marker3")
outputDebugString("Komunikat: elo marker3")
end
end
addEventHandler("onClientMarkerHit", cel3, cele3)
function cele4(thePlayer)
if thePlayer == getLocalPlayer() then
outputChatBox("elo marker4")
outputDebugString("Komunikat: elo marker4")
end
end
addEventHandler("onClientMarkerHit", cel4, cele4)
end
end
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
Bad argument @ addEventHandler [Expected element at argument 2, got nil]
Oto ca?y skrypt:
local cel = createMarker(255.29895, -1366.57813, 53.10938, "checkpoint", 4, 0, 0, 255)
function cele(thePlayer)
if thePlayer == getLocalPlayer() then
outputChatBox("elo marker0")
end
end
addEventHandler("onClientMarkerHit", cel, cele)
[/code]
function cele(thePlayer,Tomasz)
if Tomasz ~= cel then return end
if thePlayer == getLocalPlayer() then
outputChatBox("elo marker0")
end
end
addEventHandler("onClientMarkerHit", getRootElement(), cele)
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