Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. You can't 'get' it ingame. Only 'set' it, which you can use in any other application. Clear?
  2. IIYAMA

    Little Help

    As I said before, you can't use the same code on the same application! Like my words are just trash, seriously... So split it in two: Clientside if not guiGetVisible(VipHats) then triggerServerEvent("requestOpenVIPWindow", resourceRoot) else -- close the vip window... end Serverside addEvent("requestOpenVIPWindow", true) addEventHandler("requestOpenVIPWindow", resourceRoot, function () if isElement(client) then local account = getPlayerAccount(client) if account and not isGuestAccount(account) then local accName = getAccountName(account) if isObjectInACLGroup ( "user." ..accName, aclGetGroup ( "VIP") ) then triggerClientEvent(client, "openVIPWindow", resourceRoot) end end end end) Clientside addEvent("openVIPWindow", true) addEventHandler("openVIPWindow", resourceRoot, function () -- open the vip window... end)
  3. IIYAMA

    Help

  4. for _, vehicle in pairs(vehicles) do local originalHandling = getOriginalHandling(getElementModel(vehicle)) for _, k in pairs (originalHandling) do
  5. IIYAMA

    Little Help

    You guys can't mix clientside code with serverside code. Those are running on two different applications. One of your MTA client(clientside) and one on your server (serverside) . Client functions: https://wiki.multitheftauto.com/wiki/Client_Scripting_Functions Server functions: https://wiki.multitheftauto.com/wiki/Server_Scripting_Functions
  6. and instead of and image, html code?
  7. Do you have the same problem with other images of other servers?
  8. errorr = 1? Is that the reason why it doesn't work? Which server version are you running? If it is lower than 1.5.2., try to upgrade it.
  9. This is excluded the code of the previous messages. Tell me, where does the code stop working?
  10. I do not know what is wrong with it at the moment. (it is just not visible) Afaik: Make sure you grant the resource the right to use fetchRemote. Because the resource can't use this function without permission of the acl. Also this might save you some server bandwidth: Everytime you call fetchRemote, it will start downloading the data from the url. (you don't want to do that per player) fetchRemote ( 'https://d.top4top.net/p_6026au3j1.png', function (...) for k,player in ipairs(getElementsByType('player'))do savedplayers(player, ...) end end, "", false) function savedplayers(plr, img, errorr )
  11. IIYAMA

    [help]

    You can get length of the sound with the functions I also posted. For the timer update use your own imagination. I would personally go for onClientRender, because it is smoother. But a fast timer could do the job too.
  12. IIYAMA

    [help]

    https://wiki.multitheftauto.com/wiki/GetSoundLength https://wiki.multitheftauto.com/wiki/GetSoundPosition Try this: local progressBarPosition = math.floor((position / length) * 100) Stop double posting, it is annoying.
  13. IIYAMA

    One question

    That depends when you need to draw the images. If they do have priority to be downloaded before the resource starts, then it doesn't matter. There is also a function in the mta config to download resources from another server, if you are worried about the server bandwidth.
  14. Because this: driveInAndGo = {596, 597, 598, 416, 533} Is the same as: driveInAndGo = {[1] = 596, [2] = 597, [3] = 598, [4] = 416, [5] = 533} You only don't see the index fields. [<index>] = <data> local data = driveInAndGo[index] print(data) true = yes, false = no if true then --do stuff else -- false or nil --do other stuff end
  15. Afaik returned arguments from functions do not unpack more than one place, if you placed arguments behind it. function getNewArgumentsFromFunction () return "test1", "test2" end function lastCallFunction (parameter1, parameter2, parameter3) print(parameter1, parameter2, parameter3) end lastCallFunction (getNewArgumentsFromFunction(), "test3") Result: test1 test3 nil To solve that issue, you have to insert them one by one. You have to correct it by yourself.
  16. ? driveInAndGo = {[596] = true, [597] = true, [598] = true, [416] = true, [533] = true} ? if driveInAndGo[getElementModel(Vehicle)] then
  17. https://www.w3schools.com/sql/sql_insert.asp Use Google first, it is 10000000000000000000000000000000x smarter than me.
  18. ID should be handled by the database, not by LUA. (unless you have special reason for that) And make sure you define the column names before inserting.
  19. IIYAMA

    Mta sa server

    I never said you had to start it... Your scripts are bad, so you blame the server which can handle that amount of players if the scripts are optimised. @Oussema This is the scripting section, for scripting and not for discussing a future vps. Thank you for reading the section rules.
  20. IIYAMA

    Mta sa server

    No, shutdown your server, that will definitely fix it. This is the scripting section!!!!! O.M.Cow
  21. It should be logic that the server doesn't come in between.
  22. By draw something on top of it.
  23. Too much code guys. Try this: function getPlayersTrainSpeed () local veh = getPedOccupiedVehicle ( localPlayer ) if veh and getVehicleType (veh) == "Train" and not isTrainDerailed (veh) then local speed = getTrainSpeed ( veh ) outputChatBox ( "Viteza ta: " .. speed, 255, 0, 0 ) if speed > 30 then -- fill in the speed pls setTrainDerailed ( veh, true ) end end end addEventHandler ( "onClientRender", root, getPlayersTrainSpeed )
  24. IIYAMA

    question

    function add(c,d) return c + d end a = 5 a = add(a,5) print(a) -- print 10 Even though it kinda useless. You better do it like this: a = 5 a = a + 5 print(a) -- print 10
  25. function getPlayersTrainSpeed ( source, command ) @CodX Where do you see parameters here: https://wiki.multitheftauto.com/wiki/OnClientRender ? I don't see them, because there are none. So you can't add them there. Use localPlayer instead of source, without parameters. outputChatBox Doesn't require a player to send to, pls check the syntax.
×
×
  • Create New...