Wysłany: 2016-08-10, 11:38
NeroNix
Wiek: 27 Na forum: 3614 dni Posty: 69
Piwa : 1
Witam u?ywam panelu logowania, kt?ry jest tutaj na forum i mam jeden problem. Nie chce on teleportowa?..
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 ()
dxDrawImage ( 0 / 1440 * sx , 0 / 900 * sy , 1440 / 1440 * sx , 900 / 900 * sy , "tlo.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), 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
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 ( 35 , 35 , 35 , 193 ), false )
else dxDrawRectangle ( sx * 98 / 1024 , sy * 294 / 768 , sx * 225 / 1024 , sy * 92 / 768 , tocolor ( 0 , 155 , 200 , 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 ( 35 , 35 , 35 , 193 ), false )
else dxDrawRectangle ( sx * 415 / 1024 , sy * 294 / 768 , sx * 225 / 1024 , sy * 92 / 768 , tocolor ( 0 , 155 , 200 , 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 ( 35 , 35 , 35 , 193 ), false )
else dxDrawRectangle ( sx * 710 / 1024 , sy * 294 / 768 , sx * 225 / 1024 , sy * 92 / 768 , tocolor ( 0 , 155 , 200 , 193 ), false ) end
dxDrawText ( "San Fierro" , sx * 98 / 1024 , sy * 293 / 768 , sx * 323 / 1024 , sy * 386 / 768 , white , 1.00 , "default-bold" , "center" , "center" , false )
dxDrawText ( "Przechowywalnia" , sx * 416 / 1024 , sy * 293 / 768 , sx * 641 / 1024 , sy * 386 / 768 , white , 1.00 , "default-bold" , "center" , "center" , false )
dxDrawText ( "Urz?d" , sx * 712 / 1024 , sy * 293 / 768 , sx * 937 / 1024 , sy * 386 / 768 , white , 1.00 , "default-bold" , "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 , "spawnPlayer" ,{- 1936.03 , 883.51 , 38.51 })
closeZones ()
end
if isMouseIn ( sx * 415 / 1024 , sy * 294 / 768 , sx * 225 / 1024 , sy * 92 / 768 ) and data . showed then
setElementData ( localPlayer , "player:spawn" ,{- 2058.26 , 466.36 , 35.17 })
closeZones ()
end
if isMouseIn ( sx * 710 / 1024 , sy * 294 / 768 , sx * 225 / 1024 , sy * 92 / 768 ) and data . showed then
setElementData ( localPlayer , "player:spawn" ,{- 1903.52 , 486.86 , 35.17 })
closeZones ()
end
end
end )
function closeZones ()
showChat ( true );
showCursor ( false );
fadeCamera ( false );
setCameraTarget ( localPlayer )
stopSound ( data . misc )
showPlayerHudComponent ( "all" , true )
showPlayerHudComponent ( "money" , false )
data . showed = false
setTimer ( triggerServerEvent , 2000 , 1 , "core:spawningPlayer" , 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
Za pomoc i DB3 nic nie pokazuje
Wysłany: 2016-08-10, 11:54
Brzysiek
Skrypter pralek
Wiek: 27 Na forum: 5198 dni Posty: 488
Nick w MP: Brzysiek
Piwa : 1034
Wysłany: 2016-08-10, 12:14
NeroNix
Wiek: 27 Na forum: 3614 dni Posty: 69
Piwa : 1
Brzysiek ,
C_logging
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
local dist = 10
local angler = 0
function getPointFromDistanceRotation ( x , y , dist , angler )
local a = math . rad ( 20 - angler )
local dx = math . cos ( a ) * dist ;
local dy = math . sin ( a ) * dist ;
return x + dx , y + dy ;
end
function renderLoginBox ()
dxDrawImage ( 0 , 0 , 1366 , 775 , "tlo.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
if data . info then dxDrawText ( data . info , sx * 252 / 1024 , sy * 222 / 768 , sx * 800 / 1024 , sy * 255 / 768 , tocolor ( 237 , 0 , 155 , 255 ), 1.00 , "default" , "center" , "center" , false ) end
dxDrawText ( "Login U?ytkownika:" , 522 , 348 , 788 , 394 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , "default-bold" , "left" , "top" , false , false , false , false , false )
dxDrawText ( "Has?o U?ytkownika:" , 522 , 440 , 788 , 476 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , "default-bold" , "left" , "top" , false , false , false , false , false )
if not isMouseIn ( 778 , 375 , 165 , 42 ) then dxDrawRectangle ( 778 , 375 , 165 , 42 , tocolor ( 35 , 35 , 35 , 193 ), false )
else dxDrawRectangle ( 778 , 375 , 165 , 42 , tocolor ( 0 , 51 , 169 , 150 ), false ) end
if not isMouseIn ( 778 , 470 , 165 , 40 ) then dxDrawRectangle ( 778 , 470 , 165 , 40 , tocolor ( 35 , 35 , 35 , 193 ), false )
else dxDrawRectangle ( 778 , 470 , 135 , 40 , tocolor ( 0 , 51 , 169 , 1150 ), false ) end
dxDrawText ( "Zaloguj" , 836 , 389 , 973 , 422 , tocolor ( 255 , 235 , 255 , 255 ), 1.00 , "default-bold" , "left" , "top" , false , false , false , false , false )
dxDrawText ( "Zarejestruj" , 830 , 480 , 1014 , 515 , tocolor ( 2535 , 255 , 255 , 255 ), 1.00 , "default-bold" , "left" , "top" , false , false , false , false , false )
local x , y = getPointFromDistanceRotation ( 1479.85486 ,- 1700.9080 , dist , angler )
setCameraMatrix ( x , y , 50 )
angler =( angler + 0.1 )
end
addEventHandler ( "onClientClick" , root , function( btn , state )
if btn == "left" and state == "down" then
if isMouseIn ( 778 , 375 , 165 , 42 ) and data . showed then
local login = guiGetText ( data . button [ 1 ])
local pass = guiGetText ( data . button [ 2 ])
if string . len ( login ) < 2 or string . len ( pass ) < 2 then
data . info = " "
return
end
triggerServerEvent ( "onServerPlayerLogin" , resourceRoot , login , pass )
end
if isMouseIn ( 778 , 470 , 165 , 40 ) and data . showed then
local login = guiGetText ( data . button [ 1 ])
local pass = guiGetText ( data . button [ 2 ])
if string . len ( login ) < 2 or string . len ( pass ) < 2 then
data . info = " "
return
end
if string . len ( login ) > 22 or string . len ( pass ) > 30 then
data . info = "Login/Has?o musi mie? mniej ni? 22/30 znak?w."
return
end
triggerServerEvent ( "onServerPlayerRegister" , resourceRoot , login , pass )
end
end
end )
addEvent ( "logging:result" , true )
addEventHandler ( "logging:result" , resourceRoot , function( value , info )
if not info then info = "" end
if value then
data . showed = false
showZones ( data . misc )
destroyElement ( data . button [ 1 ])
destroyElement ( data . button [ 2 ])
removeEventHandler ( "onClientRender" , root , renderLoginBox )
else
data . info = tostring ( info )
setTimer (function() data . info = nil end , 3000 , 1 )
end
end )
addEventHandler ( "onClientResourceStart" , resourceRoot , function()
showChat ( false )
showCursor ( true )
fadeCamera ( true )
data . showed = true
showPlayerHudComponent ( "all" , false )
setElementAlpha ( localPlayer , 0 )
data . misc = playSound ( "misc/intro.mp3" , true )
setSoundVolume ( data . misc , 1.0 )
guiSetInputMode ( "no_binds_when_editing" )
setElementData ( localPlayer , "status" , "Loguje si?" )
setElementData ( localPlayer , "player:logged" , false )
addEventHandler ( "onClientRender" , root , renderLoginBox )
data . button [ 1 ] = guiCreateEdit ( 444 , 375 , 292 , 39 , "" , false )
data . button [ 2 ] = guiCreateEdit ( 444 , 470 , 292 , 40 , "" , false )
end )
addEvent ( "hideLoginWindow" , true )
addEventHandler ( "hideLoginWindow" , getResourceRootElement ( getThisResource ()), hideLoginWindow )
Wysłany: 2016-08-10, 13:37
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4260 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
Drugi raz pokaza?e? to samo...
Poka? plik o nazwie "S_logging"
Podpis
Support-Team: 25.01.2016
Moderator: 10.07.2016
GG: 51274621
Skype : kuba_wicinski
Wysłany: 2016-08-10, 15:16
NeroNix
Wiek: 27 Na forum: 3614 dni Posty: 69
Piwa : 1
_Wicek_ ,
U g?ry da?em kod c_zone.lua
Nad tym tematem c_logging.lua
a w s_logging.lua nic nie ma dotycz?cego teleportacji xD
s_logging
addEvent ( "onServerPlayerRegister" , true )
addEventHandler ( "onServerPlayerRegister" , getRootElement (), dodaj )
addEvent ( "onServerPlayerLogin" , true )
addEventHandler ( "onServerPlayerLogin" , resourceRoot , function( login , pass )
local result = exports [ "og-db" ]: getRekord ( "SELECT * FROM og_users WHERE login=?" , login )
if result and #result > 0 then
if result [ 1 ]. login == login and result [ 1 ]. pass == md5 ( pass ) then
setPlayerName ( client , login )
setElementData ( client , "player:uid" , result [ 1 ]. id )
triggerClientEvent ( client , "logging:result" , resourceRoot , true , nil )
else
triggerClientEvent ( client , "logging:result" , resourceRoot , false , "Podane dane s? nieprawid?owe." )
end
else
triggerClientEvent ( client , "logging:result" , resourceRoot , false , "Podany login nie istnieje w bazie." )
end
end )
addEvent ( "onServerPlayerRegister" , true )
addEventHandler ( "onServerPlayerRegister" , getRootElement (), dodaj )
addEvent ( "onServerPlayerRegister" , true )
addEventHandler ( "onServerPlayerRegister" , resourceRoot , function( login , pass )
local result = exports [ "og-db" ]: getRekord ( "SELECT * FROM og_users WHERE login=?" , login )
if result and #result > 0 then
triggerClientEvent ( client , "logging:result" , resourceRoot , false , "Podany login ju? istnieje w bazie." )
else
local query = exports [ "og-db" ]: setRekord ( "INSERT INTO og_users (login,pass) VALUES (?,?)" , login , md5 ( pass ))
if query then
triggerClientEvent ( client , "logging:result" , resourceRoot , false , "Pomy?lnie zalogowa?e?(a?) si?" )
end
end
end )
Wysłany: 2016-08-19, 04:03
Barcioo
Kiedyś to było ST
Wiek: 26 Na forum: 4048 dni Posty: 458
Nick w MP: Bartek.
Piwa : 1887
Mo?e masz ?le baz? wgrano czyli lub mo?e zmieni?e? nazw? db mo?e masz ogrpg-db lub inn? mo?e dlatego nie zadzia?a? bo u mnie dzia?a jak powinno
Podpis
Kanał Youtube;
A tu zapraszam
[you]
, pomogłem Ci? Wynagrodź mnie
SUPPORT TEAM - 2016-09-03 do 2018-05-25
Test Mod - 2018-05-25
1k dni na Forum - 2018-01-28
GG: 62111935
Tagi: brak :: teleportacji
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: