Wysłany: 2015-07-26, 21:22
Vxen
Wiek: 27 Na forum: 4087 dni Posty: 293
Piwa : 1299
Ja zrobi? spawn po zalogowaniu? A podczas logowania ma lata?!
Wysłany: 2015-07-26, 21:25
Fanciak
BOT
Wiek: 25 Na forum: 4446 dni Posty: 728
Nick w MP: Fanciak
Piwa : 1572
Podczas logowania kamera stoi:
Podczas logowania kamera lata:
Po zalogowaniu:
Więcej informacji znajdziesz w Wikipedii MTA: spawnPlayer
lub
Wysłany: 2015-07-26, 21:27
Vxen
Wiek: 27 Na forum: 4087 dni Posty: 293
Piwa : 1299
A podaj jak ma by? to SmoothMoveCamera...
M?j kod panelu logowania to : client.lua
local x , y = guiGetScreenSize ()
function mainW ()
setCameraMatrix ( 100 , 100 , 100 , 100 , 100 , 100 )
username = guiCreateEdit ( 25 , 470 , 300 , 40 , "" , false )
password = guiCreateEdit ( 25 , 540 , 300 , 40 , "" , false )
guiEditSetMasked ( password , true )
loginButton = guiCreateButton ( 25 , 590 , 300 , 80 , "Loguj" , false )
registerButton = guiCreateButton ( 25 , 680 , 300 , 80 , "Rejestruj" , false )
-- login = guiCreateStaticImage ( 355 , 377 , 130 , 42 , "1.png" , false )
addEventHandler ( "onClientGUIClick" , loginButton ,
function ( us , pa )
local us = guiGetText ( username )
local pa = guiGetText ( password )
triggerServerEvent ( "loginReq" , getRootElement (), getLocalPlayer (), us , pa )
end , false
)
addEventHandler ( "onClientGUIClick" , registerButton ,
function ()
local us = guiGetText ( username )
local pa = guiGetText ( password )
triggerServerEvent ( "registerReq" , getRootElement (), getLocalPlayer (), us , pa )
end , false
)
showCursor ( true , true )
guiSetInputEnabled ( true )
end
addEventHandler ( "onClientResourceStart" , getRootElement (), mainW )
function maintaining ()
dashboard = dxDrawRectangle ( 0 , 0 , 350 , 9000 , tocolor ( 0 , 0 , 0 , 210 ), false )
userLabel = dxDrawText ( "Nick:" , 150 , 450 , 433 , 284 , tocolor ( 255 , 255 , 255 , 255 ), 1 , "default" , "left" , "top" , false , false , false , false , false )
passLabel = dxDrawText ( "Has?o:" , 150 , 520 , 433 , 335 , tocolor ( 255 , 255 , 255 , 255 ), 1 , "default" , "left" , "top" , false , false , false , false , false )
opisLable = dxDrawText ( "Witaj na serwerze Royal-rpg.net." , 25 , 300 , 433 , 335 , tocolor ( 255 , 255 , 255 , 255 ), 1 , "default" , "left" , "top" , false , false , false , false , false )
passLabel = dxDrawText ( "Posiadamy skrypty pisane przez Vxen!" , 25 , 315 , 433 , 335 , tocolor ( 255 , 255 , 255 , 255 ), 1 , "default" , "left" , "top" , false , false , false , false , false )
end
addEventHandler ( "onClientRender" , root , maintaining )
addEventHandler ( "onPlayerJoin" , getRootElement (), joinHandler )
addEvent ( "hideWindow" , true )
addEventHandler ( "hideWindow" , root ,
function ()
setCameraTarget ( localPlayer , localPlayer )
showCursor ( false , false )
guiSetInputEnabled ( false )
removeEventHandler ( "onClientRender" , getRootElement (), maintaining )
destroyElement ( username )
destroyElement ( password )
destroyElement ( loginButton )
destroyElement ( registerButton )
end
)
A to kod z server.lua
function submitLogin ( source , user , pass )
if ( user ~= "" ) then
if ( pass ~= "" ) then
local acc = getAccount ( user , pass )
if ( acc ~= false ) then
logIn ( source , acc , pass )
outputChatBox ( "You logged in successfully." , getRootElement (), 255 , 255 , 255 , false )
triggerClientEvent ( source , "hideWindow" , source )
else
outputChatBox ( "Podany dane s? nieprawid?owe!" , getRootElement (), 255 , 255 , 255 , false )
end
else
outputChatBox ( "Nie poda?e? has?a!" , getRootElement (), 255 , 255 , 255 , false )
end
else
outputChatBox ( "Nie pooda?e? Nicku!" , getRootElement (), 255 , 255 , 255 , false )
end
end
addEvent ( "loginReq" , true )
addEventHandler ( "loginReq" , getRootElement (), submitLogin )
addEvent ( "registerReq" , true )
addEventHandler ( "registerReq" , getRootElement (),
function ( source , Nuser , Npass )
if ( Nuser ~= "" and Nuser ~= nil and Npass ~= "" and Npass ~= nil ) then
local Nacc = addAccount ( Nuser , Npass )
if Nacc then
outputChatBox ( "Rejestracja zosta?a zako?czona pomy?lnie!" , getRootElement (), 255 , 255 , 255 )
end
end
end
)
Wysłany: 2015-07-26, 22:11
Fanciak
BOT
Wiek: 25 Na forum: 4446 dni Posty: 728
Nick w MP: Fanciak
Piwa : 1572
Ech.. Tylko zr?b za mnie, ta? Nie chce si? nawet w kod zajrze?.
Przeciez masz przyk?ad w tym co podalem na Wiki. Gotowych kod?w nie podajemy bo si? nie nauczysz.
Wysłany: 2015-07-26, 23:18
Vxen
Wiek: 27 Na forum: 4087 dni Posty: 293
Piwa : 1299
No jak daje tak o local x , y = guiGetScreenSize ()
function mainW ()
smoothMoveCamera ( 1154.1416 , - 1766.6813 , 16.5938 , 1154.1416 , - 1766.6813 , 16.5938 , 1154.1416 , - 1766.6813 , 16.5938 , 1154.1416 , - 1766.6813 , 16.5938 )
-- setCameraMatrix ( 100 , 100 , 100 , 100 , 100 , 100 )
-- buttonyPisalne danych
username = guiCreateEdit ( 25 , 470 , 300 , 40 , "" , false )
password = guiCreateEdit ( 25 , 540 , 300 , 40 , "" , false )
guiEditSetMasked ( password , true )
-- butony logowania
loginButton = guiCreateButton ( 25 , 590 , 300 , 80 , "Loguj" , false )
registerButton = guiCreateButton ( 25 , 680 , 300 , 80 , "Rejestruj" , false )
-- login = guiCreateStaticImage ( 355 , 377 , 130 , 42 , "1.png" , false )
addEventHandler ( "onClientGUIClick" , loginButton ,
function ( us , pa )
local us = guiGetText ( username )
local pa = guiGetText ( password )
triggerServerEvent ( "loginReq" , getRootElement (), getLocalPlayer (), us , pa )
end , false
)
addEventHandler ( "onClientGUIClick" , registerButton ,
function ()
local us = guiGetText ( username )
local pa = guiGetText ( password )
triggerServerEvent ( "registerReq" , getRootElement (), getLocalPlayer (), us , pa )
end , false
)
showCursor ( true , true )
guiSetInputEnabled ( true )
end
addEventHandler ( "onClientResourceStart" , getRootElement (), mainW )
function maintaining ()
dashboard = dxDrawRectangle ( 0 , 0 , 350 , 9000 , tocolor ( 0 , 0 , 0 , 210 ), false )
userLabel = dxDrawText ( "Nick:" , 150 , 450 , 433 , 284 , tocolor ( 255 , 255 , 255 , 255 ), 1 , "default" , "left" , "top" , false , false , false , false , false )
passLabel = dxDrawText ( "Has?o:" , 150 , 520 , 433 , 335 , tocolor ( 255 , 255 , 255 , 255 ), 1 , "default" , "left" , "top" , false , false , false , false , false )
opisLable = dxDrawText ( "Witaj na serwerze Royal-rpg.net." , 25 , 300 , 433 , 335 , tocolor ( 255 , 255 , 255 , 255 ), 1 , "default" , "left" , "top" , false , false , false , false , false )
passLabel = dxDrawText ( "Posiadamy skrypty pisane przez Vxen!" , 25 , 315 , 433 , 335 , tocolor ( 255 , 255 , 255 , 255 ), 1 , "default" , "left" , "top" , false , false , false , false , false )
end
addEventHandler ( "onClientRender" , root , maintaining )
addEventHandler ( "onPlayerJoin" , getRootElement (), joinHandler )
addEvent ( "hideWindow" , true )
addEventHandler ( "hideWindow" , root ,
function ()
setCameraTarget ( localPlayer , localPlayer )
showCursor ( false , false )
guiSetInputEnabled ( false )
removeEventHandler ( "onClientRender" , getRootElement (), maintaining )
destroyElement ( username )
destroyElement ( password )
destroyElement ( loginButton )
destroyElement ( registerButton )
end
)
function joinHandler ()
fadeCamera ( source , true )
setCameraTarget ( source , source )
outputChatBox ( "Witaj na moim serwerze!" , source )
end
addEventHandler ( "onPlayerJoin" , getRootElement (), joinHandler ) to mi p?? gui ucieka....
Wysłany: 2015-07-26, 23:36
#404
Wiek: 26 Na forum: 4772 dni Posty: 1438
Piwa : 2512
smoothMoveCamera ( 1154.1416 , - 1766.6813 , 16.5938 , 1154.1416 , - 1766.6813 , 16.5938 , 1154.1416 , - 1766.6813 , 16.5938 , 1154.1416 , - 1766.6813 , 16.5938 )
-- buttonyPisalne danych
username = guiCreateEdit ( 25 , 470 , 300 , 40 , "" , false )
password = guiCreateEdit ( 25 , 540 , 300 , 40 , "" , false )
guiEditSetMasked ( password , true )
-- butony logowania
loginButton = guiCreateButton ( 25 , 590 , 300 , 80 , "Loguj" , false )
registerButton = guiCreateButton ( 25 , 680 , 300 , 80 , "Rejestruj" , false )
-- login = guiCreateStaticImage ( 355 , 377 , 130 , 42 , "1.png" , false )
I wywal to cale joinHandler na koncu, bo to jest po stronie serwera, a ty tu masz clienta...
Wysłany: 2015-07-26, 23:40
Vxen
Wiek: 27 Na forum: 4087 dni Posty: 293
Piwa : 1299
Wbij na 46.29.17.244:20336 i zobacz co si? dzieje.
Wysłany: 2015-07-26, 23:42
#404
Wiek: 26 Na forum: 4772 dni Posty: 1438
Piwa : 2512
"Vxen" napisał/a :Wbij na 46.29.17.244:20336 i zobacz co si? dzieje.
Okej, tylko pobiore mta na telefon...
Chlopie, jest 23, nie chce mi sie wracsc na pc...
Zamiast tworzyc offtop to po prostu napisz i podaj bledy z DB3
Wysłany: 2015-07-26, 23:44
Vxen
Wiek: 27 Na forum: 4087 dni Posty: 293
Piwa : 1299
A jak mam sprawdzi? te b??dy?
Wysłany: 2015-07-27, 07:48
Fanciak
BOT
Wiek: 25 Na forum: 4446 dni Posty: 728
Nick w MP: Fanciak
Piwa : 1572
Wpisujesz na serwerze /debugscript 3 i podajesz nam b??dy z tego skryptu, kt?re tam s?.
Wysłany: 2015-07-27, 08:34
Vxen
Wiek: 27 Na forum: 4087 dni Posty: 293
Piwa : 1299
Gdy wpisze /debugscript 3 to wyskakuje mi co? z ACL a zalogowa? si? nie mog? bo p?? gui ucieka. No ale ju? sam zrobi?em spawn po zalogowaniu, ogarn??em ?e ten kod local x = 1959.55
local y = - 1714.46
local z = 15
spawnPlayer ( source , x , y , z ) trzeba da? po stronie serwera. No a tera musz? zrobi? aby GUI dzia?a?o na wszystkich rozdzia?kach.... Mo?ecie poda? wiki mta z tym tematem? Mo?e co? ograne sam.
Wysłany: 2015-07-27, 08:48
Fanciak
BOT
Wiek: 25 Na forum: 4446 dni Posty: 728
Nick w MP: Fanciak
Piwa : 1572
To mo?e zaloguj si? przez /login Vxen has?o ? Wtedy wpisz /debugscript 3 i podaj b??dy.
Wysłany: 2015-07-27, 09:08
Vxen
Wiek: 27 Na forum: 4087 dni Posty: 293
Piwa : 1299
Temat do zamkni?cia. Kolega mi to zrobi?.
Tagi: spawn :: zalogowaniu?
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: