Death Posted February 22, 2015 Share Posted February 22, 2015 when the player entering and possible while it is downloading I fixed a camera somewhere? Link to comment
Enargy, Posted February 22, 2015 Share Posted February 22, 2015 Check it out setCameraMatrix Code; setCameraMatrix onClientPlayerJoin -- event Link to comment
Death Posted February 22, 2015 Author Share Posted February 22, 2015 while the player downloads can to set camera matrix ? Link to comment
JR10 Posted February 22, 2015 Share Posted February 22, 2015 No. All the scripts are downloaded first then ran. You'll need to use setCameraMatrix server side. Link to comment
Death Posted February 22, 2015 Author Share Posted February 22, 2015 server ---------------------- function join ( ) triggerClientEvent ( source, "onClientPlayerJoinn", source ) end addEventHandler ( "onPlayerJoin", getRootElement(), join ) client-- addEvent("onClientPlayerJoinn", true) myFont = nil -- Display text using dxDrawText function tela_Carregando() local x, y = guiGetScreenSize () sx = x sy = y + 400 setCameraMatrix(1234.0230712891, 43.429969787598, 65.919090270996, 1468.388671875, -918.42474365234, 99.881813049316) dxDrawText( getServerName().." Loading...", x/2-230, sy*0.2+50, 500, 25, tocolor(255,255,255), 1, myFont ) end function inicio() if not myFont then myFont = dxCreateFont( "font/Oswald.ttf", 30 ) -- Create custom font end addEventHandler( "onClientRender", root, tela_Carregando) end function timer(source) setTimer ( inicio, 100, 1, source ) end addEventHandler("onClientPlayerJoinn", root, timer) function lol( startedRes ) if getResourcerName(startedRes) == "GM" then removeEventHandler( "onClientRender", root, tela_Carregando) end end addEventHandler( "onClientResourceStart", getRootElement(), lol) the problem and that only works after downloading all resources plis help Link to comment
Enargy, Posted February 22, 2015 Share Posted February 22, 2015 getServerName() works in server-side, not client-side. Link to comment
Death Posted February 22, 2015 Author Share Posted February 22, 2015 even removing does not work... Link to comment
Enargy, Posted February 22, 2015 Share Posted February 22, 2015 try this: -- CLIENTSIDE local myFont = dxCreateFont( "font/Oswald.ttf", 30 ) sName = "" addEvent("onClientPlayerJoinn", true) function timer(servername) sName = tostring(servername) end addEventHandler("onClientPlayerJoinn", root, timer) function tela_Carregando() local x, y = guiGetScreenSize () sx = x sy = y + 400 dxDrawText( sName.." Loading...", x/2-230, sy*0.2+50, 500, 25, tocolor(255,255,255), 1, "arial" ) end addEventHandler( "onClientRender", root, tela_Carregando) function lol( startedRes ) if getResourcerName(startedRes) == "GM" then removeEventHandler( "onClientRender", root, tela_Carregando) end end --SERVERSIDE function join () local serverName = getServerName() setTimer(triggerClientEvent, 3000, 1, source, "onClientPlayerJoinn", source, serverName ) setCameraMatrix(source, 1234.0230712891, 43.429969787598, 65.919090270996, 1468.388671875, -918.42474365234, 99.881813049316) end addEventHandler ( "onPlayerJoin", root, join ) Link to comment
Death Posted February 22, 2015 Author Share Posted February 22, 2015 worked !!!!!!! Thanks! hugs Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now