IIYAMA

Members
  • Content count

    3,550
  • Joined

  • Last visited

  • Days Won

    4

IIYAMA last won the day on September 4

IIYAMA had the most liked content!

Community Reputation

117 Excellent

About IIYAMA

  • Rank
    Hoo-Rider
  • Birthday 01/01/16

Details

  • Gang
    [HB]
  • Location
    Netherlands

Recent Profile Visitors

1,688 profile views
  1. mta dayz problem on VZombies

    You could try to resave the files with ANSI or UTF-16(not sure if UTF-16 is supported in MTA) encoding.
  2. Shader on part of image

    Yes it is possible. I just don't know how to do it with the shader file. But you can do it with lua: First draw the image: https://wiki.multitheftauto.com/wiki/DxDrawImage And then draw a section of the same image on top of it: https://wiki.multitheftauto.com/wiki/DxDrawImageSection
  3. [HELP] How to fix this problem in my script?

    If you do not want to contact the owner then it means it is leaked. I can understand that you want to get rid of me if that is the case. But even so I gave you a legal and cheap way to solve your problem and yet you call that not helping, OK. Good luck with it.
  4. [HELP] How to fix this problem in my script?

    Go to the owner of the script and inform him about it. You are now posting his code on the community. I am not sure if you are using a leaked version, but technically this is not allowed to be post without reference to the owner.
  5. optimize

    It looks fine to me as it is. If you want super - super optimization. You could pre-define the colors on top of the function. Not using a table on line 3, but 2 separated variables. (indexing tables cost time) Put this on top of the function: local ceiling = math.ceil Even though I do not recommend you to optimize it that far, except if you execute 100+ dx functions per frame. Scripts should stay readable. And you can also compile it to improve the performance.
  6. [HELP] How to create music effect?

    https://wiki.multitheftauto.com/wiki/GetSoundWaveData (There is an example included)
  7. [QUESTION] setVehiclePlateText() doubt

    Oh ops, misread that. What is the timer for? If you want to use the method, I would recommend you to add this: addEvent("onMapStarting", true) function setLicencePlate() setTimer(function() for k,v in ipairs(getElementsByType("player")) do local account = getPlayerAccount(v) if account and isGuestAccount(account) then return end local veh = getPedOccupiedVehicle(v) local plateText = getElementData(v, "plate") if veh and plateText and plateText ~= nil then -- if getVehiclePlateText ( v ) ~= plateText then setVehiclePlateText(veh, plateText) end -- end end end, 50, 1) end addEventHandler("onMapStarting", root, setLicencePlate) addEventHandler("onPlayerSpawn", root, setLicencePlate) addEventHandler("onPlayerJoin", root, setLicencePlate) It will save you MAX 100% network bandwidth.(that's when no plates have been changed) Even if the plate is the same as before, the server will send a message to all the clients that the value has changed. This due the fact that clients can modify this value and serverside has to overwrite it. You should compare it. Even so, it is not an efficient method > performance.
  8. LUA Function Help

    It will reset the health to the max player health, which is limited by the playerstats: https://wiki.multitheftauto.com/wiki/SetPedStat (default is 100 health, but can be increased to 200)
  9. [QUESTION] setVehiclePlateText() doubt

    Will kill your performance and with a lot of players even your server. With this you create infinity infinity-timers. This might work better.(serverside) But you have to test if it also works the first time you set the elementdata. addEventHandler("onElementDataChange", root, function (dataName,oldValue) if dataName == "plate" and getElementType(source) == "player" then local account = getPlayerAccount(source) if account and not isGuestAccount(account) then local vehicle = getPedOccupiedVehicle (source) if vehicle then local newPlate = getElementData(source, "plate") or math.random(4000,5000) setVehiclePlateText(vehicle, newPlate) iprint("onElementDataChange, vehicle:", vehicle, ", player:", source, ", new plate:", newPlate) end end end end) --[[ Also: addEventHandler("onPlayerLogin" > set plate text ]] Else you also have to change this clientside: function visual_ButtonHandler() if source == GUIEditor.button["plate"] then local nr = guiGetText(GUIEditor.edit["plate"]) if not nr then outputChatBox("Please insert a string to use as your licence plate before clicking ok.") return end if nr == nil or nr == "" or nr == " " or nr == " " or nr == " " or nr == " " or nr == " " or nr == " " or nr == " " or nr == " " then outputChatBox("Your licence plate cannot be empty. Changed to default one. ") nr = string.sub(getPlayerName(localPlayer):gsub('#%x%x%x%x%x%x', ''), 1, 8) end local veh = getPedOccupiedVehicle(localPlayer) if veh then if getElementData(localPlayer, "LoggedIn") ~= true then outputChatBox("You need to register and login in order to set a custom licence plate!", 255, 153, 0, true) return end setVehiclePlateText(veh, nr) -- change -- if getElementData(localPlayer, "plate") == nil then setElementData(localPlayer, "plate", false) end -- setElementData(localPlayer, "savedPlate", nr) setElementData(localPlayer, "plate", nr) visual["plate"] = nr v_setSaveTimer() end end end end addEventHandler("onClientGUIClick", resourceRoot, visual_ButtonHandler)
  10. LUA Function Help

    You need to respawn a player in order to reset his health.
  11. About SLUA

    Also it is not handy to give lua files different extensions, since text editors do rely on them for applying the syntax. (Even if your own editor does know what to do with it, your friends * editor might not)
  12. Draw An Box For Hydra

    Lol, you are the greatest example of that. Using the community to create scripts and sell them. I can't believe it, you are really insane.
  13. FPS drops

    function Switch(button,press) wep = getPedWeaponSlot(localPlayer) a= {} for z=0,12 do a[z] = exports.SMGsettings:getSetting(tostring(z)) end for z= 0,12 do if button == a[0] then if(press) then setPedWeaponSlot(localPlayer, 0) end end if a[0] == a[z+1] then addEventHandler("onClientKey", root, function (button, press) if button == a[0] then if (press) then if wep == 0 then setPedWeaponSlot(localPlayer, z+1) else setPedWeaponSlot(localPlayer,0) end end end end) end end for z= 0,12 do if button == a[2] then if(press) then setPedWeaponSlot(localPlayer, 2) end end if a[2] == a[z+3] then addEventHandler("onClientKey", root, function (button, press) if button == a[2] then if (press) then if wep == 2 then setPedWeaponSlot(localPlayer, z+3) else setPedWeaponSlot(localPlayer,2) end end end end) end end for z= 0,12 do if button == a[3] then if(press) then setPedWeaponSlot(localPlayer, 3) end end if a[3] == a[z+4] then addEventHandler("onClientKey", root, function (button, press) if button == a[3] then if (press) then if wep == 3 then setPedWeaponSlot(localPlayer, z+4) else setPedWeaponSlot(localPlayer,3) end end end end) end end for z= 0,12 do if button == a[4] then if(press) then setPedWeaponSlot(localPlayer, 4) end end if a[4] == a[z+5] then addEventHandler("onClientKey", root, function (button, press) if button == a[4] then if (press) then if wep == 4 then setPedWeaponSlot(localPlayer, z+5) else setPedWeaponSlot(localPlayer,4) end end end end) end end for z= 0,12 do if button == a[5] then if(press) then setPedWeaponSlot(localPlayer, 5) end end if a[5] == a[z+6] then addEventHandler("onClientKey", root, function (button, press) if button == a[5] then if (press) then if wep == 5 then setPedWeaponSlot(localPlayer, z+6) else setPedWeaponSlot(localPlayer,5) end end end end) end end for z= 0,12 do if button == a[6] then if(press) then setPedWeaponSlot(localPlayer, 6) end end if a[6] == a[z+7] then addEventHandler("onClientKey", root, function (button, press) if button == a[6] then if (press) then if wep == 6 then setPedWeaponSlot(localPlayer, z+7) else setPedWeaponSlot(localPlayer,6) end end end end) end end for z= 0,12 do if button == a[7] then if(press) then setPedWeaponSlot(localPlayer, 7) end end if a[7] == a[z+8] then addEventHandler("onClientKey", root, function (button, press) if button == a[7] then if (press) then if wep ==7 then setPedWeaponSlot(localPlayer, z+8) else setPedWeaponSlot(localPlayer,7) end end end end) end end for z= 0,12 do if button == a[8] then if(press) then setPedWeaponSlot(localPlayer, 8) end end if a[8] == a[z+9] then addEventHandler("onClientKey", root, function (button, press) if button == a[8] then if (press) then if wep ==8 then setPedWeaponSlot(localPlayer, z+9) else setPedWeaponSlot(localPlayer,8) end end end end) end end end addEventHandler("onClientKey", localPlayer, Switch) Adding infinity addEventHandlers, to new created functions and not clearing the Switch function block after every execution. That is what causing the lagg. Your friend should be the one posting the code. If he wants to fix his code, he should start with making a flowchart to figure out which steps he has to make to rewrite his code. Because it is extremely unoptimised and should be recreated.
  14. Draw An Box For Hydra

    Writing a (bedtime) story is too much for you? I am sorry but this starts to get really awkward. (This is not an insult, just a conclusion caused by your displeased stubborn behaviour.) Examples are for people that can use it to build their script. But you don't know how to write the syntax of LUA, so that would be a waste of time since it is required to rewrite the code. Understood? You want to learn things to boring way? You can start with these articles. Good luck and I helped you.
  15. local playercar1 = executeSQLQuery("SELECT Model FROM vehicleSlot1 WHERE PlayerName = ?",targetAccount) if #playercar1 > 1 then local playercar1 = executeSQLQuery("SELECT Model FROM vehicleSlot1 WHERE PlayerName = ? LIMIT 1",targetAccount) if #playercar1 == 1 then LIMIT 1 = max 1 result, useful for optimisation of the queries.