Jump to content

Charlie_Jefferson

Members
  • Posts

    242
  • Joined

  • Last visited

Everything posted by Charlie_Jefferson

  1. It's easy to make, but we don't take requests. Make a sample script of it, then give us the error(s) and the script you got and we will fix that, but don't request.
  2. LUA is by far the easiest language out there.If you know any other no problems learning lua at all. Actually, HTML is the easiest language out there, then comes lua.
  3. Made this: function hoodOpen( thePlayer ) local vehicle = getPedOccupiedVehicle( thePlayer ) if vehicle then hood = setVehicleDoorOpenRatio(vehicle, 0, 1, 3000) else return end if hood then setVehicleDoorOpenRatio(vehicle, 0, 0, 3000) else return end end addCommandHandler("hood", hoodOpen) function trunkOpen( thePlayer ) local vehicle = getPedOccupiedVehicle( thePlayer ) if vehicle then trunk = setVehicleDoorOpenRatio(vehicle, 1, 1, 3000) else return end if trunk then setVehicleDoorOpenRatio(vehicle, 1, 0, 3000) else return end end addCommandHandler("trunk", hoodOpen) function fLeftOpen( thePlayer ) local vehicle = getPedOccupiedVehicle( thePlayer ) if vehicle then fLeft = setVehicleDoorOpenRatio(vehicle, 2, 1, 3000) else return end if fLeft then setVehicleDoorOpenRatio(vehicle, 2, 0, 3000) else return end end addCommandHandler("fleft", hoodOpen) function fRightOpen( thePlayer ) local vehicle = getPedOccupiedVehicle( thePlayer ) if vehicle then fRight = setVehicleDoorOpenRatio(vehicle, 3, 1, 3000) else return end if fRight then setVehicleDoorOpenRatio(vehicle, 3, 0, 3000) else return end end addCommandHandler("fright", hoodOpen) function rLeftOpen( thePlayer ) local vehicle = getPedOccupiedVehicle( thePlayer ) if vehicle then rLeft = setVehicleDoorOpenRatio(vehicle, 4, 1, 3000) else return end if rLeft then setVehicleDoorOpenRatio(vehicle, 4, 0, 3000) else return end end addCommandHandler("rleft", hoodOpen) function rRightOpen( thePlayer ) local vehicle = getPedOccupiedVehicle( thePlayer ) if vehicle then rRight = setVehicleDoorOpenRatio(vehicle, 5, 1, 3000) else return end if rRight then setVehicleDoorOpenRatio(vehicle, 5, 0, 3000) else return end end addCommandHandler("rright", hoodOpen) I run it, I try writing a command, nothing happens. No error either. The meta is set to server. This function is server and client. <meta> <info author="Charlie" type="script" description="Car Parts Movement"/> <script src="carparts.lua" type="client"/> </meta>
  4. There's a lot of functions which are mixed. That means you have a lot of client-side and server-side functions in 1 lua. You must organize them into 2 lua. 1 lua should be server wide and the second one is client. The GUI stuff is client-side only. getServerName is server-side only, XML stuff is server-side and client-side too. Try using the wiki to solve it.
  5. What errors do you get?
  6. Thanks. Finally someone understands. Haven't tried it yet though. I will soon.
  7. It saves the .xml file with the username and password into MY PC. Like a database, but in a .xml file... Why is it so hard to understand? >.>
  8. I'll say it clearly: this IS a login system made by me. I'm trying to make the "Register" and "Login" buttons work. I made a GUI which has two edit boxes: Username and Password. You write your username and password in those two boxes and press register. The register button send the username and password to the .xml file, which stores them. I need to make it so that if the username and password are in the .xml file, you can login. That's ALL.
  9. Then how does the register button help? I think that the register button should be saveToXML and login would be the loadFromXML.
  10. Right. Now... How do I make it so that the player logins, when he clicks on a login button which I'll create? The loadlogin thing should be the login function. And if the username and password are entered correctly, the player should login into his account and some other GUI, which I'll make later will be shown and he can select and do stuff. No point in going further. Just help.
  11. Also, for some reason, the camera matrix setting and the fade camera and the show cursor don't work. I did add source, true and the coords needed to them, but they just won't work.
  12. Actually this is my basic login GUI. What you do is write your username and password on the GUI edits, click register, which saves your username and account into my account list(accl.xml) and then, you login. I'm trying to make it search the username and password, when you input something into the edits and click login and if the username and password exist, then it logs you in. THAT'S ALL. And I'm stuck on ONE BIT of problem. How do I make the script search the accl.xml. If you can help me with that, you are so helpful and you will be the most epic person in the world. Sorry for exaggerating, I just want my script to work ;P.
  13. ... I need the accl.xml so I can store usernames and passwords and so that the player can login. Are you making fun of me?
  14. I want to store them, with the register button and check if they are true and if they are, then login the player with the login button.
  15. Then where do I store them and how do I get them? >.>
  16. So it can get the username and password from it and check if they exist.
  17. Hai, I'm tryina' make a login system. No idea how to say that if username and password are in a .xml file, then login. This is the code cut into a piece. I've got the usern and passw defined and they are added when registered. Or should be. Didn't test it yet. function login( thePlayer, command, username, password ) load = xmlLoadFile ( "accl.xml" ) child = xmlFindChild ( group, "user", 0 ) if (usern and passw == load) then menu else label[2] = guiCreateLabel(insertcoordshere, "Please type a correct username/password!") setTimer(label[2], 5000, 3) end end And this is the whole code: showCursor(true) fadeCamera(true) setCameraMatrix(insertCityHall/PDcoordshere) user = guiCreateEdit(insertcoordshere) pass = guiCreateEdit(insertcoordshere) register = guiCreateButton(insertcoordshere) login = guiCreateButton(insertcoordshere) addEventHandler( "onClientGUIClick", register, register ) addEventHandler( "onClientGUIClick", login, login ) function register() local usern = guiGetText( user ) local passw = guiGetText( pass ) if (username>3 or password>3) then label[1] = guiCreateLalbel(insertcoordshere, "Please write a longer username/password!") setTimer(label[1], 5000, 3) else xmlLoad = xmlLoadFile ( "accl.xml" ) end if xmlRootTree then xmlNodeSetValue ( "user", usern, passw ) else return end end function login( thePlayer, command, username, password ) load = xmlLoadFile ( "accl.xml" ) child = xmlFindChild ( group, "user", 0 ) if (usern and passw == load) then menu else label[2] = guiCreateLabel(insertcoordshere,"Please type a correct username/password!") setTimer(label[2], 5000, 3) end end Note: where it's written "insertcoordshere" or anything to do with that, it means I will write the coordinates later.
  18. g_base_col = createColCuboid ( 3109.0913085938, -842.58416748047, 28.436388015747, 250, 280, 20 ) function hit ( pla, dim, thePlayer ) if isObjectInACLGroup ( "user." .. thePlayer, aclGetGroup ( "Admin" ) ) then getElementType ( pla ) == "player" local vehicle = getPedOccupiedVehicle ( pla ) if vehicle or not vehicle then localPlayerName = getPlayerName(getLocalPlayer()) outputChatBox ( "Welcome to the admin base,"..localPlayerName ) else setElementData ( pla, "inArea", "true" ) triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) outputChatBox ( "You must be part of the staff to enter", pla, 255, 0, 0 ) end end end addEventHandler ( "onColShapeHit", g_base_col, hit ) function leave ( pla, dim ) if getElementType ( pla ) == "player" then local vehicle = getPedOccupiedVehicle ( pla ) if vehicle or not vehicle then outputChatBox ( "Good Bye!", pla, 0, 250, 0 ) else setElementData ( pla, "inRestrictedArea", "false" ) triggerClientEvent ( pla, "destroyTimers", g_root, pla ) outputDebugString ( "*"..getPlayername(pla).." has left col shape" ) end end end end addEventHandler ( "onColShapeLeave", g_base_col, leave )
×
×
  • Create New...