Jump to content

Captain Cody

Members
  • Posts

    2,753
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Captain Cody

  1. Well what I was trying to do, is when player first registers, it will create an Xml file, assigned to that persons serial. Which will be used by multiple resources 'All server side' then when the inventory system is put into use, what I attempted to do is have it take the info from the xml then send it client side as to populate the gui gridlist. //Inventory would be limited to 50 items// This sound like something SQL should be used or XML? --- To addon to what you just added --- I was going to have everything stored server side as to be able to access everything and prevent cheating. + I'd prefer using the one that is best for the situation, that's why I ask if XML or SQL would be the best for this.
  2. Well the issue I had was loading each individual file server side, then sending that info file side. But as to what you said at first, I have barley any experience with sql, have mostly done xml files in the past. But I guess I'll try mysql. --
  3. Well I set deadline to December 1st, as to give me plenty of time to make the scripts then continue on to test and edit the scripts. I have the time period broken up into 4 sections, just did not post the dates on the thread as there has been a delay I did not expect.
  4. Any one? Trying to get this done, but I cannot figure this out.
  5. I'm working on an inventory system, and I have it so it creates an xml file, and assigns the players serial as the xmls name, what I am trying to do is load the xml server side 'So clients cannot mess with it' then send it to client side and have it converted into a grid list so it allows the players to select the items and what not. But the issue I am running into, is how would I go about doing this in general. I know how to load one xml file and use it for shops and stuff, but doing individual files for each player is an issue I have. "rentalKey" Id="1"> -- Xml file -- Script? -- In general have no clue.
  6. requestLODsClient, isn't added server side just means one of your client side scripts are trying to trigger a no existent function, what resource is the error coming from?
  7. I didn't check if script works but. Put it into a lua file, and create a meta file --- "AntiSomething" author="Person" version="1" type="script" />
  8. How do I make it so gui is on top or bottom on all resolutions If that makes any sense what so ever. I'm using gui editor, "I suck at GUI's" and there's a left and or right alignment, but not top or bottom. How would I align it with top or bottom.
  9. Well I'm just explaining that all you need is a good host for the download, you can host it on same thing no issue.
  10. Setting up the http server on a host with a good upload speed would be a very good idea, though 2.5 gbs, holy crap..
  11. Well I'm not saying home host, -- Terrible idea, I'm saying you don't an almighty host. Another thing to point out, I had 500kb/s download and upload speed at the time, yet servers download wasn't to bad. Though one issue is, the regular mta download is limited, I'd recommend you set up an HTTP download server for the files as to not take 3 days to download.
  12. Really you can get a barebone host and still have awesome performance with mta servers. I've hosted before on my craptop 30 slots filled no issue.
  13. How would I go about making gui such as this?
  14. No issue, was my fault for not noticing that.
  15. Oh wait never mind I found the issue, switched the memos to guiCreateEdit Was comparing mine to another just a minute ago and noticed that.
  16. Yes, nothing different and I checked the reg of the server, the 2 accounts have identical name and password
  17. Server side code is using source from another login panel that works perfectly, using it for GUI testing function PlayerLogin(username,password,checksave) if not (username == "") then if not (password == "") then local account = getAccount ( username, password ) if ( account ~= false ) then logIn(source, account, password) triggerClientEvent (source,"hideLoginWindow",getRootElement()) if checksave == true then triggerClientEvent(source,"saveLoginToXML",getRootElement(),username,password) else triggerClientEvent(source,"resetSaveXML",getRootElement(),username,password) end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Login","Wrong username and/or password") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Login","Please enter your password!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Login","Please enter your username!") end end addEvent("onRequestLogin",true) addEventHandler("onRequestLogin",getRootElement(),PlayerLogin) function registerPlayer(username,password,passwordConfirm) if not (username == "") then if not (password == "") then if not (passwordConfirm == "") then if password == passwordConfirm then local account = getAccount (username,password) if (account == false) then local accountAdded = addAccount(tostring(username),tostring(password)) if (accountAdded) then outputChatBox ("#00FF00Sikeresen regisztráltál! [username: #FFFFFF" .. username .. " #00FF00| Password: #FFFFFF" .. password .. "#00FF00 ]",source,255,255,255,true ) outputChatBox ("#FF0000- HBT - Login Panel By.: John_Scott",source,255,255,255,true ) else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Error! Please try again with new username or password!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","This username already taken!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","The passwords does not match!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Please confirm your password!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Please enter yout password!") end else triggerClientEvent(source,"set_warning_text",getRootElement(),"Register","Please enter your username!") end end addEvent("onRequestRegister",true) addEventHandler("onRequestRegister",getRootElement(),registerPlayer) Client side MainWindow = {} function open_log_reg_pannel() if not(isElement(MainWindow)) then end local screenW, screenH = guiGetScreenSize() MainWindow = guiCreateWindow((screenW - 454) / 2, (screenH - 224) / 2, 454, 224, "Heretrics RolePlay", false) guiWindowSetSizable(MainWindow, false) user = guiCreateMemo(33, 35, 196, 33, "", false, MainWindow) userpassword = guiCreateMemo(33, 94, 196, 33, "", false, MainWindow) email = guiCreateMemo(33, 151, 149, 31, "", false, MainWindow) checkbox_save = guiCreateCheckBox(198, 160, 15, 12, "", false, false, MainWindow) usernamel = guiCreateLabel(43, 67, 170, 23, "User Name", false, MainWindow) passwordl = guiCreateLabel(43, 128, 170, 23, "Password", false, MainWindow) emaill = guiCreateLabel(43, 182, 170, 23, "Email, not required", false, MainWindow) savel = guiCreateLabel(188, 172, 170, 23, "Save?", false, MainWindow) loginb = guiCreateButton(282, 40, 134, 40, "Login", false, MainWindow) guiSetProperty(loginb, "NormalTextColour", "FFFEFEFE") registerb = guiCreateButton(282, 94, 134, 40, "Register", false, MainWindow) guiSetProperty(registerb, "NormalTextColour", "FFFFFFFF") labelm = guiCreateLabel(23, -62, 421, 63, "Heretrics Role Play", false, MainWindow) guiSetFont(labelm, "sa-gothic") guiLabelSetColor(labelm, 0, 45, 15) statel = guiCreateLabel(320, 200, 124, 32, "Pre-Alpha", false, MainWindow) guiLabelSetColor(statel, 113, 0, 0) guiSetVisible(MainWindow,true) --guiSetInputEnabled(true) showCursor(true) -- Save/load functions local usernamexml1, passwordxml1 = loadLoginFromXML() if not( usernamexml1 == "" or passwordxml1 == "") then guiCheckBoxSetSelected ( checkbox_save, true ) guiSetText ( user, tostring(usernamexml1)) guiSetText ( userpassword, tostring(passwordxml1)) else guiCheckBoxSetSelected ( checkbox_save, false ) guiSetText ( user, tostring(usernamexml1)) guiSetText ( userpassword, tostring(passwordxml1)) end addEventHandler("onClientGUIClick",loginb,onLoginClick) addEventHandler("onClientGUIClick",registerb,OnRegisterClick) end function start_cl_resource() open_log_reg_pannel() end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),start_cl_resource) ------------------------------------------------------------------------------------------------------ -- Save functions function loadLoginFromXML() local xml_save_log_File = xmlLoadFile ("files/xml/userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("files/xml/userdata.xml", "login") end local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if usernameNode and passwordNode then return xmlNodeGetValue(usernameNode), xmlNodeGetValue(passwordNode) else return "", "" end xmlUnloadFile ( xml_save_log_File ) end function saveLoginToXML(usernamexml, passwordxml) local xml_save_log_File = xmlLoadFile ("files/xml/userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("files/xml/userdata.xml", "login") end if (usernamexml ~= "") then local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) if not usernameNode then usernameNode = xmlCreateChild(xml_save_log_File, "username") end xmlNodeSetValue (usernameNode, tostring(usernamexml)) end if (passwordxml ~= "") then local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if not passwordNode then passwordNode = xmlCreateChild(xml_save_log_File, "password") end xmlNodeSetValue (passwordNode, tostring(passwordxml)) end xmlSaveFile(xml_save_log_File) xmlUnloadFile (xml_save_log_File) end addEvent("saveLoginToXML", true) addEventHandler("saveLoginToXML", getRootElement(), saveLoginToXML) function resetSaveXML() local xml_save_log_File = xmlLoadFile ("files/xml/userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("files/xml/userdata.xml", "login") end if (usernamexml ~= "") then local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) if not usernameNode then usernameNode = xmlCreateChild(xml_save_log_File, "username") end end if (passwordxml ~= "") then local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if not passwordNode then passwordNode = xmlCreateChild(xml_save_log_File, "password") end xmlNodeSetValue (passwordNode, "") end xmlSaveFile(xml_save_log_File) xmlUnloadFile (xml_save_log_File) end addEvent("resetSaveXML", true) addEventHandler("resetSaveXML", getRootElement(), resetSaveXML) ------------------------------------------------------------------------------------------------------ -- Login functions--------------------------------------------------- function onLoginClick(button,state) if(button == "left" and state == "up") then if (source == loginb) then username1 = guiGetText(user) password1 = guiGetText(userpassword) if guiCheckBoxGetSelected ( checkbox_save ) == true then checksave1 = true else checksave1 = false end triggerServerEvent("onRequestLogin",getLocalPlayer(),username1,password1,checksave1) end end end -- Register functions------------------------------------------------------------------------------------------------------ function OnRegisterClick(button,state) if(button == "left" and state == "up") then if (source == registerb) then username2 = guiGetText(user) password2 = guiGetText(userpassword) passwordConfirm2 = guiGetText(userpassword) triggerServerEvent("onRequestRegister",getLocalPlayer(),username2,password2,passwordConfirm2) end end end -- Error stuff--------------------------------------------------------------------------------------------------------- function Error_msg(Tab, Text) guiSetText(email, tostring(Text)) end addEvent("set_warning_text",true) addEventHandler("set_warning_text",getRootElement(),Error_msg) -- Hide the window------------------------------------------------------------------------------------------------------ function hideLoginWindow() guiSetInputEnabled(false) removeEventHandler("onClientGUIClick",loginb,onLoginClick) guiSetVisible(MainWindow, false) destroyElement(MainWindow) MainWindow = nil showCursor(false) end addEvent("hideLoginWindow", true) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) ------------------------------------------------------------------------------------------------------
  18. I've began work on new server and already ran into a small issue When using login panel I have made it creates the account but ignores already created accounts, and using the login panel account it ignores the acl. -- Using login panel // Account successfully created, and I can login through login panel User: Codyj Everything I put in ACL is ignored Pass: ////// -- Using chat // No account of this name exists, when using register it adds new account yet ignores old one. User: Codyj still am able to login to other one with login panel yet not though chat Pass: ////// logIn(source, account, password) ///// Login panel stuff addAccount(username,password) /login name password //// Chat stuff
  19. Some one actually contacted me with scripts from SAUS saying they needed them fixed, every script in the list had SAES copy write in it. In case you're wondering I deleted the scripts, and said no.
  20. Yes original server has been shut down, near the end of the year I'll be opening up a new one that'll be alot better.
  21. Ah ok I see what you mean, if you know how you can edit the files to allow them smoother transaction, and better looping.
  22. Yeh I've began a new project. That will not be at all rushed.
  23. Wiki. To answer few questions // Use wiki for more info // Assuming you are going to use dxDrawText or what not, first you need to find the players location X,Y on your screen, // getScreenFromWorldPosition // Then use dxDrawText ( Text Jah Want,X From getScreenFromWorldPosition,Y+ 5 from getScreenFromWorldPosition ) then you want to update every few secounds, or every frame //Not quite sure of function for that// And so on and so forth. Small example/// function drawsomething () X, Y = getScreenFromWorldPosition (0,0) text = dxDrawText (HERES 0, X, Y ) end setTimer ( drawsomething, 1000, 0 ) Now of course there's more to it, but basic stuff for your brain should help. Oh and for the arrrow, get a png picture, make background invisible and here's an easy one for you X,Y = getScreenFromWorldPosition (THEX,THEY+3,THEZ) Picture = dxCreateTexture("arrow.png") dxDrawImage (X,Y, Width,Hight, Picture) Then to make the text float above it text = dxDrawText (Text, X, Y+3 ) I hope you can understand this.
×
×
  • Create New...