-
Posts
2,947 -
Joined
-
Last visited
Everything posted by JR10
-
setElementVisibleTo is server side only.
-
Hmm, maybe objects is added and the wiki is outdated.
-
Post it here and i will edit it, that's what you want right.
-
Looks like again you just copied it and paste, you should edit it and you should look at the code someone is giving you.
-
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.
-
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.
-
Did you edit the server? and show me the full code now.
-
Remove that # client side but keep it server side.
-
Well, yeah it's the same client side but change it server side like mine.
-
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.
-
Oh my bad .
-
Don't double post use the "EDIT" botton instead.
-
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.
-
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
-
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 )
-
No problem.
-
Post the code. And why not setElementVisibleTo
-
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.
-
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 )
-
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']
-
And don't ask here ,search here: https://community.multitheftauto.com/index.php?p=resources
-
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
-
<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)
-
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)