-
Posts
141 -
Joined
-
Last visited
Everything posted by WolfPire
-
Hii! WolfPire over here again. So guys, today i'm bringing up a really curious case... Which consist in "setElementData" i'm kinda new to this function (As i've never used it before). And i would like you to please do me 2 big favors that would extend my LUA knowledge (as i'm not too experienced) 1. The Problem: Server function lockveh ( thePlayer ) pVehicle = getPedOccupiedVehicle ( thePlayer ) if isPedInVehicle (thePlayer) == true then if isVehicleLocked ( pVehicle ) then if getElementData ( thePlayer, "occupiedVehicle" ) then setVehicleLocked ( pVehicle, false ) outputChatBox ( "Your vehicle has been unlocked.", thePlayer, 0, 255, 0 ) else setVehicleLocked ( pVehicle, true ) outputChatBox ( "Your vehicle has been locked.", thePlayer, 255, 0, 0 ) end end end end function bindL() occupiedBy = getPlayerFromName(tostring(source)) bindKey ( source, "l", "down", lockveh ) setElementData( source, "occupiedVehicle", occupiedBy ) end addEventHandler ( "onPlayerVehicleEnter", root, bindL ) Apparently it wont work for some reason, or i got confused. (No errors in the debug nor console) ____________________________________ 2. If you can, can you explain me how "setElementData" and "getElementData" works? I get the idea, but i have no clue how it works or how to use it in a script. Thanks in advance, guys! =)
-
Thanks, that actually did the trick! Thanks guys =) You both are win =3
-
WARNING: Loading script failed: cotd/cotd_c.lua:8: ')' expected near 'kw2' I noticed something really new for me in that line.
-
excelent, Thanks... Now the other problem is that the Left and Right arrows will only let me rotate the car just 1 time.. and i don't know why >_<
-
So hey guys, WolfPire here again! =) I wanna clarify that... Yes, i'm making a server =) And i'll need as much help as i can! So i got a little problem with my script (which is not complete). 1. The GUI appears from everyone even tho' its client 2. The GUI will just let me update rotations once when pressing the buttons 3. It will also set everyone's camera to the defined matrix (which should only do this to the hitElement) Here's the script: CLIENT Shop = createColSphere( -1658, 1211, 8, 2) function ShopF(theElement) setCameraMatrix( -1664, 1210, 22, 0, 0, 0, 0, 0) CarOfTheDay = createVehicle( math.random(400,611), -1655, 1209, 22 ) RX, RY, RZ = getElementRotation(CarOfTheDay) showCursor(true) if (getVehicleType" class="kw2">getVehicleType(CarOfTheDay) == "Automobile") then setVehicleColor( CarOfTheDay, math.random(0,255), math.random(0,255), math.random(0,255) ) showPlayerHudComponent("all", false) LeftB = guiCreateButton(342,684,176,57,"< Left",false) guiSetFont(LeftB,"default-bold-small") RightB = guiCreateButton(737,684,176,57,"Right >",false) guiSetFont(RightB,"default-bold-small") ExitB = guiCreateButton(539,714,174,26,"Exit",false) guiSetFont(ExitB,"default-bold-small") BuyB = guiCreateButton(539,689,174,26,"Buy",false) guiSetFont(BuyB,"default-bold-small") addEventHandler("onClientGUIClick",LeftB,LeftFEnter) addEventHandler("onClientGUIClick",RightB,RightFEnter) addEventHandler("onClientGUIClick",BuyB,BuyF,false) addEventHandler("onClientGUIClick",ExitB,ExitF,false) else destroyElement(CarOfTheDay) CarOfTheDay = createVehicle( math.random(400,611), -1655, 1209, 22 ) end end addEventHandler("onClientColShapeHit",Shop,ShopF) function ExitF() destroyElement(LeftB) destroyElement(RightB) destroyElement(ExitB) destroyElement(BuyB) destroyElement(CarOfTheDay) showPlayerHudComponent("all", true) setCameraTarget(localPlayer) showCursor(false) end function LeftFEnter() setElementRotation(CarOfTheDay, RX, RY, RZ + 10) end function RightFEnter() setElementRotation(CarOfTheDay, RX, RY, RZ - 10) end function BuyF() CW = guiCreateWindow(470,244,543,180,"Confirmation",false) CL = guiCreateLabel(2,47,545,20,"Are you sure you want to buy this car for $3.000?",false,CW) guiLabelSetColor(CL,0,255,0) guiLabelSetHorizontalAlign(CL,"center",false) guiSetFont(CL,"default-bold-small") YesB = guiCreateButton(59,115,159,39,"Yes",false,CW) NoB = guiCreateButton(322,115,159,39,"No",false,CW) addEventHandler("onClientGUIClick",NoB,NoF,false) addEventHandler("onClientGUIClick",YesB,YesF,false) end function NoF() destroyElement(CW) end function YesF() Model = getElementModel(CarOfTheDay) Up = getVehicleUpgrades ( CarOfTheDay ) triggerServerEvent("spawnCar",getRootElement(),localPlayer, Model) showCursor(false) end Server (I know it's wrong, but ill fix that later, what i wanna center on right now is the GUI problem) addEvent("spawnCar",true) addEventHandler("spawnCar",root, function(localPlayer, Model, Up) YourVehicle = createVehicle(getElementModel(Model), -1643, 1219, 7) addVehicleUpgrade(YourVehicle, Up) warpPedIntoVehicle(localPlayer, YourVehicle) end ) If you guys could please help me, it would be awesome! =)
-
You solved my life in 1 life lol Nice job, solid =) Once again, thank you! You are amazing =)
-
So, hello guys, once again! This is WolfPire here, and i'm making a script that consist on giving the player a certain ammount of money depending in which part of the body this player kills the other player! So... For some reason it doesn't work... Can you guys please help me? (No errors in debug nor console) CLIENT function getWhere( killer ) if source == "player" then if getBodyPartName ( bodyPartID ) == 3 then triggerServerEvent("hitonTorso", root, killer ) else if getBodyPartName ( bodyPartID ) == 4 then triggerServerEvent("hitonAss", root, killer ) else if getBodyPartName ( bodyPartID ) == 5 then triggerServerEvent("hitonRightArm", root, killer ) else if getBodyPartName ( bodyPartID ) == 6 then triggerServerEvent("hitonLeftArm", root, killer ) else if getBodyPartName ( bodyPartID ) == 7 then triggerServerEvent("hitonRightLeg", root, killer ) else if getBodyPartName ( bodyPartID ) == 8 then triggerServerEvent("hitonLeftLeg", root, killer ) else if getBodyPartName ( bodyPartID ) == 9 then triggerServerEvent("hitonHead", root, killer ) end end end end end end end end end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), getWhere ) SERVER addEvent("hitonTorso", true) addEventHandler("hitonTorso",root, function( killer ) givePlayerMoney ( killer, 500 ) end ) addEvent("hitonAss", true) addEventHandler("hitonLeftArm",root, function( killer ) givePlayerMoney ( killer, 100 ) end ) addEvent("hitonLefttArm", true) addEventHandler("hitonLeftArm",root, function( killer ) givePlayerMoney ( killer, 100 ) end ) addEvent("hitonRightArm", true) addEventHandler("hitonRightArm",root, function( killer ) givePlayerMoney ( killer, 100 ) end ) addEvent("hitonLeftLeg", true) addEventHandler("hitonLeftArm",root, function( killer ) givePlayerMoney ( killer, 100 ) end ) addEvent("hitonRightLeg", true) addEventHandler("hitonRightArm",root, function( killer ) givePlayerMoney ( killer, 100 ) end ) addEvent("hitonHead", true) addEventHandler("hitonHead",root, function( killer ) givePlayerMoney ( killer, 1000 ) end ) If you guys could please help me once again, you would be getting this little guy out of a big whole =) Thanks in advance! =)
-
Thank you very much, this worked! Thanks everyone for your help! =)
-
Works like charm =) But you forgot to add "theElement" @ the function. But thanks guys. If i have any other issue. I'll let you know! =) Edit: Now whenever i press "Heal". The sscript sends me an error "attempt to compare number with nil" Here's the code: HospitalSF = createColSphere(-2654, 639, 15, 1) HospitalLV = createColSphere(1608, 1817, 11, 1) HospitalFC = createColSphere(-320, 1051, 21, 1) HospitalM = createColSphere(1243, 329, 20, 1) HospitalLS1 = createColSphere(2035, -1404, 18, 1) HospitalLS2 = createColSphere(1174, -1323, 16, 1) function Exit() destroyElement(HospitalW) setTimer(fadeCamera,1000,1,true,1) showCursor(false) end addEventHandler("onClientColShapeHit",root, function(theElement) if source == HospitalSF or HospitalLV or HospitalFC or HospitalM or HospitalLS1 or HospitalLS2 then if theElement == localPlayer then setTimer(fadeCamera,50,1,false,1,0,0,0) showCursor(true) Name = getPlayerName(localPlayer) Money = getPlayerMoney(localPlayer) Skin = getElementModel(localPlayer) HospitalW = guiCreateWindow(291,266,551,269,"Hospital",false) Name = guiCreateLabel(24,28,128,18,"Name: "..Name.."",false,HospitalW) Currency = guiCreateLabel(24,52,121,18,"Currency: "..Money.."",false,HospitalW) Skin = guiCreateLabel(24,75,113,18,"Skin(ID): "..Skin.."",false,HospitalW) Bar = guiCreateScrollBar(74,146,361,22,true,false,HospitalW) FeeL = guiCreateLabel(91,123,85,18,"Fee: "..tostring( fee ) .."",false,HospitalW) HPL = guiCreateLabel(371,123,85,18,"HP: "..tostring( getElementHealth( localPlayer ) ) .."",false,HospitalW) ExitB = guiCreateButton(237,219,81,35,"Exit",false,HospitalW) HealB = guiCreateButton(441,144,101,26,"Heal",false,HospitalW) Img = guiCreateStaticImage(148,33,251,93,"Hospilogo.png",false,HospitalW) addEventHandler("onClientGUIClick",HealB,Heal,false) addEventHandler("onClientGUIClick",ExitB,Exit,false) end end end ) function getBarPos() if Bar and isElement( FeeL ) then local fee = guiScrollBarGetScrollPosition(Bar) guiSetText( FeeL,"Fee: ".. tostring( fee ) ) end end addEventHandler( "onClientRender",root,getBarPos ) function Heal() if (Money < fee) then outputChatBox("You aint got the greens") else local fee = guiScrollBarGetScrollPosition(Bar) triggerServerEvent("takeMoney",getRootElement(),fee) setElementHealth(localPlayer, getElementHealth(localPlayer) + fee) outputChatBox("Recovered ".. fee .."% of HP!") end end Edit 2: Also, the hospital script merged with all the scripts! Whenever i step on any colshape, the GUI pops up, may i get some help on this please?
-
Sorry for not replying, i fell asleep. Just tested it this morning. I still got the same error >.< Edit: The error is: "WARNING: Hospital/h_c:49: Bad argument @ 'guiSetText' [Expected gui-element at argument 1, got nil]" also discovered another error... "ERROR: Hospital/h_c:36: attempt to concatenate global 'fee' (a nil value)" I have 2 thoughts... Maybe it's the label and if its not... I might be sure it's something with this function.
-
Thanks, once again =)
-
So... I'm trying to create an hospital, but i can't seem to change the text of the Fee. I get a "nil" value somehow. Check the code out and help me if you can please. HospitalSF = createColSphere(-2654, 639, 15, 1) HospitalLV = createColSphere(1608, 1817, 11, 1) HospitalFC = createColSphere(-320, 1051, 21, 1) HospitalM = createColSphere(1243, 329, 20, 1) HospitalLS1 = createColSphere(2035, -1404, 18, 1) HospitalLS2 = createColSphere(1174, -1323, 16, 1) function Heal() if Money < fee then outputChatBox("You aint got the greens") else Fee = guiScrollBarGetScrollPosition(Bar) triggerServerEvent("takeMoney",getRootElement(),fee) setElementHealth(localPlayer, getElementHealth(localPlayer) + fee) outputChatBox("Recovered"..fee.."% of HP!") end end function Exit() destroyElement(HospitalW) setTimer(fadeCamera,1000,1,false,1,0,0,0) end addEventHandler("onClientColShapeHit",getRootElement(), function() if source == HospitalSF or HospitalLV or HospitalFC or HospitalM or HospitalLS1 or HospitalLS2 then setTimer(fadeCamera,1000,1,true,1) Name = getPlayerName(localPlayer) Money = getPlayerMoney(localPlayer) Skin = getElementModel(localPlayer) HospitalW = guiCreateWindow(291,266,551,269,"Hospital",false) Name = guiCreateLabel(24,28,128,18,"Name: "..Name.."",false,HospitalW) Currency = guiCreateLabel(24,52,121,18,"Currency: "..Money.."",false,HospitalW) Skin = guiCreateLabel(24,75,113,18,"Skin(ID): "..Skin.."",false,HospitalW) Bar = guiCreateScrollBar(74,146,361,22,true,false,HospitalW) HPL = guiCreateLabel(91,123,85,18,"HP: "..fee.."",false,HospitalW) ExitB = guiCreateButton(237,219,81,35,"Exit",false,HospitalW) HealB = guiCreateButton(441,144,101,26,"Heal",false,HospitalW) Img = guiCreateStaticImage(148,33,251,93,"Hospilogo.png",false,HospitalW) addEventHandler("onClientGUIClick",HealB,Heal,false) addEventHandler("onClientGUIClick",ExitB,Exit,false) end end ) function getBarPos() if Bar then fee = guiScrollBarGetScrollPosition(Bar) guiSetText(HPL,"Fee: "..fee.."") -- This is the problem. end end addEventHandler("onClientRender",getRootElement(),getBarPos) If you guys could help me once again, i would be really grateful for your help =) - WolfPire
-
Thank you =) Quite a newbish mistake from my part! Edit: My bad buddy... But can you give me one last hand? I'm getting an error from the 2 event handlers. "WARNING: en2/en_c.lua:18: Bad argument @ 'addEventHandler' [Expected function at argument 3, got nil]" "WARNING: en2/en_c.lua:19: Bad argument @ 'addEventHandler' [Expected function at argument 3, got nil]" Edit 2: Fixed, just had to move those event handlers to the final of the script (After the functions)
-
So, hello, it's me again. I fixed my problem thanks to an user =) But another problem came in... Here's the problem... Whenever someone clicks in any part of the GUI (Which is not the buttons), the GUI gets duplicated. And i have found no ways yet to find a solution to this... sWidth,sHeight = guiGetScreenSize() function onJoin() showCursor(true) LoginW = guiCreateWindow(sWidth/3.3,sHeight/3.3,500,300,"Oriental Night Gaming - Login",false) NameL = guiCreateLabel(28,139,35,15,"Name:",false,LoginW) guiSetFont(NameL,"default-bold-small") PassL = guiCreateLabel(18,180,56,15,"Password:",false,LoginW) guiSetFont(PassL,"default-bold-small") NameED = guiCreateEdit(78,132,233,31,"",false,LoginW) PassED = guiCreateEdit(80,174,233,31,"",false,LoginW) SepAD = guiCreateLabel(335,24,5,276,"|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n",false,LoginW) LoginB = guiCreateButton(23,244,120,32,"Login",false,LoginW) RegisterB = guiCreateButton(192,244,120,32,"Register",false,LoginW) AD = guiCreateStaticImage(339,23,168,278,"images/AD.jpg",false,LoginW) Logo = guiCreateStaticImage(9,27,322,88,"images/Logo.jpg",false,LoginW) Name = guiGetText(NameED) Pass = guiGetText(PassED) addEventHandler("onClientGUIClick",RegisterB,RegisterC) addEventHandler("onClientGUIClick",LoginB,LoginE) end addEventHandler("onClientResourceStart",getRootElement(),onJoin) function RegisterC() destroyElement(LoginW) RegisterW = guiCreateWindow(sWidth/3.3,sHeight/3.3,500,300,"Oriental Night Gaming - Register",false) NameLR = guiCreateLabel(28,77,35,15,"Name:",false,RegisterW) guiSetFont(NameLR,"default-bold-small") PassLR = guiCreateLabel(14,120,56,15,"Password:",false,RegisterW) guiSetFont(PassLR,"default-bold-small") NameEDR = guiCreateEdit(78,69,233,31,"",false,RegisterW) PassEDR = guiCreateEdit(80,111,233,31,"",false,RegisterW) SepADR = guiCreateLabel(335,24,5,276,"|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n",false,RegisterW) BackB = guiCreateButton(23,244,120,32,"Back",false,RegisterW) RegisterBR = guiCreateButton(192,244,120,32,"Register",false,RegisterW) ConfEDR = guiCreateEdit(80,154,233,31,"",false,RegisterW) ConfLR = guiCreateLabel(18,163,56,15,"Confirm:",false,RegisterW) guiSetFont(ConfLR,"default-bold-small") AD = guiCreateStaticImage(339,23,168,278,"images/AD.jpg",false,RegisterW) NameR = guiGetText(NameEDR) PassR = guiGetText(PassEDR) addEventHandler("onClientGUIClick",BackB,LoginC) addEventHandler("onClientGUIClick",RegisterBR,RegisterE) end function LoginC() destroyElement(RegisterW) LoginW = guiCreateWindow(sWidth/3.3,sHeight/3.3,500,300,"Oriental Night Gaming - Login",false) NameL = guiCreateLabel(28,139,35,15,"Name:",false,LoginW) guiSetFont(NameL,"default-bold-small") PassL = guiCreateLabel(18,180,56,15,"Password:",false,LoginW) guiSetFont(PassL,"default-bold-small") NameED = guiCreateEdit(78,132,233,31,"",false,LoginW) PassED = guiCreateEdit(80,174,233,31,"",false,LoginW) SepAD = guiCreateLabel(335,24,5,276,"|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n",false,LoginW) LoginB = guiCreateButton(23,244,120,32,"Login",false,LoginW) RegisterB = guiCreateButton(192,244,120,32,"Register",false,LoginW) AD = guiCreateStaticImage(339,23,168,278,"images/AD.jpg",false,LoginW) Logo = guiCreateStaticImage(9,27,322,88,"images/Logo.jpg",false,LoginW) addEventHandler("onClientGUIClick",RegisterB,RegisterC) addEventHandler("onClientGUIClick",LoginB,LoginE) end function LoginE() local Name = guiGetText(NameED) local Pass = guiGetText(PassED) triggerServerEvent("login",localPlayer,localPlayer,Name,Pass) end function RegisterE() local NameR = guiGetText(NameEDR) local PassR = guiGetText(PassEDR) local Confirm = guiGetText(ConfEDR) triggerServerEvent("register",localPlayer,localPlayer,NameR,PassR,Confirm) end addEvent("agree",true) addEventHandler("agree",getRootElement(), function() destroyElement(LoginW) WelcomeW = guiCreateWindow(0.2188,0.1325,0.5445,0.7725,"Oriental Night Game - Agreement",true) guiWindowSetMovable(WelcomeW,false) guiWindowSetSizable(WelcomeW,false) EngL = guiCreateLabel(18,31,41,16,"English:",false,WelcomeW) MemoEng = guiCreateMemo(20,54,653,224,"Thank you for joining \"Oriental Night Gaming\"!\n\nThis is a server in development and it's just starting, so please be patient while we complete the development and add all the new functions and resources that will make this server a better one!\n\nFor now, please enjoy our Freeroam play, but follow these rules:\n\n1. Do not kill players while using a Jetpack\n2. You are not allowed to kill a player while you're in a vehicle and the player you want to kill is on foot (Get off the vehicle and kill it)\n3. Absolutely NO SPAWN KILLING, if they spawn, let them spawn normally, do not camp them or the present admin will ban you permanently.\n4. No HeliKill (Do not kill with the chopper razors) NOTE: The vehicle weapons have been disabled.\n5. Do not disrespect admins! (If the admin disrespects you, report it!)\n6. No admin impresionation! (Do not copy their names, if they are admins, they will do an admin function or appear in a team)\n7. No Ramming (Do not step on people with a car)\n_______________________________________________\n\nThis is the Member List so far:\n\n- WolfPire\n- Cross\n- MoonLight\n- Toxiccastle\n- Land\n\nDo not accept copy's!\n_______________________________________________\n\nThat's all! Accept if you agree and enjoy our server! =)",false,WelcomeW) guiMemoSetReadOnly(MemoEng,true) MemoEsp = guiCreateMemo(20,334,653,224,"Gracias por entrar a \"Oriental Night Gaming\"!\n\nEste servidor esta en desarrollo y solo esta empezando, asi que por favor se paciente mientras completamos el desarrollo y anadimos todas las nuevas funciones y recursos que haran de este server uno mejor!\n\nPor ahora, disfruta de nuestro juego Freeroam, pero sigue estas reglas:\n\n1. No mates a otros jugadores mientras usas un Jetpack\n2. No tienes permitido matar a otro jugador mientras estas en un auto y el otro jugador a pie (Salte del auto y matalo)\n3. Absolutamente NO MATAR GENTE DONDE APARECEN, si aparecen, dejalos aparecer normalmente, no los esperes o el admin presente te baneara permanentemente.\n4. No matar con el helicoptero (No los mates con las aspas de el helicoptero) NOTA: Las armas de los vehiculos estan desactivadas.\n5. No le faltes el respeto a los admins! (Si el admin te falta el respeto, reportalo!)\n6. No falsifiques a un admin! (No copies sus nombres, si ellos son admins, ellos haran alguna funcion admin o apareceran en algun equipo)\n7. No pises a los demas (No los pises con un auto)\n\n_______________________________________________\n\nEsta es la Lista de Miembros hasta ahora:\n\n- WolfPire\n- Cross\n- MoonLight\n- Toxiccastle\n- Land\n\nNo aceptes copias!\n_______________________________________________\n\nEso es todo! Acepta nuetras reglas si estas de acuerdo y disfruta nuestro server! =)",false,WelcomeW) guiMemoSetReadOnly(MemoEsp,true) Line = guiCreateLabel(21,278,654,20,"______________________________________________________________________________________________________________",false,WelcomeW) guiLabelSetColor(Line,0,255,0) EspL = guiCreateLabel(18,303,44,16,"Espanol:",false,WelcomeW) AcceptB = guiCreateButton(24,568,220,36,"Accept / Aceptar",false,WelcomeW) addEventHandler("onClientGUIClick",AcceptB,AcceptC) end ) function AcceptC() destroyElement(WelcomeW) showCursor(false) end That's the code, if you could please help me, i would me more than grateful =) Thanks for reading ^^
-
Wow! Thank you very much! =) I owe you one! _________
-
Hi, my name is WolfPire. I got a little problem that i would like to solve. If you guys could help me, i would really appreciate it. So, i'm creating a login system. But i got a problem. Here are the LUA files: (Dont worry about permissions i sorted that out already) Client sWidth,sHeight = guiGetScreenSize() function onJoin() showCursor(true) LoginW = guiCreateWindow(sWidth/3.3,sHeight/3.3,500,300,"Oriental Night Gaming - Login",false) NameL = guiCreateLabel(28,139,35,15,"Name:",false,LoginW) guiSetFont(NameL,"default-bold-small") PassL = guiCreateLabel(18,180,56,15,"Password:",false,LoginW) guiSetFont(PassL,"default-bold-small") NameED = guiCreateEdit(78,132,233,31,"",false,LoginW) PassED = guiCreateEdit(80,174,233,31,"",false,LoginW) SepAD = guiCreateLabel(335,24,5,276,"|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n",false,LoginW) LoginB = guiCreateButton(23,244,120,32,"Login",false,LoginW) RegisterB = guiCreateButton(192,244,120,32,"Register",false,LoginW) Name = guiGetText(NameED) Pass = guiGetText(PassED) addEventHandler("onClientGUIClick",RegisterB,RegisterC) addEventHandler("onClientGUIClick",LoginB,LoginE) end addEventHandler("onClientResourceStart",getRootElement(),onJoin) function RegisterC() destroyElement(LoginW) RegisterW = guiCreateWindow(sWidth/3.3,sHeight/3.3,500,300,"Oriental Night Gaming - Register",false) NameLR = guiCreateLabel(28,77,35,15,"Name:",false,RegisterW) guiSetFont(NameLR,"default-bold-small") PassLR = guiCreateLabel(14,120,56,15,"Password:",false,RegisterW) guiSetFont(PassLR,"default-bold-small") NameEDR = guiCreateEdit(78,69,233,31,"",false,RegisterW) PassEDR = guiCreateEdit(80,111,233,31,"",false,RegisterW) SepADR = guiCreateLabel(335,24,5,276,"|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n",false,RegisterW) BackB = guiCreateButton(23,244,120,32,"Back",false,RegisterW) RegisterBR = guiCreateButton(192,244,120,32,"Register",false,RegisterW) ConfEDR = guiCreateEdit(80,154,233,31,"",false,RegisterW) ConfLR = guiCreateLabel(18,163,56,15,"Confirm:",false,RegisterW) guiSetFont(ConfLR,"default-bold-small") NameR = guiGetText(NameEDR) PassR = guiGetText(PassEDR) addEventHandler("onClientGUIClick",BackB,LoginC) addEventHandler("onClientGUIClick",RegisterBR,RegisterE) end function LoginC() destroyElement(RegisterW) LoginW = guiCreateWindow(sWidth/3.3,sHeight/3.3,500,300,"Oriental Night Gaming - Login",false) NameL = guiCreateLabel(28,139,35,15,"Name:",false,LoginW) guiSetFont(NameL,"default-bold-small") PassL = guiCreateLabel(18,180,56,15,"Password:",false,LoginW) guiSetFont(PassL,"default-bold-small") NameED = guiCreateEdit(78,132,233,31,"",false,LoginW) PassED = guiCreateEdit(80,174,233,31,"",false,LoginW) SepAD = guiCreateLabel(335,24,5,276,"|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n",false,LoginW) LoginB = guiCreateButton(23,244,120,32,"Login",false,LoginW) RegisterB = guiCreateButton(192,244,120,32,"Register",false,LoginW) addEventHandler("onClientGUIClick",RegisterB,RegisterC) addEventHandler("onClientGUIClick",LoginB,LoginE) end function LoginE() LP = getLocalPlayer() Name = guiGetText(NameED) Pass = guiGetText(PassED) triggerServerEvent("login",getRootElement(),LP,Name,Pass) end function RegisterE() NameR = guiGetText(NameEDR) PassR = guiGetText(PassEDR) triggerServerEvent("register",getRootElement(),NameR,PassR,Confirm) end addEvent("agree",true) addEventHandler("agree",getRootElement(), function() destroyElement(LoginW) WelcomeW = guiCreateWindow(0.2188,0.1325,0.5445,0.7725,"Oriental Night Game - Agreement",true) guiWindowSetMovable(WelcomeW,false) guiWindowSetSizable(WelcomeW,false) EngL = guiCreateLabel(18,31,41,16,"English:",false,WelcomeW) MemoEng = guiCreateMemo(20,54,653,224,"Thank you for joining \"Oriental Night Gaming\"!\n\nThis is a server in development and it's just starting, so please be patient while we complete the development and add all the new functions and resources that will make this server a better one!\n\nFor now, please enjoy our Freeroam play, but follow these rules:\n\n1. Do not kill players while using a Jetpack\n2. You are not allowed to kill a player while you're in a vehicle and the player you want to kill is on foot (Get off the vehicle and kill it)\n3. Absolutely NO SPAWN KILLING, if they spawn, let them spawn normally, do not camp them or the present admin will ban you permanently.\n4. No HeliKill (Do not kill with the chopper razors) NOTE: The vehicle weapons have been disabled.\n5. Do not disrespect admins! (If the admin disrespects you, report it!)\n6. No admin impresionation! (Do not copy their names, if they are admins, they will do an admin function or appear in a team)\n7. No Ramming (Do not step on people with a car)\n_______________________________________________\n\nThis is the Member List so far:\n\n- WolfPire\n- Cross\n- MoonLight\n- Toxiccastle\n- Land\n\nDo not accept copy's!\n_______________________________________________\n\nThat's all! Accept if you agree and enjoy our server! =)",false,WelcomeW) guiMemoSetReadOnly(MemoEng,true) MemoEsp = guiCreateMemo(20,334,653,224,"Gracias por entrar a \"Oriental Night Gaming\"!\n\nEste servidor esta en desarrollo y solo esta empezando, asi que por favor se paciente mientras completamos el desarrollo y anadimos todas las nuevas funciones y recursos que haran de este server uno mejor!\n\nPor ahora, disfruta de nuestro juego Freeroam, pero sigue estas reglas:\n\n1. No mates a otros jugadores mientras usas un Jetpack\n2. No tienes permitido matar a otro jugador mientras estas en un auto y el otro jugador a pie (Salte del auto y matalo)\n3. Absolutamente NO MATAR GENTE DONDE APARECEN, si aparecen, dejalos aparecer normalmente, no los esperes o el admin presente te baneara permanentemente.\n4. No matar con el helicoptero (No los mates con las aspas de el helicoptero) NOTA: Las armas de los vehiculos estan desactivadas.\n5. No le faltes el respeto a los admins! (Si el admin te falta el respeto, reportalo!)\n6. No falsifiques a un admin! (No copies sus nombres, si ellos son admins, ellos haran alguna funcion admin o apareceran en algun equipo)\n7. No pises a los demas (No los pises con un auto)\n\n_______________________________________________\n\nEsta es la Lista de Miembros hasta ahora:\n\n- WolfPire\n- Cross\n- MoonLight\n- Toxiccastle\n- Land\n\nNo aceptes copias!\n_______________________________________________\n\nEso es todo! Acepta nuetras reglas si estas de acuerdo y disfruta nuestro server! =)",false,WelcomeW) guiMemoSetReadOnly(MemoEsp,true) Line = guiCreateLabel(21,278,654,20,"______________________________________________________________________________________________________________",false,WelcomeW) guiLabelSetColor(Line,0,255,0) EspL = guiCreateLabel(18,303,44,16,"Espanol:",false,WelcomeW) AcceptB = guiCreateButton(24,568,220,36,"Accept / Aceptar",false,WelcomeW) addEventHandler("onClientGUIClick",AcceptB,AcceptC) end ) function AcceptC() destroyElement(WelcomeW) showCursor(false) end ________________________________________________________________________________________________________ Server addEvent("login",true) addEventHandler("login",getRootElement(), function(thePlayer, Name, Pass) local account = getAccount ( Name , Pass) if ( account ~= false ) then -- If the account exists. logIn ( thePlayer, account, Pass ) outputChatBox ( "Successfully Logged in! Welcome to Oriental Night Gaming!", thePlayer, 0, 255, 0 ) spawnPlayer(thePlayer,2175.8217773438,1285.7143554688,42.224067687988,0,math.random(0,288),0,0) fadeCamera (thePlayer, true) setCameraTarget (thePlayer, thePlayer) triggerClientEvent("agree",getRootElement()) else outputChatBox ( "ERROR: Wrong username or password!", thePlayer, 255, 0, 0 ) -- Output they got the details wrong. end end ) addEvent("register",true) addEventHandler("register",getRootElement(), function(thePlayer, NameR, PassR, Confirm) if not (NameR == "") then if not (PassR == "") then if not (Confirm == "") then if PassR == Confirm then local account = getAccount (NameR,PassR) if (account == false) then local accountAdded = addAccount(tostring(NameR),tostring(PassR)) if (accountAdded) then outputChatBox ("You've successfully registred! [Name:" .. NameR .. "| Password:" .. PassR .. "]",thePlayer,0,255,0,true ) setTimer(outputChatBox,800,1,"Try to login now! Remember this information to login!",thePlayer,0,255,0,true ) else outputChatBox ("ERROR: Please use another Name/Password.",thePlayer,255,0,0,true) end else outputChatBox ("ERROR: A player with that name already exist.",thePlayer,255,0,0,true) end else outputChatBox ("ERROR: The passwords don't match.",thePlayer,255,0,0,true) end else outputChatBox ("ERROR: Please confirm your password.",thePlayer,255,0,0,true) end else outputChatBox ("ERROR: Please put a password.",thePlayer,255,0,0,true) end else outputChatBox ("ERROR: Please put a name.",thePlayer,255,0,0,true) end end ) function onDeath() setTimer(spawnPlayer,5000,1,source,2175.8217773438,1285.7143554688,42.224067687988,0,math.random(0,288),0,0) end addEventHandler("onPlayerWasted",getRootElement(),onDeath) The problem in the server resides in the "register" event... I can't get it to work.. i put my username, password and confirm but nothing pops up and at the second time, it says that the user already exist! "ERROR: en2/en_s.lua:29: attempt to concatenate local 'PassR' (a nil value)"