-
Posts
6,064 -
Joined
-
Last visited
-
Days Won
209
Everything posted by IIYAMA
-
You can try replace the texture with an invisible texture.
-
@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.
-
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)
-
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.
-
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?
-
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.
-
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?
-
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.
-
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.
-
https://wiki.multitheftauto.com/wiki/Se ... axDistance https://wiki.multitheftauto.com/wiki/Se ... inDistance
-
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...] )
-
setPedAnimation
-
local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then local health = getElementHealth(vehicle)-250 if health < 0 then health = 0 end ------------------------------------------ ------------------------------------------ end
-
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.
-
or try first a smaller project and test every piece of code before you write more.
-
Of course it returns false, there is no variable called: targetPlayer there. And it DOEN'T RETURN THE PLAYER NAME, IT RETURNS A PLAYER. When you put a userdata in to a grid list, it becomes a string. This is what it does: local targetPlayer = tostring(localPlayer) -- convert the userdata to a string local player = findPlayerByUserDataString (targetPlayer) -- find the player who is matching this userdata string. Use it between line 104 and 105. (clientside) It looks like you don't know which types of data there are out there. Use the function type(variable) to figure that out, it returns the type. This link might help you: https://wiki.multitheftauto.com/wiki/De ... strategies
-
no, one side. clientside or serverside. The first one is just a useful function. The second one is how you can use the function.
-
I understand now what you mean. Except how do I know which characters do I have to ignore? string.gsub is also using these special characters, so I can't replace them using that.
-
https://wiki.multitheftauto.com/wiki/Dx ... entEnabled
-
Line 20. if killer == localPlayer then
-
getElementsByType("player") already is a table, no need to overheat your code. If you convert usedata to strings, you can't convert them back. Try: function findPlayerByUserDataString (targetPlayer) local players = getElementsByType("player") for i=1,#players do local player = players[i] if targetPlayer == tostring(player) then return player end end return false end local player = findPlayerByUserDataString (targetPlayer) But managing a table next to your gridlist is much better.
-
That are a lot of characters. Is there a way to disable the function of the special characters while comparing?
-
It is only that character which causes this problem?