arnoldasz Posted August 26, 2011 Share Posted August 26, 2011 (edited) I am trying to get player ip, but I get errors in console: [22:02:57] WARNING: FreeRoam\fr_server.lua:75: Access denied @ 'getClientIP' [22:02:57] ERROR: FreeRoam\fr_server.lua:75: attempt to concatenate a nil value Whats wrong? Code: -- Function that sends info to server script: function onRegisterButtonClicked ( button, state ) if button == "left" and state == "up" then local username, password = guiGetText ( MainWindow [ "lineEdit_3" ] ), guiGetText ( MainWindow [ "lineEdit_4" ] ) if string.len ( username ) > 3 and string.len ( password ) > 3 then triggerServerEvent ( "registerPlayer", localPlayer, username, password ) else outputChatBox ( "#FFFF00[serveris]#FF0000[Klaida]:#FFFFFF Slapyvardį ir slaptažodį turi sudaryti ne mažiau kaip 4 simboliai." ) end end end -- Server addEventHandler ( "registerPlayer", rootElement, function ( username, password ) local res = mysql_query ( mysql, "SELECT `reg_id` FROM `server_users` WHERE `IP` = '" .. getPlayerIP ( source ) .. "'" ) end ) Edited August 26, 2011 by Guest Link to comment
bandi94 Posted August 26, 2011 Share Posted August 26, 2011 bk you put a server side function getPlayerIP in cilent side script getPlayerIP is only server side Link to comment
JR10 Posted August 26, 2011 Share Posted August 26, 2011 And it's named fr_server.lua, lol. Is it server side, or client side. Put the resource, in admin group, in ACL. Link to comment
arnoldasz Posted August 26, 2011 Author Share Posted August 26, 2011 I've put that before in ACL file, but server was on, so it haven't saved . Thanks anyway. Link to comment
bandi94 Posted August 26, 2011 Share Posted August 26, 2011 i say its client side bk he use gui and buton Link to comment
arnoldasz Posted August 26, 2011 Author Share Posted August 26, 2011 -- Function that sends info to server script: I writed comment, over that function. This message means, that I am sending info from client side script into server side script. I am sorry if it was unclear. Now I have another problem ( I don't want to create other thread, so I'll post in that ). I have a query to mysql server, but I can't get error which has been occoured: res = mysql_query ( mysql, "INSERT INTO `table` ( `name`, `ip`, `pass` ) VALUES ( '" .. name .. "', '" .. ip .. "', MD5('" .. pass .. "')" ) outputChatBox ( "error:" .. mysql_error ( mysql ), source ) Nothing outputs in chat ( I know that error occours, because query returns nil ) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now