Estevam2d Posted February 20, 2014 Share Posted February 20, 2014 How do I open a guIWindow when I register, but want to appear once a player? I was wondering what I could use to make this event. Sorry for the bad english Here is the script: Client.lua --By: StevanJunior GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Text = {} GUIEditor_Scrollbar = {} janela = guiCreateWindow(0,0,99999,999,"Regras Server Brasil jobs server",false) guiSetAlpha(janela, 500.0) GUIEditor_Label[1] = guiCreateLabel(10,70,400,60,"Proibido Death Match: ",false,janela) GUIEditor_Text[1] = guiCreateLabel(140,50,9999,70,"Todos os jogadores até mesmo Administradores é proibido matar ou atacar qualquer jogador sem motivo, isso podera levar ao jogador prisão de 1 minuto, horas ou até mesmo dias dependendo da causa.\nOs Administradores estão encarregados de cuidar e ajudar o server a creser, caso um administrador mate um jogar mesmo com motivo podera perder a conta ou ser afastado por horas ou dias.\nO administrador podera dar danos em um jogador caso ele receba permisão do mesmo !\nO Spawn Kill em lugares com zona verde é altamente proibido e com perigo de levar ban permanente. ",false,janela) guiLabelSetColor(GUIEditor_Label[1],255,0,0) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Label[2] = guiCreateLabel(10,135,400,60," Carros Destruidos: ",false,janela) GUIEditor_Text[2] = guiCreateLabel(140,125,9999,50,"Todos os jogadores é praticamente obrigado ter seu proprio carro poes é um server RPG, mas caso seja destruido seu carro nao tera reembolso mesmo com provas poes nao poderemos beneficiar apenas um jogador.\nSe o seu carro foi destruido por um jogador o mesmo podera receber punisao devidas pelo administradores do server.",false,janela) guiLabelSetColor(GUIEditor_Label[2],255,0,0) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Label[3] = guiCreateLabel(10,173,400,60,"Proibido pedir Itens:",false,janela) GUIEditor_Text[3] = guiCreateLabel(140,165,9999,50,"Evite ficar pedindo coisas para os ADMS, se eles prometerem algo eles vão cumprir, pode demorar um tempo mas tenha paciencia, nunca encha a paciencia de um ADM. Sempre é bom seguir as regras poes assim voce\nGanhara respeito com Eles #Dica",false,janela) guiLabelSetColor(GUIEditor_Label[3],255,0,0) guiSetFont(GUIEditor_Label[3],"default-bold-small") GUIEditor_Label[4] = guiCreateLabel(10,215,400,60,"Policias Vs Criminosos:",false,janela) GUIEditor_Text[4] = guiCreateLabel(140,200,9999,50,"Policiais e Criminosos estão proibidos de matarem Civis Trabalhadores caso isso ocorra levara jail por 1 minuto ou até mais tempo dependendo dos 'Adminitradores'\nPolicias é proibido atira em um bandido que não der o primeiro disparo, caso o Criminosos atire primeiro os policias poderam matar sem problema algum\né proibido DM em SAN FIERRO, DM é so permitido em LOS SANTOS e LAS VENTURAS.",false,janela) guiLabelSetColor(GUIEditor_Label[4],255,0,0) guiSetFont(GUIEditor_Label[4],"default-bold-small") GUIEditor_Label[5] = guiCreateLabel(10,250,400,60,"Programas Hacker e outros:",false,janela) GUIEditor_Text[5] = guiCreateLabel(180,250,9999,50,"Proibido usar qualquer tipo de programa ou algo semelhante que beneficie varios jogadores ou a si mesmo caso os ADMS fiquem sabendo eles tomaram as providências cabíveis.",false,janela) guiLabelSetColor(GUIEditor_Label[5],255,0,0) guiSetFont(GUIEditor_Label[5],"default-bold-small") GUIEditor_Label[5] = guiCreateLabel(10,290,400,60,"Spawn d veiculos F2(cilindros):",false,janela) GUIEditor_Text[5] = guiCreateLabel(190,290,9999,50,"Existe cilindros que dão carros Free carros que sao livre para os jogadores, mas é proibido deixar eles jogados caso um ADM veja um jogador deixando um carro parado sem dono ele sera explodido por nao ter\nIdentificação.",false,janela) guiLabelSetColor(GUIEditor_Label[5],255,0,0) guiSetFont(GUIEditor_Label[5],"default-bold-small") GUIEditor_Label[99] = guiCreateLabel(10,350,400,60,"",false,janela) guiLabelSetColor(GUIEditor_Label[99],255,255,0) guiSetFont(GUIEditor_Label[99],"default-bold-small") GUIEditor_Button[1] = guiCreateButton(1250,730,100,50,"Sair",false,janela) guiSetVisible(janela, false) showCursor(false) function enableVehicleControl() if guiGetVisible(janela) == false then guiSetVisible(janela, true) showCursor(true) else guiSetVisible(janela, false) showCursor(false) end end addCommandHandler("regras", enableVehicleControl) function closeButton() guiSetVisible(janela, false) showCursor(false) end addEventHandler ( "onClientGUIClick", janela, closeButton, false ) function updateRatio(Scrolled) local position = guiScrollBarGetScrollPosition(Scrolled) local door = getElementData(Scrolled, "Type") triggerServerEvent("moveThisShit", getLocalPlayer(), door, position) end addEventHandler("onClientGUIScroll", getRootElement(), updateRatio) addEventHandler("onClientGUIClick", root, function ( ) if ( source == GUIEditor_Button[1] ) then guiSetVisible ( janela, false ) showCursor ( false ) end end ) Link to comment
Anubhav Posted February 20, 2014 Share Posted February 20, 2014 First of all you will need to use triggerServerEvent. Use it and add the event onPlayerJoin. Link to comment
NeO_DUFFMAN Posted February 20, 2014 Share Posted February 20, 2014 Alternatively, you can either use onClientPlayerJoin or onClientResourceStart. Link to comment
AboShanab Posted February 20, 2014 Share Posted February 20, 2014 Use "onClientResourceStart" and download new script of guieditor Link to comment
Anubhav Posted February 20, 2014 Share Posted February 20, 2014 Use "onClientResourceStart" and download new script of guieditor Useless reply. Totaly useless. Do you know also what is he saying? He is saying that how can he make the window visible many a player joins. Link to comment
Karuzo Posted February 20, 2014 Share Posted February 20, 2014 What? Why should he open a register window everytime a player joins? Link to comment
Moderators Citizen Posted February 20, 2014 Moderators Share Posted February 20, 2014 Use "onClientResourceStart" and download new script of guieditor Useless reply. Totaly useless. Do you know also what is he saying? He is saying that how can he make the window visible many a player joins. You are wrong, it was usefull. He is right, because onClientResourceStart is triggered when the resource is started so when a player joined ad also finished to download that resource. So using onClientResourceStart will works fine for what Estevam2d want to do. Of course, he will have to set the local resource for the second argument (attachedTo) and the enableVehicleControl function as 3rd argument (handlerFunction). Link to comment
NeO_DUFFMAN Posted February 20, 2014 Share Posted February 20, 2014 Use "onClientResourceStart" and download new script of guieditor Useless reply. Totaly useless. Do you know also what is he saying? He is saying that how can he make the window visible many a player joins. Harsh criticism much ? Link to comment
Arnold-1 Posted February 20, 2014 Share Posted February 20, 2014 here is what you have to do first on Client Side function triggered () guiSetVisible(yourWindowName, true) showCursor(true) end addEvent("theEventNameYouWantButItCan'tBeOneOfTheDefaultMTAEvents",true) addEventHandler("theEventNameYouWantButItCan'tBeOneOfTheDefaultMTAEvents",root,triggered) and in server side triggerClientEvent("theEventNameYouWantButItCan'tBeOneOfTheDefaultMTAEvents",resourceRoot) you can add it in any function or event Link to comment
Estevam2d Posted February 20, 2014 Author Share Posted February 20, 2014 I'm glad you guys are helping me. But my idea is that the window appears only once a player... Link to comment
Arnold-1 Posted February 20, 2014 Share Posted February 20, 2014 you can use setAccountData Link to comment
Saml1er Posted February 20, 2014 Share Posted February 20, 2014 you can use setAccountData What for? setAccountData is server side function. Well you want a single GUI to work for everyone? Link to comment
Karuzo Posted February 20, 2014 Share Posted February 20, 2014 Well you want a single GUI to work for everyone? I think he wants that the register login shows the player just one time, and the one times is , is the first join. Link to comment
Estevam2d Posted February 20, 2014 Author Share Posted February 20, 2014 I wanted the panel rules appear only once did. Link to comment
Arnold-1 Posted February 22, 2014 Share Posted February 22, 2014 you can use setAccountData What for? setAccountData is server side function. Well you want a single GUI to work for everyone? even though he can trigger it client side server: function set () account = getPlayerAccount(source) setAccountData(account,"readRules",1) end addEvent("onAccountDataSet",true) addEventHandler("onAccountDataSet",root,account) client guiSetVisible(yourwindow,true) triggerServerEvent("onAccountDataSet",localPlayer) 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