Jump to content

Karoffe

Members
  • Posts

    89
  • Joined

  • Last visited

Everything posted by Karoffe

  1. Yes it is server side, it is only this piece of script. -.-
  2. Okay, idk what is happening i cannot make the "onMarkerHit" event works idk why local myMarker = createMarker(-2507.72241, -619.67261, 131.56250, 'cylinder', 2.0, 255, 0, 0, 150) -- create myMarker function MarkerHit() -- define MarkerHit function for the handler outputChatBox( "inside myMarker") -- attach the element's type with the text, and output it end addEventHandler ( "onMarkerHit", myMarker, MarkerHit ) that's the code of the wiki, but removed some lines to make sure... it is not working thought the problem may be in the meta or the file name so i changed the EventHandler to onResourceStart and it worked..^^
  3. Karoffe

    Table :s

    Yea that's what i was looking for. thanks,
  4. Karoffe

    Table :s

    That ain't helping i have read this page before, but its not related with my problem, if you think conversely, then could you fix the example which i provided ?
  5. Can i get this to work on the Offline MTA Wiki ?
  6. Cause i don't have enough space in the C drive I fixed the problem i just have to put the installer in the C drive where the winodws is installed...
  7. redownloading MTADiag didn't work... Windows Update, What important updates should i install... cause there is some which i don't want to be installed... to be more detailed to the problem.. the installer stops working when in the step which i agree to the terms of the agreement.... once i click i agree it stops working. there was 3 of the c++ 2008 redist.. so i uninstalled them all. then ran CCleaner and fixed all the registry issues. then ran the installer but that didn't fix the problem. then went to clear the MTA Prefetch but that didn't fix the problem too.. Well, i noticed something. I had windows is not genuine problem. i wanted to fix it so i followed what this video(watch?v=HY9TA3RdEWQ) says(and the windows genuine problem was fixed).. the steps were: 1- open cmd from the start menu (searching for cmd) 2- type "SLMGR- Rearm" then press enter 3- restart the computer before i did these steps the installer was working fine....
  8. I have Visual C++ 2012 runtimes installed and when i open MTADiag it also stops working "MTADiage.exe has stopped working"
  9. As the title says, i think i removed some of the MTA's data when i was trying to clear up the C drive... so i had to reinstall it. but everytime when i install it says "Multi Theft Auto Full Installer has stopped working" View problem details :
  10. Sorry for late response. so i should remove ".log" in the outputchatbox right ?.. tried to do that but now instead of outputting "nil" it outputs table: 04B0AB58 table: 04B0ABD0 table: 04B0AC48 table: 04B0AC98 ... and many more
  11. Ops, Posted in the wrong board please anystaff move it to the right board
  12. Well, i am working on a script actually just to learn more SQLITE, i used to use sqlite in the past but seems that now i forgot everything i learnt.. function onPlayerCommand() local result = dbPoll(dbQuery( connection, "SELECT PlayerName FROM Test WHERE PlayerName=?;", 'test'), -1) for i=1, #result do outputChatBox(tostring(result[i].log)) end end addCommandHandler ("result", onPlayerCommand) It outputs "Nil" instead of "Test".. I made a Sqlite Table which has 29 result in a table called PlayerName all the results should be "Test" but it outputs "nil" instead.. No Debug Errors.
  13. Karoffe

    Tables

    Finally, it's now working thank you..
  14. Karoffe

    Tables

    pff.... it did work on the server side script but in the client side it still doesn't work.. i don't really wanna give up with this code... --Server Side local resourcesinfo = {} function GLresRS() local resources = {} local RSres = getResources() for k, resource in ipairs(RSres) do if getResourceInfo(resource, "type") ~= "map" then table.insert(resources, {name=getResourceName(resource), state=getResourceState(resource)}) resourcesinfo[getResourceName(resource)] = {author=getResourceInfo(resource ,"author"), version=getResourceInfo(resource, "version"), fullname=getResourceInfo(resource, "name")} end end triggerClientEvent("ResourcesTable", getRootElement(), resources) triggerClientEvent("RSgetinfo", getRootElement(), resourcesinfo) end function RSgetinfo(resourcesinfo) RSresourcesinfo = resourcesinfo if guiGridListGetSelectedItem (RS_gridlist) ~= -1 then local RSinfores = guiGridListGetItemText ( RS_gridlist, guiGridListGetSelectedItem ( RS_gridlist ), Rsnamecol ) --outputChatBox(RSresourcesinfo[RSinfores].author) --local author = RSresourcesinfo[RSinfores].author guiSetText(RSIauthor_lab, "Author: "..RSresourcesinfo[RSinfores].author.."") -- > That's the line which has the error --guiSetText(RSIfullname_lab, "Full name: "..fullnameRS.."") --guiSetText(RSIversion_lab, "Version: "..versionRS.."") end end addEventHandler( "onClientGUIClick", RS_gridlist,RSgetinfo) addEvent("RSgetinfo", true) addEventHandler("RSgetinfo", root, RSgetinfo) Attempt to index field '?' ( a nil value )
  15. Karoffe

    Tables

    addEvent("RSgetinfo", true) addEventHandler("RSgetinfo", root, RSgetinfo) triggerClientEvent("RSgetinfo", getRootElement(), resourcesinfo)
  16. Karoffe

    Tables

    function RSgetinfo(resourcesinfo) if guiGridListGetSelectedItem (RS_gridlist) ~= -1 then local RSinfores = getResourceFromName(guiGridListGetItemText ( RS_gridlist, guiGridListGetSelectedItem ( RS_gridlist ), Rsnamecol )) RSresourcesinfo = resourcesinfo outputChatBox(RSresourcesinfo[RSinfores].author) --> That's the line which has the error --local author = RSresourcesinfo[RSinfores].author guiSetText(RSIauthor_lab, "Author: "..author.."") --guiSetText(RSIfullname_lab, "Full name: "..fullnameRS.."") --guiSetText(RSIversion_lab, "Version: "..versionRS.."") end end Actually it worked on server side.. but when i tried to apply it on client side.. it didn't work Attempt to index field '?' ( a nil value )
  17. Karoffe

    Tables

    Actually it doesn't work.. local resname = getResourceFromName ( "admin" ) local resser = resources[resname].state outputChatBox(resser) Attempt to index field '?' ( a nil value )
  18. Karoffe

    Tables

    Sorry for double posting... I have another question What if i want to get the state of a specific resource using the table(resources).. will i have to prevent using table.insert ? i actually tried to do it this way but it doesn't work... table.insert(resources[resource]....
  19. Karoffe

    Tables

    Finally, Thank you.. I feel i understand much more about tables now..
  20. Karoffe

    Tables

    map is not defined, maybe did you want to write "map" instead ? Also source isn't defined in the code you pasted here. server: function resourcese( thePlayer ) local resources = {} local res = getResources() for k, resource in ipairs(res) do if getResourceInfo(resource, "type") ~= "map" then table.insert(resources, getResourceName(resource)) end -- here it's a good practice to not use getRootElement() as source (avoid it as much as you can) triggerClientEvent(thePlayer, "ResourcesTable", thePlayer, resources) -- idk what was source in your script. end end -- I put the command here and not on the client side so I can know who asked for the list without using an extra triggerServerEvent from the client side addCommandHandler("restest", resourcese) client: local serverResources = {} function ress( resources ) serverResources = resources for k, resource in ipairs(serverResources) do -- why 'ke' ? outputChatBox( resource ) -- no need to add empty strings before and after a string end end addEvent("ResourcesTable", true) addEventHandler("ResourcesTable", root, ress) Really thanks. never expected the prob is comming from the triggering...(sorry for the late response wasn't at home ) I have another question.. I tried to do it this way.. cause i didn't know how to table.insert the resource name and the resource state function resourcese( thePlayer ) local resources = {} local maps = {} local rese = getResources() for i=1, #rese do if getResourceInfo(rese[i], "type") ~= "map" then resources[i] = {getResourceName(rese[i]), getResourceState(rese[i])} end end triggerClientEvent("ResourcesTable", getRootElement(), resources) end but it doesn't work by adding this line if getResourceInfo(rese[i], "type") ~= "map" then when i tried to remove this line it worked good.. but it includes the maps...
  21. Karoffe

    Tables

    Maybe you don't understand me,, you just made some words in the table which the loop will output them all... Please if someone could help,, I have made a lot of tries none worked...
  22. Karoffe

    Bloq Mays

    Hmm, you can... getKeyState When it is clicked then set player's data to Activated.. and so on
  23. Karoffe

    Tables

    Well, i wanted to practice more about tables, i understand everything but, idk what's wrong in here, i have seen many examples on how to do it but still nothing works... What i am doing in the script is that i am trying to get all the resources exists in the server copying them in another table, and use the table in the client side script and output it in the chat... local serverResources = {} function ress(resources) serverResources = resources for ke,resources in ipairs(serverResources) do outputChatBox(""..serverResources.."") end end addEvent("ResourcesTable", true) addEventHandler("ResourcesTable", root, ress) addCommandHandler("restest", ress) function resourcese() local resources = {} local res = getResources() for k,resource in ipairs(res) do if getResourceInfo(resource, "type") ~= map then table.insert(resources,getResourceName(resource)) end triggerClientEvent(source,"ResourcesTable",getRootElement(),resources) end end Debug: Bad argument #1 to 'ipairs' (table expected, got string)
  24. Well, actually i wanted if someone changing his nick to something that contains numbers then a gui shows telling him that he couldn't change his nick to that name. i wanted gsub to automatically change it without numbers So, how to check the entered nick if it contains numbers or not(without changing it)
×
×
  • Create New...