Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. That depends of the gpu, 4000x4000 will be nothing for me. But maybe for you it will drop frames. 100x100 will probably not take to much, keep in mind that you scale this to the ratio of his resolution. (so not 100 x 100)
  2. You can also freeze it by rendering. (the ped isn't frozen in this video, but just to show you what is more possible when you render it)
  3. yes, but it also depends on the dxCreateRenderTarget resolution.
  4. You run two race race resources next to each other?
  5. That you forgot to check this guy is your problem. You should ask him to show the result before you paid him. This section is not for requesters like you.
  6. You want to know what is wrong? Well lets see if you are up to that. 1. You attach the weapons only at the localPlayer, the source of the event should be used instead. (so use source) 2. You trigger to all players when you use the command. But when a player joins after, nothing is sending this trigger to him. (use a table for the late joiner, when the player loads his resource = "onClientResourceStart", trigger serverside to get this table > trigger client again with the table) 2.1. Clean this table of that player when he leaves, 3. When you trigger an element to the other side(client< >server) this element can be destroyed and the code starts giving warnings. This is caused by critical network traffic. Good code never gives warnings or errors, if it does it gives lagg. So use: if isElement(source) then 4. Makes totally no sense: for _, nMax in ipairs ( getElementsByType ('player' )) do local nx, ny, nz = getElementPosition ( nMax ) setWeaponTarget ( minigunw ,nMax, 255 ) end
  7. Check if the variable sound is created and if that part is executed.
  8. You have a lot of problems with synchronising serverside data to clientside, this is a very hard learning process. I don't think you are ready for those knowledge yet. But there is another way you can do it, without that required knowledge. Which is creating those custom weapons, based on the player his actions. So when you start your resource and when a player joins. Require no extra communication, because of the events that already exist. You can't trust fully on this because of communication problems, caused by unstable ping and connection timed outs. But for the basic it would work. addEventHandler("onClientPlayerJoin",root, function() -- attach the weapon to the variable source end) addEventHandler("onClientResourceStart",resourceRoot, function () local players = getElementsByType("player") for i-1,#players do local player = players[i] -- attach the weapon to the variable player end end)
  9. You can try replace the texture with an invisible texture.
  10. @ALw7sH You just wrote exactly the same.... @Arab Real Life The variable thePlayer is nil. and why it is nil, is caused by your other code.
  11. Seriously, replying on this 1 month later..... The slowLoopCode. local slowLoopTable = {} local maxItemsPerLoop = 30 local slowLoopFunction = function (theTable) local tableData = slowLoopTable[theTable] if tableData then local startValue = tableData["startValue"] local endValue = tableData["endValue"] local processFunction = tableData["processFunction"] for i=startValue, endValue do tableData["processFunction"](i,theTable[i]) end local maxItemsPerLoop = (theTable["maxItemsPerLoop"] or maxItemsPerLoop) local newStartValue = endValue+1 if newStartValue <= #theTable then tableData["startValue"] = newStartValue local newEndValue = newStartValue+maxItemsPerLoop if newEndValue > #theTable then tableData["endValue"] = #theTable else tableData["endValue"] = newEndValue end --tableData["timer"] = setTimer(slowLoopFunction,400,1,theTable) resetTimer (tableData["timer"]) else slowLoopTable[theTable] = nil end end end function startSlowLoop (theTable,processFunction,itemsPerLoop) local slowLoopTimer = setTimer(slowLoopFunction,400,1,theTable) if slowLoopTimer then local maxItemsPerLoop = tonumber(itemsPerLoop) or maxItemsPerLoop -- protect the variable against overwrite if maxItemsPerLoop > #theTable then maxItemsPerLoop = #theTable end slowLoopTable[theTable]= { ["timer"]= slowLoopTimer, -- can be useful for a quick abort and reset. ["startValue"]= 1, ["endValue"]= maxItemsPerLoop, ["maxItemsPerLoop"]= maxItemsPerLoop, ["processFunction"]= processFunction } end end --[[ supports multiply tables ----------------------------- ]] Example how to execute it. local theTable = {3,5,36,547,36,3,8,9,3,6,7,8,5,4,7,8,4,8,5,2,2,1} function executeProcess (index, par) outputChatBox(tostring(index) .. " " .. tostring(par)) -- do your stuff here -- end startSlowLoop ( theTable, executeProcess, 5) Put them both in one of your scripts and execute it. Then you will know what it does.(if I didn't made a mistake)
  12. ah common, you copied those last few lines from somebody else. Else you would not have used that loop, which is doing exactly what you don't want. Your other solution: - Find the source code(resource lines) of this event, then we have all information you need to make it. The function which is used is: triggerEvent If you aren't able to debug your code by debugging the variables and you aren't able to find the line that is firing this event, I don't have enough information to help you out on this.
  13. If the ped is the source is another question, it can also be an argument. You should debug your variables to find that answer. You know what a variable is? and what arguments are?
  14. IIYAMA

    A question

    Of course there are: https://community.multitheftauto.com/in ... =resources Something wrong with your keyboard or mouse? or is it just laziness? If you want people to search resources for you, you are at the wrong section. Resource section will just do fine. Good luck.
  15. addEvent ( "onZombieSpawn", true ) addEventHandler ( "onZombieSpawn", root, function () if getElementModel ( source ) == 281 then setElementHealth ( source, 50 ) outputChatBox("noob zombie spawned") end end) Because you are using a loop?
  16. Citizen spoke the hard truth, sometimes that relieves. He didn't flame, just gave his opinion. The main reason why they created forums is for discussing problems. This is a problem, so we can discus it and give our opinion. It is a good thing to save Sasu from wasting time, he can play mta/(or help somebody else) instead of trying to help somebody who can't be helped. I would be glad if somebody did that for me.
  17. There are too many of those stupid kids posting parts from DayZ/etc. gamemode, when they have no fu idea how to write a single line of code. It is shameful, disrespectful and against the forum rules. There are hardly any seriously posts.
  18. https://wiki.multitheftauto.com/wiki/Se ... axDistance https://wiki.multitheftauto.com/wiki/Se ... inDistance
  19. IIYAMA

    give weapon

    addEvent("onGreetingtwo",true) addEventHandler("onGreetingtwo",root, function(p) giveWeapon(p,31,200) end) resourceRoot to root. When you use resourceRoot, only the resourceRoot can execute this function. When using root, all elements can execute this function. This element will be also known as the source of the event. (the variable source holds this element(userdata)) The source element is the element you define in your triggerClient/ServerEvent, this one comes directly after the event name. triggerClientEvent ( [table/element sendTo=getRootElement()], string name, [color=#FF0000]element sourceElement[/color], [arguments...] ) triggerServerEvent ( string event, [color=#FF0000]element theElement[/color], [arguments...] )
  20. setPedAnimation
  21. local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then local health = getElementHealth(vehicle)-250 if health < 0 then health = 0 end ------------------------------------------ ------------------------------------------ end
  22. IIYAMA

    Sound

    I don't get any error i tried with /debugscript 3 and nothing I am not just talking about /debugscript 3. I am talking about the other strategies, as you would see if you did read the page carefully.
  23. IIYAMA

    Sound

    https://wiki.multitheftauto.com/wiki/Debugging#Debug_strategies
  24. https://wiki.multitheftauto.com/wiki/OnClientClick button: This refers the button used to click on the mouse, can be left, right, or middle [color=#FF0000]>> state: This can be used to tell if the user released or pressed the mouse button, where up is passed if the button is released, and down is passed if the button is pushed[/color] absoluteX: This refers to the 2D x coordinate the user clicked on his screen, and is an absolute position in pixels. absoluteY: This refers to the 2D y coordinate the user clicked on his screen, and is an absolute position in pixels. worldX: This represents the 3D x coordinate the player clicked on the screen, and is relative to the GTA world. worldY: This represents the 3D y coordinate the player clicked on the screen, and is relative to the GTA world. worldZ: This represents the 3D z coordinate the player clicked on the screen, and is relative to the GTA world. clickedWorld: This represents any physical entity elements that were clicked. If the player clicked on no MTA element, it's set to false. When you click and don't release it, it is hold.
  25. or try first a smaller project and test every piece of code before you write more.
×
×
  • Create New...