Jump to content

JR10

Retired Staff
  • Posts

    2,947
  • Joined

  • Last visited

Everything posted by JR10

  1. This might help: viewtopic.php?f=114&t=76913
  2. JR10

    INV Sys

    You can use "INSERT OR REPLACE". At least one column must be unique or primary key, or else it will just keep inserting. Here is an example: INSERT OR REPLACE INTO table (name, age) VALUES ("Test", 15) If the name column is unique and a row exists with "Test", and any other age, it will update the age to 15. If no row exists with "Test", it will insert one.
  3. Do you really expect custom client handling.cfg to work in MTA? Only servers can edit the handling, you can't edit your own handling.cfg.
  4. JR10

    Question

    I just tested and I guess you're right. Never even noticed that.
  5. JR10

    Question

    Does onClientChatMessage even trigger for such messages?
  6. Because you didn't remove the offsets. function funkcja(element) local x,y,z = getElementPosition(element) local _, _, rotation = getElementRotation(element) x = x - math.sin(math.rad(rotation)) * 3 y = y + math.cos(math.rad(rotation)) * 3 createExplosion(x, y, z, 6) end addCommandHandler("tak", funkcja)
  7. Try this: function funkcja(element) local x,y,z = getElementPosition(element) local _, _, rotation = getElementRotation(element) x = x - math.sin(math.rad(rotation)) * 3 y = y + math.cos(math.rad(rotation)) * 3 createExplosion(x + 10, y, z, 6) end addCommandHandler("tak", funkcja) Just adjust the number of meter (currently 3 in the script) to adjust the distance. addEventHandler sends two arguments, the player and the command name that was ran.
  8. This should work. function getPositionInfrontOfElement(element, meters) local posX, posY, posZ = getElementPosition(element) local _, _, rotation = getElementRotation(element) posX = posX - math.sin(math.rad(rotation)) * meters posY = posY + math.cos(math.rad(rotation)) * meters return posX, posY, posZ end
  9. setPedAnimation has a loop parameter, it might be why it's repetitive. Check the wiki page. setPedAnimation
  10. Check the wiki page of setPedAnimation, it has the full syntax of the function. You need two strings, one for block and one for anim. Check this list for animations: https://wiki.multitheftauto.com/wiki/Animations
  11. JR10

    [HELP]

    Killing the player would be better, I find blowing a vehicle when it falls in water undesirable.
  12. JR10

    [HELP]

    I'm assuming he wants something like in the race gamemode, when the player's vehicle falls in water he dies.
  13. JR10

    [HELP]

    It's kinda obvious, you should familiarize yourself with the error message a bit more. setElementHealth has two parameters, a userdata value representing the element and a float representing the health. You only sent the health. It should be: setElementHealth(player, 0) Another problem with your code is that you don't really send the player argument, so player won't be defined in the function. Refer to the wiki for the syntax of each function. The overall logic of your code is kinda wrong. I'm assuming you want to detect when a player is inside a vehicle in water, your code gets all the vehicles and not the one the player is in. If you still need help then explain more what your code should do.
  14. onPlayerChat will trigger whenever a player chats, we check for message_type to make sure that it's normal chat, not team nor /me. string.len will get the number of characters in the message. The fourth parameter in setPedAnimation is the time in milliseconds, that's why we multiplied the seconds by 1000 to get the milliseconds. You just need to replace block and anim with a string. addEventHandler("onPlayerChat", root, function(message, message_type) if (message_type) ~= 0 then return end local seconds = string.len(message) setPedAnimation(source, block, anim, seconds * 1000) --Specify the animation details end)
  15. Your added conditionals suppressed the warnings, but, when the condition is false, it returns and no code is ran. So, obviously the problem is the bone attach resource. I will try to experiment with it tonight.
  16. JR10

    [Question]

    He wants to block reconnect and quit not login and logout.
  17. JR10

    [HELP] KILL

    They're the same thing, except that he will have to move it to server-side because killPed is server-side only.
  18. JR10

    [Question]

    You can't with ACL and you can't with onPlayerCommand. You can't cancel/block/remove 'quit' and 'reconnect' commands, they're not like normal ones, for obvious reasons (any server can abuse that)
  19. JR10

    [Question]

    You can restrict access to the login and logout commands with ACL. But I don't think it's possible to restrict reconnect and quit.
  20. JR10

    [Question]

    No, you can't. They're hard-coded in MTA and can't be removed/blocked.
  21. This is not a forum for requests. Read this: viewtopic.php?f=91&t=47897
  22. JR10

    [HELP] KILL

    He said that he doesn't know what to "write" in the client-side script. Like I said, client side will definitely be more efficient since it has timers.
  23. Well custom animations are not possible. You will have to work something out using the default animations in GTA:SA. Check the zombie resource, it might help: https://community.multitheftauto.com/index.php?p= ... ils&id=347
  24. JR10

    [HELP] KILL

    When a player joins after the resource starts, it won't work for him. A client side approach would be better and more efficient, especially with the use of timers.
  25. JR10

    [HELP] KILL

    You don't need to trigger a server event; setElementHealth is both server and client side. And you don't need that second command. Also, why are you using next and getBoundKeys? You only need to specify the key that should be bound which is 'enter'. Client side: function kill() setTimer(setElementHealth, 5000, 1, localPlayer, 0) end addCommandHandler('kill',kill) bindKey ( "enter", "down", "kill" )
×
×
  • Create New...