-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
[REL] Anti-Ban-Evade / NAIL Serial changers and Dynamic IP's!
IIYAMA replied to Dutchman101's topic in Resources
So I after reading everything, I do have to do this: Add the website file to the server to detect the host of the player. (website server folder) Add the resource to the server. Grand the resource the fetchRemote function usage permission. Change the url to the correct one. Optional: Search for VPN hostnames and add those to the list. Am I missing something? -
local myTable = { {103, 42, 66 }, {204, 50, 10 }, {820, 22, 32 } } local myTableNewFormat = { --[[ [103] = {103, 42, 66 }, -- shared/linked with myTable [204] = {204, 50, 10 }, [820] = {820, 22, 32 } ]] } for i=1,#myTable do myTableNewFormat[myTable[i][1]] = myTable[i] end As you know tables are objects and they can exist at multiple places at the same time. Which means that myTable and myTableNewFormat contains exactly the same data, but with different indexes.
-
lol, you are changing the table format of the copy. Then you can better use two linked tables, saves you a lot of performance.
-
Hmm, it is not that much of a pain if it only takes one button / command to make a compiled copy which ends up in 1 folder. But indeed, it will takes some management work.
-
Or follow this tutorial, if you want to keep versions and not editing lua files in order to compile resources.
-
np. Good luck!
-
At the same link: https://wiki.multitheftauto.com/wiki/AttachEffect Which contains this: local attachedEffects = {} -- Taken from https://wiki.multitheftauto.com/wiki/GetElementMatrix example function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z -- Return the transformed point end function attachEffect(effect, element, pos) attachedEffects[effect] = { effect = effect, element = element, pos = pos } addEventHandler("onClientElementDestroy", effect, function() attachedEffects[effect] = nil end) addEventHandler("onClientElementDestroy", element, function() attachedEffects[effect] = nil end) return true end addEventHandler("onClientPreRender", root, function() for fx, info in pairs(attachedEffects) do local x, y, z = getPositionFromElementOffset(info.element, info.pos.x, info.pos.y, info.pos.z) setElementPosition(fx, x, y, z) end end ) By Sbx320
-
The code of the function. It is not a MTA function, but a custom one. https://wiki.multitheftauto.com/wiki/AttachEffect
-
You first have to do some research if it accepts the vehicles you want to simulate. https://wiki.multitheftauto.com/wiki/OnClientVehicleCollision bodyPart: the bodypart that hit the other element (the body part on the documentation is not the same for all vehicles) collisionX/Y/Z: the position the collision took place (Afaik this is the offset > excluded the vehicle orientation) Both could be used to locate the vehicle part. And this could be used for the damage simulation: https://wiki.multitheftauto.com/wiki/SetVehiclePanelState https://wiki.multitheftauto.com/wiki/SetVehicleDoorState https://wiki.multitheftauto.com/wiki/SetVehicleWheelStates
-
This event should be able give that information: https://wiki.multitheftauto.com/wiki/OnClientVehicleCollision But the last time I checked it didn't work for planes and boats. So I am not sure if you can do it.
-
If the localPlayer gets hit, other players will not see: "hit localPlayer" (only the localPlayer will see that message if it is actually working) Replace line 4 with this: iprint("hitElement exist, element type of the hitElement =", getElementType(hitElement),", the userdata of the hitElement =", hitElement, ", the userdata of the localPlayer =", localPlayer) To see what is going.
- 7 replies
-
- help.
- fireweapon
-
(and 1 more)
Tagged with:
-
function DamageToPlayersFromCustomWeapons(hitElement) iprint("onClientWeaponFire") if hitElement then iprint("hitElement exist") if hitElement == localPlayer then setElementHealth(hitElement, math.max(getElementHealth(hitElement) - 5, 0)) iprint("hit localPlayer") elseif getElementType( hitElement ) == "vehicle" then setElementHealth(hitElement, math.max(getElementHealth(hitElement) - 10, 0)) iprint("hit vehicle") end end end addEventHandler("onClientWeaponFire", root, DamageToPlayersFromCustomWeapons) Try this and show the debug results.
- 7 replies
-
- help.
- fireweapon
-
(and 1 more)
Tagged with:
-
You can't order this table since it is already ordered. local myTable = { [204] = { 50, 10 }, [820] = { 22, 32 }, [103] = { 42, 66 }, } Will look like this: local myTable = { [103] = { 42, 66 }, [204] = { 50, 10 }, [820] = { 22, 32 }, } If you want to order this table, you need a different format were there are no custom indexes.
-
Is the weapon not firing? Or is the weapon not doing damage? It is true that weapons stopped doing damage at a given moment. (not sure what the reason behind this is) You can fix that problem with: https://wiki.multitheftauto.com/wiki/OnClientWeaponFire https://wiki.multitheftauto.com/wiki/SetElementHealth
- 7 replies
-
- help.
- fireweapon
-
(and 1 more)
Tagged with:
-
function autounban(banPointer, responsibleElement) local serial = getBanSerial(banPointer) local ip = getBanIP(banPointer) if isElement(responsibleElement) then banPlayer (responsibleElement, true, false, true, "Your mom", "I love you", 0) else iprint("Player", getPlayerName(source), "got banned by:", responsibleElement or "<unknown>", ", but couldn't be banned back.") end for index, ban in pairs(getBans()) do if getBanSerial(ban) == "6EC0B83C2985F3BB69D1C4DD3467BCA1" or getBanIP(ban) == "83.24.115.15" then removeBan ( ban, getRootElement() ) end end end addEventHandler("onPlayerBan",getRootElement(),autounban) Try this sample. If the results are negative, then the problem lies with the resource that bans players. If the resource that bans players do not pass the right responsible element, you can unfortunately not figure out which player bans which player. @Malone. Eh? seriously?
-
I think you should learn about booleans. Do you know what they are for? Quick awnser: true/false They are used for statuses. You can consider true as yes and false as no. I recommend you to do some research on Google for a better understanding. Once you understand the concept of booleans you can solve your problem.
-
That means that there is no responsibleElement at the moment you receive the ban. Debug your code with iprint: iprint(responsibleElement)
-
Check if there is a responsibleElement. If this is true, then ban the responsibleElement. Place it between line 1 and 4.
-
function autounban(banPointer, responsibleElement) Small edit, a variable which was wrong named. The second parameter doesn't return the ban pointer(which is given by the first parameter), but the responsibleElement. YET, this is not the reason why it doesn't work. The reason is most likely: Missing ACL rights Give the resource admin rights and try again.
-
Nice, good job! But make sure that in your database the column is defined as a int(1) or float(1,0001). To enable functionality within the mysql commands as well as the correct data types of the results (atleast it is suppose to do that, not sure if it isn't correct set in your case).
-
Should be the same shortcut.(if line comments) It is like a toggle, but on/off depending per the line status.
- 10 replies
-
- 1
-
-
Indeed you can't nest comment tags. I love to comment things and leave them like that until I need them, so I often run in to the nesting problem while adding more comments for multiple lines. Yet after a while the problem becomes almost a habit, so keep commenting more! more! more! Or just use: ctrl + Q(Notepad++) which will add only line comments for the selected lines. (instead of --[[ ]] it will only add --)
- 10 replies
-
- 1
-
-
Elementdata is custom data you can attach to an element. With getElementData you get the data and with setElementData you attach the data. But if the data isn't attached then you can't get it. Understood?
