-
Posts
6,062 -
Joined
-
Last visited
-
Days Won
208
Everything posted by IIYAMA
-
It is all in the server manual: https://wiki.multitheftauto.com/wiki/Server_Manual#Installing.2FUpdating_resources_on_your_server
-
Even if you disable the sync argument, it probably will trigger the onClientElementDataChange event. But it shouldn't be too bad if you use it. But I do recommend you to set the elementdata only when it isn't the same as the previous value.
-
afaik it is a bug, nothing you can do about it except of reporting it: https://bugs.multitheftauto.com/my_view_page.php Or use: onClientPlayerDamage to adjust the player damage.
-
You can try to detect it with: https://wiki.multitheftauto.com/wiki/OnPlayerModInfo And kick them with: https://wiki.multitheftauto.com/wiki/KickPlayer Of course you need to be able to script, which is obvious for the scripting section.
-
I have been trying to bindkeys to a command clientside and save them inside a xml file. But the mta binding cache is stacking up. Keys: 'x', 'u', 'x' See screenshot bellow. The problem shows up when you edit the bindkey in the settings menu and load the xml file after saving it. To use the bindkeys, you have to bind it with any key on your keyboard. To know which bindkeys are bound to a command with your previous visit, you have to bind any key of your keyboard to that command in order to use: getBoundKeys / getKeyBoundToCommand If you use unbindKey, it will unbind the command for all other keys, but not remove it from the cache. And another problem, I can't remove keys/'alternative keys' from the cache unless I click on the 'Load defaults button on the right bottom'. This is the code I have been testing with:
-
I think the problem lies with the mentalmodel of people that just started with scripting. The concept is simple, but for the ones with no guidelines it is required to be creative to come to up with those logic solutions. And a lot of people do not understand that creativity is key to programming, which is kinda funny. It might be a little bit dangerous to say this: People who fail at programming even though they understand the pieces of code are mostly not creative enough to put it together. This doesn't count for every individual ofcourse.
-
super ultra f. useless reply ever. You should debug your account data as well. Check if you can change the player his skin after the event has been called. Making sure that no other resources are in the way. (like roleplay security) The debug says that the skin set failed. Which is most likely because the player already has the same skin. Put the debug messages in order of time and do not stack up if they shouldn't be put together. Only one part of the code can run at the same time, so stacking up like that should be impossible if it is done by time.
-
Maybe you want something like this: local enableSkinForAccount = { [1] = { [303] = true, -- can add more }, [4] = { [50] = true } } addEventHandler("onElementModelChange", root, function(oldModel) if (getElementType(source) == "player") then iprint("element is a player") local accountID = getElementData(source, "acc.accID") iprint("accountID:", accountID, ", it's type is:", type(accountID)) accountID = tonumber(accountID) -- convert it to a number just incase it is a string local currentModel = getElementModel(source) if not (accountID and enableSkinForAccount[accountID] and enableSkinForAccount[accountID][currentModel]) then iprint("accountID isn't found in enableSkinForAccount") setElementModel(source, 0) end else iprint("element isn't a player") setElementModel(source, oldModel) end end)
-
Just show the results man, since the results can tell you why it isn't working. You are talking too much, keep it short and neat. Try this and show the results of both accounts: -- I am not sure why you use tables inside tables while there is only one item per accountID local enableSkinForAccount = { [1] = {303}, [4] = {50} } --[[ it can be like this: local enableSkinForAccount = { [1] = 303, [4] = 50 } ]] addEventHandler("onElementModelChange", root, function(oldModel) if (getElementType(source) == "player") then iprint("element is a player") local accountID = getElementData(source, "acc.accID") iprint("accountID:", accountID, ", it's type is:", type(accountID)) accountID = tonumber(accountID) -- convert it to a number just incase it is a string if accountID and enableSkinForAccount[accountID] then iprint("accountID has been found in enableSkinForAccount") local newModel = enableSkinForAccount[accountID] if newModel and newModel[1] then iprint("newModel data has been found:", newModel, ", it's type is:", type(newModel)) iprint("first item in newModel is:", newModel[1], ", it's type is:", type(newModel[1])) local model = tonumber(newModel[1]) if model then iprint("model has been found, now apply the model to the player") if not setElementModel(source, model) then iprint("the model has been failed to set") end end end else iprint("accountID isn't found in enableSkinForAccount") setElementModel(source, 0) end else iprint("element isn't a player") setElementModel(source, oldModel) end end)
-
Read my tutorial, then you would know what to do.
-
if newModel and newModel[1] then local model = tonumber(newModel[1]) if model then setElementModel(source, model) end end not sure what your code problem is... pls debug your code more manually.
-
You could use an export to import a table with your custom oop functions. Even though you will be indexing this table to access these functions instead of multiple variables. Another option could be loadstring. https://www.lua.org/pil/8.html
-
This is something you can only figure out by debugging your code. Since you haven't done that properly, you go to the forum and say: 'it doesn't work but I do not know why'. But if you did do that properly, then you could say: 'This variable contains a wrong value.' This is NOT properly debugging: Staring at the debug console and waiting for an error/warning to show up. So follow a tutorial instead:
-
not supported. The only thing you can do is create an overwrite, which will take a lot of time.
-
you could try to find those with: https://community.multitheftauto.com/index.php?p=resources&s=details&id=7549
-
There is an error/warning on line 28 when you write /check, don't talk bull:~. Use this tutorial to find your problem:
-
You can't understand that the script overwrites/re-sync the melee damage that is given to peds by players? If that is not what you want, then indeed there is no possible way to help you.
-
As I said before, it isn't fixable that way. I gave you a solution, use it if you really want it. Scripting is required as this is the scripting section.
-
[REL] New Hydra rockets (GTA5-like with aimer dot)
IIYAMA replied to Dutchman101's topic in Resources
Nicely done! -
The way peds receive damage from melee attacks. If you use that resource outside the boundary on a ped, you would know. But I do not recommend you to use everything from that resource, because it is very old and consumes a lot of data.
-
By creating an overwrite, that's the only fix. Need inspiration on how to do that? See this resource: https://community.multitheftauto.com/index.php?p=resources&s=details&id=1065