Jump to content

Oxsotus

Members
  • Posts

    39
  • Joined

  • Last visited

Everything posted by Oxsotus

  1. Solved... There isn't "end" at the client_want_register function
  2. Hi everybody! I wrote today a login/register resource. It works perfect, and, now it doesn't works, I don't know why. I want to colored the outputChatBox messages, so I rewrite these. And it doesn't works, doesn't start the function. I wrote it back, and no Here's my code: function createLoginWindow() local screenX, screenY = guiGetScreenSize() logreg_window = guiCreateWindow ( 10, screenY/2, 200, 300, "Lépj be, vagy regisztrálj!", false ) local tabPanel = guiCreateTabPanel ( 0, 30, 200, 250, false, logreg_window ) local tabLogin = guiCreateTab( "Bejelentkezés", tabPanel ) local tabReg = guiCreateTab( "Regisztráció", tabPanel ) -- regisztráció figy_szoveg = guiCreateLabel(0.02,0.04,0.94,0.2,"Beállításokban lévő\nfelhasználónév lesz\n regisztrálva! Erre figyelj!",true,tabReg) guiLabelSetHorizontalAlign(figy_szoveg, "center", false) --guiLabelSetVerticalAlign(figy_szoveg, "center") jelszo_elso = guiCreateEdit( 0.1, 0.3, 0.8, 0.1, "Jelszavad elöször", true, tabReg ) jelszo_masodik = guiCreateEdit( 0.1, 0.5, 0.8, 0.1, "Jelszavad másodszor", true, tabReg ) guiCreateLabel(0.21,0.67,0.6,0.5,"Nemed:",true,tabReg) jatekos_neme = guiCreateComboBox ( 0.57, 0.65, 0.4, 0.3, "", true, tabReg ) guiComboBoxAddItem(jatekos_neme, "Nő") guiComboBoxAddItem(jatekos_neme, "Férfi") reg_gomb = guiCreateButton( 0.2, 0.85, 0.6, 0.1, "Regisztráció", true, tabReg ) --bejelentkezés figy_szoveg2 = guiCreateLabel(0.02,0.2,0.94,0.2,"Írd be a jelszavad\na bejelentkezéshez!",true,tabLogin) guiLabelSetHorizontalAlign(figy_szoveg2, "center", false) figy_szoveg3 = guiCreateLabel(0.02,0.56,0.94,0.2,"Ha azt írná nem regisztárltál:\nnézd meg jó név van-e\na beállításokban!",true,tabLogin) guiLabelSetHorizontalAlign(figy_szoveg3, "center", false) login_jelszo = guiCreateEdit( 0.1, 0.4, 0.8, 0.1, "Jelszavad", true, tabLogin ) login_gomb = guiCreateButton( 0.2, 0.85, 0.6, 0.1, "Belépés", true, tabLogin ) addEventHandler("onClientGUIClick", login_gomb, client_want_login, false) addEventHandler("onClientGUIClick", reg_gomb, client_want_register, false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () showCursor(true) guiSetInputEnabled(true) guiSetVisible(logreg_window, true) end )
  3. Oxsotus

    Medics Chat

    Thanks it works!
  4. Oxsotus

    Medics Chat

    Yes, because if add a player example to the medics, I can't refresh the other player's side "jatekos_adats" var, and the player must reconnect to the server to update the "jatekos_adats"
  5. Oxsotus

    Medics Chat

    Hi! I have one problem. I want to create a chat for medics, polices, etc etc... Here the function: first line function mentos_chat(jatekos,parancs,uzenet) (in english uzenet = message) So, I wrote the chat's command, and the message : "/mc Hello everybody" And it's only write the word "hello". I know, the first variable (uzenet) = Hello, and because the space the word "everybody" is the second variable, which does not exist. So, my question is: how to set the variable "uzenet" to text? Here's the full code: function mentos_chat(jatekos,parancs,uzenet) jatekos_adats_keres = dbQuery( adatbazis, "SELECT * FROM `players` WHERE `Username`=?", getPlayerName(jatekos) ) jatekos_adats = dbPoll( jatekos_adats_keres, -1 ) akik_ = dbQuery( adatbazis, "SELECT * FROM `players` WHERE `leaderes_munka`=?", 2) akik, row = dbPoll( akik_, -1 ) outputChatBox(row,jatekos) for i = 1, row, 1 do if( isPlayerOnline(akik[i].Username) then if(jatekos_adats[1].leaderes_rang == 1) then outputChatBox("Rádió: Próbaidős "..jatekos_adats[1].Character..": "..uzenet,getPlayerFromName(akik[i].Username)) end if(jatekos_adats[1].leaderes_rang == 2) then outputChatBox("Rádió: Ápoló "..jatekos_adats[1].Character..": "..uzenet,getPlayerFromName(akik[i].Username)) end if(jatekos_adats[1].leaderes_rang == 3) then outputChatBox("Rádió: Mentős "..jatekos_adats[1].Character..": "..uzenet,getPlayerFromName(akik[i].Username)) end if(jatekos_adats[1].leaderes_rang == 4) then outputChatBox("Rádió: Orvos "..jatekos_adats[1].Character..": "..uzenet,getPlayerFromName(akik[i].Username)) end if(jatekos_adats[1].leaderes_rang == 5) then outputChatBox("Rádió: Főnök "..jatekos_adats[1].Character..": "..uzenet,getPlayerFromName(akik[i].Username)) end outputChatBox(akik[i].Username,jatekos) end end end addCommandHandler("mc",mentos_chat)
  6. function login(player, command) local qh = dbConnect( "mysql", "dbname=mtarpg;host=127.0.0.1", "root", "") if(qh) then outputChatBox("Connecting to database succesful!",player,0,255,0) end local character = dbQuery( qh, "SELECT `Username` FROM `players`") local result, row, errmsg = dbPoll( character, -1 ) row_=tostring(row) outputChatBox(row_,player) end addCommandHandler("teszt",login) It works!!! Thanks!! local qh = dbConnect( "mysql", "dbname=mtarpg;host=127.0.0.1", "root", "")
  7. http://kepfeltoltes.hu/130621/110780241 ... es.hu_.jpg Hungarian
  8. I don't understand, what do you want to say. Sorry
  9. I don't understand, what I need to post. You mean, to remove the username and password, like this: function login(player, command) local qh = dbConnect ( "mysql", "localhost" , "root", "" ) if(qh) then outputChatBox("Connecting to database succesful!",player,0,255,0) end local character = dbQuery( qh, "SELECT `Username` FROM `players`") local result, row, errmsg = dbPoll( qh, -1 ) end addCommandHandler("test",login) (I translate the variables name's to english)
  10. function login(jatekos, parancs, felhasznalonev, jelszo) local qh = dbConnect ( "mysql", "localhost" , "root", "" ) if(qh) then outputChatBox("Adatbázishoz történő csatlakozás sikeres!",jatekos,0,255,0) end local character = dbQuery( qh, "SELECT `Character` FROM `players` WHERE `Username` = '?'", felhasznalonev ) local result, row, errmsg = dbPoll ( character, -1 ) end addCommandHandler("bjel",login)
  11. I changed, but now: WARNING: rpg\account_system_server.lua:35: dbPoll failed; No database selected
  12. function login(jatekos, parancs, felhasznalonev, jelszo) local qh = dbConnect ( "mysql", "localhost" , "root", "" ) if(qh) then outputChatBox("Adatbázishoz történő csatlakozás sikeres!",jatekos,0,255,0) end local character = dbQuery( qh, "SELECT `Character` FROM `players` WHERE `Username` = '?'", felhasznalonev ) local result, row, errmsg = dbPoll( qh, -1 ) end addCommandHandler("bjel",login) WARNING: rpg\account_system_server.lua:35: Bad argument @ 'dbPoll' [Expected db-query at argument 1, got db-connection] Sorry, I don't know what's the problem
  13. I function login(jatekos, parancs, felhasznalonev, jelszo) local qh = dbConnect ( "mysql", "localhost" , "root", "" ) if(qh) then outputChatBox("Adatbázishoz történő csatlakozás sikeres!",jatekos,0,255,0) end local qh = dbQuery( qh, "SELECT `Character` FROM `players` WHERE `Username` = '?'", felhasznalonev ) local result, row = dbPoll( qh, -1 ) end addCommandHandler("bjel",login) WARNING: rpg\account_system_server.lua:35: dbPoll failed; No database selected Could you link an example? (not from wiki) I want to select only one value and write it to the chatbox.
  14. Hello! Sorry for my bad english... I have problem with my script. When I write the command (in the server) /bjel username password it doesn't select the character for the username I want to poll the user data from the mySQL server by username. Here is my script. First part, it works And the second part, what doesn't works function login(jatekos, parancs, felhasznalonev, jelszo) local qh = dbConnect ( "mysql", "localhost" , "root", "" ) -- no password if(qh) then outputChatBox("Adatbázishoz történő csatlakozás sikeres!",jatekos,0,255,0) end --write the connection is succesfull character = dbQuery( qh, "SELECT `Character` FROM `players` WHERE `Username` = '?'", felhasznalonev ) local result, row = dbPoll( qh, -1 ) -- first error point this (I tryed it without the word "row", but doesnt works:( ) if(character) then outputChatBox("Karakter azonosítása sikeres!",jatekos,0,255,0) end -- second error point this outputChatBox(character,jatekos) end addCommandHandler("bjel",login) Here is the errors [2013-06-21 19:30:45] WARNING: rpg\account_system_server.lua:35: Bad argument @ 'dbPoll' [Expected db-query at argument 1, got db-connection] [2013-06-21 19:30:45] WARNING: rpg\account_system_server.lua:39: Bad argument @ 'outputChatBox' [Expected string at argument 1] I hope they can help me.
×
×
  • Create New...