Odważny
Początki LUA :P
Wiek: 25 Na forum: 3739 dni Posty: 140
Nick w MP: ReseT_
Piwa : 166
witam.
mam db3 z logowaniem w wyborem spawnu, wszystko git lecz wyskakuje taki db:
Kod:
[2016-04-26 18:39] ERROR: Client (tester) triggered serverside event core:spawnPlayer, but event is not added serverside
kod:
local sx , sy = guiGetScreenSize ()
local data ={ showed = nil , button ={}, info = nil , misc = nil , }
function isMouseIn ( psx , psy , pssx , pssy , abx , aby )
if not isCursorShowing () then return end
cx , cy = getCursorPosition ()
cx , cy = cx * sx , cy * sy
if cx >= psx and cx <= psx + pssx and cy >= psy and cy <= psy + pssy then
return true , cx , cy
else
return false
end
end
function renderZoneBox ()
dxDrawRectangle ( sx * 0 / 1024 , sy * 201 / 768 , sx * 1024 / 1024 , sy * 308 / 768 , tocolor ( 0 , 0 , 0 , 188 ), false )
if data . info then dxDrawText ( data . info , sx * 252 / 1024 , sy * 232 / 768 , sx * 800 / 1024 , sy * 255 / 768 , tocolor ( 237 , 0 , 0 , 255 ), 1.00 , "default" , "center" , "center" , false ) end
-- dxDrawLine ( sx * 0 / 1024 , sy * 199 / 768 , sx * 1022 / 1024 , sy * 200 / 768 , tocolor ( 31 , 111 , 193 , 255 ), 5 , false )
-- dxDrawLine ( sx * 0 / 1024 , sy * 509 / 768 , sx * 1022 / 1024 , sy * 510 / 768 , tocolor ( 31 , 111 , 193 , 255 ), 5 , false )
dxDrawText ( "FORUM: W BUDOWIE" , sx * 0 / 1024 , sy * 157 / 768 , sx * 1024 / 1024 , sy * 237 / 768 , white , 2.00 , "pricedown" , "center" , "center" , false )
if not isMouseIn ( sx * 98 / 1024 , sy * 294 / 768 , sx * 225 / 1024 , sy * 92 / 768 ) then dxDrawRectangle ( sx * 98 / 1024 , sy * 294 / 768 , sx * 225 / 1024 , sy * 92 / 768 , tocolor ( 192 , 192 , 192 , 193 ), false )
else dxDrawRectangle ( sx * 98 / 1024 , sy * 294 / 768 , sx * 225 / 1024 , sy * 92 / 768 , tocolor ( 150 , 0 , 0 , 193 ), false ) end
if not isMouseIn ( sx * 415 / 1024 , sy * 294 / 768 , sx * 225 / 1024 , sy * 92 / 768 ) then dxDrawRectangle ( sx * 415 / 1024 , sy * 294 / 768 , sx * 225 / 1024 , sy * 92 / 768 , tocolor ( 192 , 192 , 192 , 193 ), false )
else dxDrawRectangle ( sx * 415 / 1024 , sy * 294 / 768 , sx * 225 / 1024 , sy * 92 / 768 , tocolor ( 150 , 0 , 0 , 193 ), false ) end
if not isMouseIn ( sx * 710 / 1024 , sy * 294 / 768 , sx * 225 / 1024 , sy * 92 / 768 ) then dxDrawRectangle ( sx * 710 / 1024 , sy * 294 / 768 , sx * 225 / 1024 , sy * 92 / 768 , tocolor ( 192 , 192 , 192 , 193 ), false )
else dxDrawRectangle ( sx * 710 / 1024 , sy * 294 / 768 , sx * 225 / 1024 , sy * 92 / 768 , tocolor ( 150 , 0 , 0 , 193 ), false ) end
dxDrawText ( "Palomino Creek" , sx * 98 / 1024 , sy * 293 / 768 , sx * 323 / 1024 , sy * 386 / 768 , white , 1.00 , "default" , "center" , "center" , false )
dxDrawText ( "Przechowywalnia" , sx * 416 / 1024 , sy * 293 / 768 , sx * 641 / 1024 , sy * 386 / 768 , white , 1.00 , "default" , "center" , "center" , false )
dxDrawText ( "Montgomery" , sx * 712 / 1024 , sy * 293 / 768 , sx * 937 / 1024 , sy * 386 / 768 , white , 1.00 , "default" , "center" , "center" , false )
end
addEventHandler ( "onClientClick" , root , function( btn , state )
if btn == "left" and state == "down" then
if isMouseIn ( sx * 98 / 1024 , sy * 294 / 768 , sx * 225 / 1024 , sy * 92 / 768 ) and data . showed then
setElementData ( localPlayer , "player:spawn" ,{ 2405.72 ,- 89.38 , 27.32 })
closeZones ()
end
if isMouseIn ( sx * 415 / 1024 , sy * 294 / 768 , sx * 225 / 1024 , sy * 92 / 768 ) and data . showed then
setElementData ( localPlayer , "player:spawn" ,{ 2228.37 ,- 116.88 , 26.49 })
closeZones ()
end
if isMouseIn ( sx * 710 / 1024 , sy * 294 / 768 , sx * 225 / 1024 , sy * 92 / 768 ) and data . showed then
setElementData ( localPlayer , "player:spawn" ,{ 1202.56 , 157.92 , 20.45 })
closeZones ()
end
end
end )
function closeZones ()
showChat ( true )
showCursor ( false )
fadeCamera ( false )
setElementAlpha ( localPlayer , 255 )
stopSound ( data . misc )
showPlayerHudComponent ( "all" , true )
showPlayerHudComponent ( "radar" , true )
showPlayerHudComponent ( "crosshair" , true )
data . showed = false
-- Usuwamy elementy
triggerServerEvent ( "core:spawnPlayer" , localPlayer )
removeEventHandler ( "onClientRender" , root , renderZoneBox )
end
function showZones ( misc )
data . misc = misc
data . showed = true
showPlayerHudComponent ( "all" , false )
guiSetInputMode ( "no_binds_when_editing" )
addEventHandler ( "onClientRender" , root , renderZoneBox )
end
Podpis
[you]
, pomogłem Ci? Wynagrodź mnie