Jump to content

JR10

Retired Staff
  • Posts

    2,947
  • Joined

  • Last visited

Everything posted by JR10

  1. setElementVisibleTo is server side only.
  2. Hmm, maybe objects is added and the wiki is outdated.
  3. JR10

    Problems

    Post it here and i will edit it, that's what you want right.
  4. JR10

    Problems

    Looks like again you just copied it and paste, you should edit it and you should look at the code someone is giving you.
  5. JR10

    Problems

    Don't add it without editting it don't just copy paste if you looked at it you would have watched the comment edit it to check if the player is admin.
  6. JR10

    Problems

    Is that your server side?? first you must edit it to check if he is an admin and add it to onPlayerJoin local admins = {} addEventHandler('onPlayerJoin', root, function() --if the player is admin here table.insert(admins, v) --end end ) Now edit it and check if the player is admin.
  7. JR10

    Problems

    Did you edit the server? and show me the full code now.
  8. JR10

    Problems

    Remove that # client side but keep it server side.
  9. JR10

    Problems

    Well, yeah it's the same client side but change it server side like mine.
  10. JR10

    Problems

    local admins = {} for i, v in ipairs(getElementsByType('player')) do --if isPlayerAdmin then check if the player is admin table.insert(admins, v) --end end triggerClientEvent('admins', root, #admins) and the client event is the same guiSetText or something.
  11. Don't double post use the "EDIT" botton instead.
  12. Maybe: but i'm not sure addEventHandler('onClientGUIClick', progressBar, function(button, state) if botton = 'left' and state = 'down' then addEventHandler('onClientRender', root, changeProgressPos) elseif botton = 'left' and state = 'up' then removeEventHandler('onClientRender', root, changeProgressPos) end end ) function changeProgressPos() local x, y = getCursorPosition1() guiSetPosition(progressBar, x, y) end Even if it didn't work it might give you the idea . EDIT: @ getCursorPosition remove the "1" it does the same as getPlayerTeam.
  13. 1. a table?? if so: unpack(theTable[math.random(#theTable)]) 2. ok let's say you want to loop 5 times for i=0, 5 do --code end let's say you want to loop through a table for i, v in ipairs(theTable) do --code end looping through connected players: for i, v in ipairs(getElementsByType('player')) do --code end
  14. JR10

    Problems

    here: --client side addEventHandler('onClientResourceStart', resourceRoot, function() players_on = guiCreateLabel(243,372,16,22,"0",false,rules) triggerServerEvent('onDownloadingResourceFinish', root) end ) addEvent("players",true) addEventHandler("players",root, function(count) guiSetText(players_on, tostring(count)) end) --server side addEvent('onDownloadingResourceFinish', true) addEventHandler('onDownloadingResourceFinish', root, function() local count = getPlayerCount() triggerClientEvent("players",getRootElement(),count) end )
  15. Post the code. And why not setElementVisibleTo
  16. for ~~ what the hell is ~~ and on dxDrawText and dxDrawImage Wrong Arguments and again what the hell is ~~ char type?? This is the weirdest code i've ever seen Problems?? this code shouldn't work at all.
  17. JR10

    Problems

    try this --client side addEventHandler('onClientResourceStart', resourceRoot, function() players_on = guiCreateLabel(243,372,16,22,"0",false,rules) triggerServerEvent('onDownloadingResourceFinish', root) end ) addEvent("players",true) addEventHandler("players",root, function(count) guiSetText(player_on, tostring(count)) end) --server side addEvent('onDownloadingResourceFinish', true) addEventHandler('onDownloadingResourceFinish', root, function() local count = getPlayerCount() triggerClientEvent("players",getRootElement(),count) end )
  18. This is from the wiki: mysqlQuery ( db, "onMySQLResult", "SELECT * FROM test" ) function onMySQLResult ( table ) outputServerLog ( "Printing some test results" ) outputServerLog ( table[1][1] ) outputServerLog ( table[1][2] ) end Your dbSel['skin'] is wrong it should be dbSel[1][9] or but not sure about this one dbSel[1]['skin']
  19. And don't ask here ,search here: https://community.multitheftauto.com/index.php?p=resources
  20. Ok i don't know mysql but shouldn't dbSel['skin'] be: dbSel[1]['skin'] --etc etc or dbSel[1][9] 9 is the skin in selecting That is what is explained here: https://wiki.multitheftauto.com/wiki/Mod ... MysqlQuery
  21. <meta> <script src="Cars.lua" type="client" /> <file src="dffs/:O.dff" /> <file src="txds/:O.txd" /> </meta> function replace() local txd = engineLoadTXD ( "txds/:O.txd" ) engineImportTXD ( txd, 462 ) local dff = engineLoadDFF ( "dffs/:O.dff", 462 ) engineReplaceModel ( dff, 462 ) end addEventHandler("onClientResourceStart", resourceRoot, replace)
  22. function replace() local txd = engineLoadTXD ( "txds/:O.txd" ) engineImportTXD ( txd, 462 ) local dff = engineLoadDFF ( "dffs/:O.dff", 462 ) engineReplaceModel ( dff, 462 ) end addEventHandler("onClientResourceStart", getRootElement(), replace)
×
×
  • Create New...