arnoldasz Posted August 26, 2011 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
bandi94 Posted August 26, 2011 Posted August 26, 2011 bk you put a server side function getPlayerIP in cilent side script getPlayerIP is only server side Ingame Name : |DGT|Puma DGT Clan Server 24/7 Owner/Scripter MultiGameMode in progress :
JR10 Posted August 26, 2011 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. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
arnoldasz Posted August 26, 2011 Author Posted August 26, 2011 I've put that before in ACL file, but server was on, so it haven't saved . Thanks anyway.
JR10 Posted August 26, 2011 Posted August 26, 2011 You welcome. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
bandi94 Posted August 26, 2011 Posted August 26, 2011 i say its client side bk he use gui and buton Ingame Name : |DGT|Puma DGT Clan Server 24/7 Owner/Scripter MultiGameMode in progress :
arnoldasz Posted August 26, 2011 Author 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 )
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