Jump to content

TheNightRider

Members
  • Posts

    180
  • Joined

  • Last visited

Everything posted by TheNightRider

  1. Thanks man ive already done that, got the binary's trouble am getting now is its saying unable to bind the ip and port? EDIT: NVM ive fixed it finally ROFL thanks for your help bud .
  2. Thanks man ive already done that, got the binary's trouble am getting now is its saying unable to bind the ip and port?
  3. Yes mate your right but the mta-server file I was referring too didn't exist, had to download the binary's but now ive got a problem. Says libncursew.so.5: cannot open shared object file: No such file or directory. Then it says ERROR: could not load ./core.so *Check installed data files. Press enter to continue. This happens when I start the mta-server and am not sure how to fix it
  4. Hey guys am trying to start up MTA Server on Linux but am unable to locate the MTA_Server.sh, Any Idea's?
  5. Thanks mate that did the trick works fine I just need to alter it in places so it only does if true eg if there is nothing for example banned_reason it won't try to show it on GUI otherwise it flags a bad argument but I can do that myself. Am still bit of a Noob when it comes to LUA for MTA but am slowly finding my way around things. You guys have been most helpful
  6. Thanks mate got that section working finally LOl. PS the pData is still returning as Boolean do you have any idea's why this is so?
  7. Thanks budy but it returns an error saying attempt to index local pData (boolean value) regarding the following line:- guiSetText(IDEd, pData.id) PS is the function which retrieves selected user from gridlist:- function selecteditem(datainput) local datainput = guiGridListGetSelectedItem(UsrList) if(datainput) then triggerServerEvent( "selector:query",getRootElement(), datainput) end end
  8. I divided the clientside function into 2 in the hope to solve the issue but the problem still remains, could you explain why selected returning a Boolean value ddEvent("item",true) function selecteditem(datainput) local datainput = guiGridListGetSelectedItem(UsrList) if (datainput) then triggerServerEvent( "SelectD",getRootElement(), UsrList ) else if not (datainput) then return 0 end end end addEventHandler("item",getRootElement(),selecteditem) addEvent("takedata",true) function retrieve(selected) if not (selected) then outputChatBox ( selected ) return 0 else if (selected) then local id=GuiGetText(IDEd,selected["id"]) local usr=GuiGetText(UsrN,selected["username"]) local admin=GuiGetText(ALvl,selected["admin"] ) local reason=GuiGetText(Banned,selected["banned_reason"] ) end end end addEventHandler("takedata",getRootElement(),retrieve)
  9. Okay thanks for that but am not able to figure out why its not passing the data to ClientSide as its always returning a Boolean value You know that is off subject cos its got nothing to do with why a value is returning a value whatsoever and its getLocalPlayer which does Sweet FA eg in this instance it returns an error
  10. Thanks ive fixed that part Its supposed to get the data from the guigridlist if selected and run it within the sql query so it gets the data of that username. I am not sure where am going wrong with this section. The problem is it doesn't seem to be passing the data onto the ClientSide. addEvent("SelectD",true) function getselected(take) outputChatBox ( take ) local result = mysql:query_fetch_assoc ( "SELECT id, admin, adminjail_time,banned_reason FROM accounts WHERE 'username'="..take.."'" ) if (result["take"]) then local data= mysql:fetch_assoc(result) end triggerClientEvent ( playerSource, "takedata", playerSource, data["id"] ) end addEventHandler("SelectD",getRootElement(),getselected ClientSide:- addEvent("takedata",true) function retrieve(selected) local selected = guiGridListGetSelectedItem(UsrList) if (selected) then triggerServerEvent( "SelectD",getRootElement(), UsrList ) local id=GuiGetText(IDEd,selected["id"]) local usr=GuiGetText(UsrN,selected["username"]) local admin=GuiGetText(ALvl,selected["admin"] ) local reason=GuiGetText(Banned,selected["banned_reason"] ) else if not(selected) then return 0 end end end addEventHandler("takedata",getRootElement(),retrieve)
  11. Thanks man I wondering whats with the triggerServerSide I cannot fathom out the issue. I changed it to what you said but its still telling me that userdata is boolean.
  12. Am working on the next piece of code for some reason it keeps on returning a boolean for each guiSetText although I guess it could be cos of the other issue. When I try to make the trigger work 1 am not too sure what the first argument I should be using in this case and why its saying the 2nd argument is saying expected element got string when the argument is an addEvent. PS its a TextEdit box am using to display the data for each id, admin etc. I'll be most thankful to anyone who gives me some good advice on the related issues. ClientSide addEvent("takedata",true) function retrieve(userdata) local selected = guiGridListGetSelectedItem(UsrList) if (selected) then triggerServerEvent( addrow, "SelectD", true ) local id=guiSetText(IDEd,userdata["id"]) local usr=guiSetText(UsrN,userdata["username"]) local admin=guiSetText(ALvl,userdata["admin"] ) local reason=guiSetText(Banned,userdata["banned_reason"] ) else if not(selected) then return 0 end end end addEventHandler("takedata",getRootElement(),retrieve) ServerSide addEvent("selectD",true) function getselected() local result = mysql:query ( "SELECT id, admin, adminjail_time,banned_reason FROM accounts WHERE 'username'="..select.."'" ) if (result["select"]) then local data= mysql:fetch_assoc(result) -- outputChatBox ( data["admin"] ) end triggerClientEvent ( playerSource, "takedata", playerSource, data ) end addEventHandler("SelectD",getRootElement(),getselected
  13. I did try it what you wrote and there was no output to gridedit and no errors.
  14. Am working on the next stage, ive got it to query for the usernames I did a test and the first username in the table showed on chat as exspected. The issue am having is passing the data to clientside so it will be displayed on the Gridlist. Serverside:- function UsrList( playerSource)--query database table for list of users to be used on clientside. local usrs = mysql:query_fetch_assoc("SELECT username FROM accounts ") if (usrs) then triggerClientEvent (( usrs["username"]),"getlist",true) outputChatBox ( tostring ( usrs ["username"] ) ) end end addCommandHandler ( "dbmanl", UsrList ) Clientside so far:- addEvent ("getlist",true) function Listing()--Display list of users in gridlist on GUI. local addrow = guiGridListAddRow(UsrList) guiGridListSetItemText(UsrList,addrow,Col,(usrs ["username"]) ,false,false) end addEventHandler("getlist",getRootElement(),Listing)
  15. Yeah I forgot to relate to the addEvent of a function it now works thanks man now I can get on with the next batch of stuff LOL
  16. Its working thanks to SoildSnake but there is something wrong with the client triggers keeps telling me not added clientside but they are. mysql = exports.mysql function showmenu ( playerSource )--check user has rights or not. local result = mysql:query_fetch_assoc ( "SELECT admin FROM `accounts` WHERE `username`='".. getPlayerName ( playerSource ) .."'" ) if ( result and tonumber ( result [ "admin" ] ) >= 1 ) then -- Check if the level is 6 or higher. triggerClientEvent ( playerSource, "ShowMenuC", playerSource, true )--show user interface. outputChatBox ( 'I did something YAY XD', playerSource );-- test if working or not else triggerClientEvent ( playerSource, "notify", playerSource, true )--tell user. outputChatBox ( 'Sorry No Can Do!!!', playerSource );-- test if working or not end end addCommandHandler ( "dbman", showmenu ) EDIT: Sorry forget to post the clientside function addEvent("tellusr",true) function notify(playerSource)--inform low level user. outputChatBox('You do not have permission to access this terminal',playerSource);-- notify user. end addEventHandler ("telluser",getRootElement(),notify)
  17. having username`=='".. pName .."'" returns an syntax error due to the == if its only a = i says attempt to index a nil value regarding the following line Yea yeah, I dont know why I thought it should have been double ==. Yet, it should work, it's extremely weird. The one I posted BEFORE worked. it does not work
  18. having username`=='".. pName .."'" returns an syntax error due to the == if its only a = i says attempt to index a nil value regarding the following line
  19. Yeah what about it and what is the point in having more than 1 script which has connection details? PS that duplicates the Primary Key, do not need to do connection because the query itself is querying the database. 1 Way we tried we got an error saying unknown Column Username etc meaning it was saying the Username it got from the table was a Column so it was in away getting confused but like I said it shows the script is querying the database
  20. It does not do nothing but when I added a test to show on chat what result is getting it seems to be counting in HEX LOL. I see its just returning a nil causing it to end but however it shouldn't be right? db = dbConnect( "mysql", "dbname="..dbname..";host="..host, username, password,port) function showmenu ( playerSource ) local pName = getPlayerName ( playerSource ) local consulta = dbQuery(db,"SELECT admin FROM `accounts` WHERE username = '"..pName.."'") local Result = dbPoll ( consulta, -1 ) outputChatBox ( tostring ( Result ) ) if (Result[1] == nil) then return end -- :~ happened :3 if (Result[1].admin >= 6) then -- epic WIN triggerClientEvent ( playerSource, "ShowMenuC", playerSource, true )--show user interface. outputChatBox ( 'I did something YAY XD', playerSource );-- test if working or not else triggerClientEvent ( playerSource, "notify", playerSource, true )--tell user. outputChatBox ( 'Sorry No Can Do!!!', playerSource );-- test if working or not end end
  21. Thanks mate but am using a mysql script to do the connection etc.
  22. I have tried so many ways to try and solve the issue but unsuccessful I know it is communicating with the database but isn't seem to be doing has expected. Could someone please explain why its wrong? mysql = exports.mysql function showmenu ( playerSource )--check user has rights or not. local result = mysql:query ( "SELECT admin FROM `accounts` WHERE `username`='".. getPlayerName ( playerSource ) .."'" ) if ( result and mysql:fetch_assoc ( result ) [ "result.admin" ] >= 6 ) then -- Check if the level is 6 or higher. triggerClientEvent ( playerSource, "ShowMenuC", playerSource, true )--show user interface. outputChatBox ( 'I did something YAY XD', playerSource );-- test if working or not else triggerClientEvent ( playerSource, "notify", playerSource, true )--tell user. outputChatBox ( 'Sorry No Can Do!!!', playerSource );-- test if working or not end end addCommandHandler ( "dbman", showmenu )
  23. I get an error saying line 6 attempt to return a nil value its regarding the line after the query.
×
×
  • Create New...