Jump to content

Norhy

Members
  • Posts

    125
  • Joined

  • Last visited

Everything posted by Norhy

  1. Norhy

    MTA SA Instances

    Hello. Is it possible to run about 2 MTAs on your PC? I want to try out something but i need 2 people, and don't have a public server. So is it possible?
  2. Could you help me with this, per Skype? Because idk what to do..
  3. Hello. Another problem need to be solved. So, i will explain it: When i have select the team for e.g.: "Police" and the class "Officer", click on the button "Spawn" (btnSpawn) that then i will be spawned at LSPD. Or: When i have select the team for e.g.: "Criminal" and the class "Robber", click on the button "Spawn" that then i will be spawned at the Unity Station. How to make that pls?
  4. So. Another question . I don't understand the triggerClientEvent functions. So i need help. I have the gui wdwMenu, and i want it to appear when anyone logs in. Login: function loginHandler(username,password,thePlayer) local account = getAccount (username, password) if account then logIn(source, account, password) triggerClientEvent(source,"HideGui",source) triggerClientEvent ( "ShowGui", guiSetVisible(), wdwMenu, true ) else outputChatBox("Wrong username / password, try again.",source) end end addEventHandler("submitLogin",root,loginHandler) I tried to do this: function loginHandler(username,password,thePlayer) local account = getAccount (username, password) if account then logIn(source, account, password) triggerClientEvent(source,"HideGui",source) triggerClientEvent ( "ShowGui", guiSetVisible(), wdwMenu, true ) else outputChatBox("Wrong username / password, try again.",source) end end addEventHandler("submitLogin",root,loginHandler) [/lua] But it doesn't work. I'm really a noob to triggering a event between Client or Server, so if someone would be so neat to explain me how to work with it, i would be glad.
  5. Thank you. First i didn't knew, what you mean, but then i understood it. addEventHandler ( "onClientGUIComboBoxAccepted", guiRoot, function ( comboBox ) if ( comboBox == comboTeam ) then local item = guiComboBoxGetSelected ( comboBox ) local text = guiComboBoxGetItemText ( comboBox, item ) if ( tostring ( text ) and tostring ( text ) ~= "" ) then if ( tostring ( text ) == "Police" ) then guiSetText ( teamMemo, "This teams objective is to keep the streets clean and safe. They arrest criminals by hitting them with the nightstick. They main 'base' is at the LSPD." ) guiComboBoxClear ( comboClass ) guiComboBoxAddItem(comboClass, "Officer") end end end end )
  6. Sorry for doubleposting and wasting your time, but i got a another problem. The team comboBox is working. I created a another one, called "comboClass". Now, when they playes chooses the "Police" team, in the "comboClass" comboBox will be added a item called "Officer", but when i choose "Police" team again, another "Officer" item pops up. How to make it, that when i choose the Police team several times, only 1 "Officer" class will appear?
  7. teamMemo = guiCreateMemo( 10, 50, 500, 150, "", false, wdwMenu ) Yes, i have. Thank you for the help.
  8. It didn't worked. Anyone help?
  9. Here, i got this code: comboTeam = guiCreateComboBox ( 0.20, 0.03, 0.25, 0.30, "Team", true, wdwMenu ) guiComboBoxAddItem(comboTeam, "Police") guiComboBoxAddItem(comboTeam, "Criminal") guiComboBoxAddItem(comboTeam, "Civillian") guiComboBoxAddItem(comboTeam, "Military") guiComboBoxAddItem(comboTeam, "Staff") And i created a memo. Now i want, if someone clicks on the comboBoxItem for example: "Police", then in the memo will appear some text.. How to do that?
  10. Hi again. I've got another gui called wdwMenu. Now i created a combobox, but idk how to attach it to the gui wdwMenu. The code: cmbTeam = guiCreateComboBox ( left, top, windowWidth,windowHeight, "Team", true ) Please how to attach the Combobox to the GUI? So i choose its positions in the menu ( bottom, corner etc.. )
  11. wdwLogin = guiCreateWindow(0.375, 0.375, 0.70, 0.70, "Vitaj", true) guiCreateLabel(0.0825, 0.1, 0.25, 0.25, "Meno", true, wdwLogin) guiCreateLabel(0.0825, 0.2, 0.25, 0.25, "Heslo", true, wdwLogin) guiCreateLabel(0.0825, 0.6, 0.25, 0.25, "Info", true, wdwLogin) wdwRegister = guiCreateWindow(0.375, 0.375, 0.40, 0.40, "Registracia", true) guiCreateLabel(0.0825, 0.2, 0.25, 0.25, "Meno", true, wdwRegister) guiCreateLabel(0.0825, 0.4, 0.25, 0.25, "Heslo", true, wdwRegister) edtUser = guiCreateEdit(0.160, 0.1, 0.3, 0.06, "", true, wdwLogin) edtPass = guiCreateEdit(0.160, 0.2, 0.3, 0.06, "", true, wdwLogin) guiCreateMemo( 118, 200, 850, 280, "", false, wdwLogin ) guiEditSetMaxLength(edtUser, 50) guiEditSetMaxLength(edtPass, 50) edtUserS = guiCreateEdit(0.160, 0.2, 0.4, 0.06, "", true, wdwRegister) edtPassS = guiCreateEdit(0.160, 0.4, 0.5, 0.06, "", true, wdwRegister) guiEditSetMaxLength(edtUserS, 50) guiEditSetMaxLength(edtPassS, 50) guiEditSetMasked ( edtPassS, true ) guiEditSetMasked ( edtPass, true ) btnLogin = guiCreateButton(0.500, 0.1, 0.25, 0.2, "Prihlasit", true, wdwLogin) btnRegister = guiCreateButton(0.750, 0.1, 0.25, 0.2, "Registracia", true, wdwLogin) btnRegisterS = guiCreateButton(0.750, 0.1, 0.25, 0.2, "Registrovat", true, wdwRegister) guiSetVisible(wdwRegister,false) showCursor(true) guiSetInputEnabled(true) addEventHandler('onClientGUIClick',root, function() if source == btnLogin then local user = guiGetText(edtUser) local pass = guiGetText(edtPass) if user ~= "" and pass ~= "" then triggerServerEvent('submitLogin',localPlayer,user,pass) else outputChatBox("Prosim napis svoje meno a heslo.") end end end ) addEvent("HideGui",true) addEventHandler("HideGui",root, function() guiSetInputEnabled(false) showCursor(false) guiSetVisible(wdwLogin,false) guiSetVisible(wdwRegister,false) end) addEventHandler('onClientGUIClick', root, function() if source == btnRegister then guiSetVisible(wdwRegister,true) end end)
  12. Tried to register, clicked on "Register" button but nothing happened, no text appeared.
  13. When i typed the command ingame, this text appeared on my screen in Green color: INFO: votemanager precreateGuiElements
  14. Quote: [18:36:10] debugscript: Incorrent client type for this command.
  15. can you show me where? what line? function registerHandler(username, password) local account = getAccount(username, password) if (account ~= false) then outputChatBox( "", root, 255, 255, 255 ) else account = addAccount(username, password) if (logIn(source, account, password) == true) then triggerClientEvent(source, "hidewdwRegister", getRootElement()) end end end addEventHandler("submitRegister", root, registerHandler) This is the full code, i got it on the Top of it: addEvent( "submitLogin", true ) addEvent( "submitRegister", true ) function loginHandler(username,password) local account = getAccount (username, password) if account then logIn(source, account, password) triggerClientEvent(source,"HideGui",source) else outputChatBox("Zle zadane Meno alebo Heslo, skus znova prosim.",source) end end addEventHandler("submitLogin",root,loginHandler) function registerHandler(username, password) local account = getAccount(username, password) if (account ~= false) then outputChatBox( "", root, 255, 255, 255 ) else account = addAccount(username, password) if (logIn(source, account, password) == true) then triggerClientEvent(source, "hidewdwRegister", getRootElement()) end end end addEventHandler("submitRegister", root, registerHandler)
  16. I got that in my code already..
  17. Where to type aclReload?
  18. Ok. Now, i have the register system, this is the code ( Server ): function registerHandler(username, password) local account = getAccount(username, password) if (account ~= false) then outputChatBox( "", root, 255, 255, 255 ) else account = addAccount(username, password) if (logIn(source, account, password) == true) then triggerClientEvent(source, "hidewdwRegister", getRootElement()) end end end addEventHandler("submitRegister", root, registerHandler) Now i typed in ACL Group "Admin" this: "Admin"> "Moderator"> "SuperModerator"> "Admin"> "RPC"> "resource.admin"> "resource.webadmin"> "user.Norhy"> "resource.rpg"> But it doesn't work when i try to register, what's wrong?
  19. Ok thanks. But i still don't undestand the thing with the Gui hidding.
  20. And how to fix that? When i type a wrong username / pass to show the GUI again? I tried setGuiVisible, but that didn't worked.. Question: How to make the password hidden? So there won't be alphabetical letter but dots like on Facebook. Another problem: I've tried to finish the register system so it adds a account, i copied from wiki, but it didn't worked. When i click on "Register" nothing happens.. function registerHandler( username,password ) if( password ~= "" and password ~= nil and username ~= "" and username ~= nil ) then local accountAdded = addAccount ( username, password ) if ( accountAdded ) then outputChatBox ( "You are registered now, please login.", source ) else outputChatBox ( "Account couldn't be created.", source ) end else outputChatBox ( "Enter a username and a password.", source) end end addEventHandler( "submitRegister",root,registerHandler )
  21. Thank you very much. Question: If i will have more problems with this GUI, can i post it here?
  22. Hi. I want a login / register panel for my server. I used the handler "onPlayerJoin", but for some reason, my GUI doesn't appear when a player joins. The next problem is, that the registration panel appears only when a player joins, and it should only appear when a player clicks on the button "Registracia" at the Login Panel. Client: wdwLogin = guiCreateWindow(0.375, 0.375, 0.70, 0.70, "Vitaj", true) guiCreateLabel(0.0825, 0.1, 0.25, 0.25, "Meno", true, wdwLogin) guiCreateLabel(0.0825, 0.2, 0.25, 0.25, "Heslo", true, wdwLogin) guiCreateLabel(0.0825, 0.6, 0.25, 0.25, "Info", true, wdwLogin) wdwRegister = guiCreateWindow(0.375, 0.375, 0.30, 0.30, "Registracia", true) guiCreateLabel(0.0825, 0.2, 0.25, 0.25, "Meno", true, wdwRegister) guiCreateLabel(0.0825, 0.4, 0.25, 0.25, "Heslo", true, wdwRegister) edtUser = guiCreateEdit(0.160, 0.1, 0.3, 0.06, "", true, wdwLogin) edtPass = guiCreateEdit(0.160, 0.2, 0.3, 0.06, "", true, wdwLogin) guiCreateMemo( 118, 200, 850, 280, "", false, wdwLogin ) guiEditSetMaxLength(edtUser, 50) guiEditSetMaxLength(edtPass, 50) edtUserS = guiCreateEdit(0.160, 0.2, 0.3, 0.06, "", true, wdwRegister) edtPassS = guiCreateEdit(0.160, 0.4, 0.3, 0.06, "", true, wdwRegister) guiEditSetMaxLength(edtUserS, 50) guiEditSetMaxLength(edtPassS, 50) btnLogin = guiCreateButton(0.500, 0.1, 0.25, 0.2, "Prihlasit", true, wdwLogin) btnRegister = guiCreateButton(0.750, 0.1, 0.25, 0.2, "Registracia", true, wdwLogin) btnRegisterS = guiCreateButton(0.750, 0.1, 0.25, 0.2, "Registrovat", true, wdwRegister) guiSetVisible(wdwLogin, false) addEventHandler("onPlayerJoin", resourceRoot, function () guiSetVisible(wdwLogin, true) showCursor(true) guiSetInputEnabled(true) end ) addEventHandler('onClientGUIClick',root, function() if source == btnLogin then local user = guiGetText(edtUser) local pass = guiGetText(edtPass) if user and pass then triggerServerEvent('submitLogin',localPlayer,user,pass) guiSetInputEnabled(false) showCursor(false) guiSetVisible(wdwLogin,false) else outputChatBox("Prosim napis svoje meno a heslo.") guiSetVisible(wdwLogin,true) end end end ) addEventHandler('onClientGUIClick', root, function() if source == btnRegister then guiSetVisible(wdwRegister,true) end end ) Server: addEvent( "submitLogin",true ) function loginHandler( username,password ) local account = getAccount ( username, password ) if account then logIn ( source, account, password ) else outputChatBox("Zle zadane Meno alebo Heslo, skus znova prosim.",source ) end end addEventHandler( "submitLogin",root,loginHandler )
  23. Norhy

    Delete

    Delete please
×
×
  • Create New...