-
Posts
285 -
Joined
-
Last visited
Everything posted by dugasz1
-
egyre többen vagyunk
-
Hello! How can i filter only the latin characters?(I don't know how it's called) (There are the allowed characters: qwertzuiopasdfghjklyxcvbnm. Is there a simple solution?) For example: name1 = "Sam ß Winchester" --==> Wrong! name2 = "Sam% Wichester" --==> Wrong! name3 = "Sám Wínchestér" --==> Wrong! name4 = "Sam Winchester" --==> Ok! name4 = "Robert J Thommas" --==> Ok! There are the allowed characters:
-
I asked another hungarian scripter (image) he point on the problem : dbQuery( loginCallback , { arg1, arg2,..}, theConnection, .... Only the {} miss Thank you the help too!
-
addEvent( "clientRequestLogin", true ) addEventHandler( "clientRequestLogin", getRootElement(), function ( username, password ) dbQuery( loginCallback, source, theConnection, "SELECT * FROM users WHERE username = ? AND password = ?", username, md5(password) ) end ) function loginCallback ( thePlayer, qh ) local result = dbPoll( qh, 0 ) if #result == 1 then outputChatBox ( "Üdvözlünk ".. result[1]['username'].." a szerveren!", thePlayer ) dbQuery( characterCallback, thePlayer, theConnection, "SELECT * FROM characters WHERE owner = ?", result[1]['username'] ) elseif #result == 0 then outputChatBox ( "Hibás felhasználónév vagy jelszó!", ) end end WhoAmI, do you see the problem? Because it isnt work and the console write "expected db-connection at arg 2.. ". Or do somebody know the solution?
-
Thank you You mean it's can be simply hacked?
-
Hello! I have got some problem to define the player: So there is a button when i click on it its trigger to server the login data (there is the player yet). But when i make a query and its call back how can i call the player who click the button? addEvent( "clientRequestLogin", true ) addEventHandler( "clientRequestLogin", getRootElement(), function ( username, password ) --dbExec( theConnection,"SET NAMES utf8" ) dbQuery( loginCallback, theConnection, "SELECT * FROM users WHERE username = '"..username.."' AND password = '"..md5(password).."'" ) end ) function loginCallback ( qh ) local result = dbPoll( qh, 0 ) if #result == 1 then outputChatBox ( "Üdvözlünk ".. result[1]['username'].." a szerveren!", --Here comes the player ) dbQuery( characterCallback, theConnection, "SELECT * FROM characters WHERE owner = '"..result[1]['username'].."'" ) elseif #result == 0 then outputChatBox ( "Hibás felhasználónév vagy jelszó!", --Here comes the player ) end end
-
Thank you ! And can i set it on my mysql server to be the default communication?
-
My problem solved. I runed this and now its ok: dbExec( theMysql,"SET NAMES utf8" ) Somebody can exmpain what i did?
-
You dont understand me, i dont wanan find the query result its deficient : The real value for example: Vadász --> I will get: Vad
-
Hi! I need to use utf8 characters because my language (for example : á,é,ő) My problem is if in a field there is a accent character i will get a deficient value: In the mysql: Vadász --> I will get: Vad or: Kerék --> Ker Any idea?
-
Ohh that's why i dont find it. Thanks all the answers
-
Not at all
-
6350, 4731 I found that two
-
addEvent("spawnVehicle", true ) addEventHandler("spawnVehicle", root, function ( vehID ) if ( isElement ( vehicles [ source ] ) ) then destroyElement ( vehicles [ source ] ) end vehicles [ source ] = createVehicle ( vehID, getElementPosition ( source ) ) if ( vehicles [ source ] ) then setVehicleColor ( vehicles [ source ], 255, 255, 255 ) end setTimer ( warpPedIntoVehicle, 200, 1, source, vehicles [ source ] ) end ) Don't use source, Trigger player too. Client: triggerServerEvent("spawnVehicle", localPlayer, localPlayer, id) Server: addEvent("spawnVehicle", true ) addEventHandler("spawnVehicle", root, function ( thePlayer, vehID )
-
Thank you ! It's work
-
Hello! I've got a problem. I've got a tables like: tancok = { ["Salsa"] = {"Salsa", "DAN_Down_A"}, ["TNT"] = {"TNT", "DAN_Up_A"}, ["Tango"] = {"Tango", "dnce_M_a"}, ["Rap"] = {"Rap", "dnce_M_b"}, } ... etc. More tables and i wanna write it owre whit in pairs(), but i got the table's name in string for example: local thetablename = "tancok" i use in pairs: for i,v in pairs(thetablename) do outputChatBox(v[1]) end And got error : bad argument #1 to 'pairs' (table expected got string) Some help pls
-
ohhh thanks then if i connect in another res like this: dbConnect( "mysql", "dbname=mta;host=localhost", "root", "******") It just use the shared connection?
-
Yeah i tried it. theConn = dbConnect( "mysql", "dbname=mta;host=localhost", "root", "******", "share=1" ) Another resources : local qh = dbQuery( theConn , "SELECT * FROM accs" ) But it can't find theConn variable. What is the best way to make the connection in resources? (i try to make a gamemode i don't want to type everywhere the host, user ... etc)
-
Hello comminity! I have a few question about mySQL (not the modul). 1. When i share a dbConnect whit "share=1",what is mean? I can use the connection in another scripts, and how? 2. If i cant use it whit share, what is the best way to make a connection in resources?
