-
Posts
6,062 -
Joined
-
Last visited
-
Days Won
208
Everything posted by IIYAMA
-
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?
-
By downloading them using triggerEvents.(which is I don't consider as a clean way)
-
You have to do this serverside. As client you do not have the full authority to change the behaviour of other players. You can change it, but with the next synchronisation update it will be reset. And most importantly, it can cause desync for the players. The structure of the code is original serverside based, see syntax of outputChatBox when used serverside. outputChatBox And don't forget to debug the code in all possible ways, see debug tutorial for a better way to figure out what your code does and doesn't.
-
Yes, shaders ONLY = https://community.multitheftauto.com/index.php?p=resources&s=details&id=11071 Which gives you strange enough low fps.
-
It is better to ask a guy with the same language as you, so that you/he can write down the context of the issue.
-
Hmm really strange. I am sorry, I don't think I can help you with this one. Looks like something is going wrong with the streaming system. You could try an older version of mta and see if you have the same problem, if that is false you could report it.
-
lol Well you cannot without shaders, since gta wasn't created to support that.
-
hmm, shouldn't be a problem. Is this the only code / related resource that is active?
-
See this resource: https://community.multitheftauto.com/index.php?p=resources&s=details&id=11071 By @Ren_712
-
Very strange. Did you tried it with a stronger pc? (even though I doubt that a default pc couldn't handle 20 peds)