Jump to content

Controlled

Members
  • Posts

    167
  • Joined

  • Last visited

Everything posted by Controlled

  1. hm.. Very useful! Do you think this would cause lag? Have you even read the onClientVehicleDamage ? It says at the last parameter; tyreID: A number representing the tyre which took damage, if there is one. Do you really have to be so condescending? Thanks for pointing it out, I will look into that now.
  2. hm.. Very useful! Do you think this would cause lag?
  3. But that makes the whole car damage proof, I just wanted to make it so people can't pop the tires on a vehicle with gun shots.
  4. Loving this so far, will you keep it updated with future versions of MTA? Also just a sublime question, instead of hitting enter and having the whole Syntax of the function pop up, is there a way to just autocomplete? Like I'm typing "addCo" have it autocomplete to addCommandHandler? Thanks again!
  5. Is there a way to set tires on a vehicle to be bulletproof?
  6. Found a small script that allows this, Solved otherwise but I'll post it for anyone else to use. local addCommandHandler_ = addCommandHandler addCommandHandler = function(commandName, fn, restricted, caseSensitive) if (type(commandName) ~= "table") then commandName = {commandName} end for key, value in ipairs(commandName) do if (key == 1) then addCommandHandler_(value, fn, restricted, false) else addCommandHandler_(value, function(player, ...) fn(player, ...) end, false, false ) end end end
  7. That doesn't really answer the question. I'm asking about addCommandHandler and executeCommandhandler. If they can have multiple commands like that, or if I have to do them on a individual line. addCommandHandler("getmods", getModInfo) addCommandHandler("getmod", getModInfo)
  8. Is something like this possible? function getModInfo(thePlayer) local veh = getPedOccupiedVehicle (thePlayer) if veh then executeCommandHandler({"getspeed", "getpower"}, thePlayer) else outputChatBox("You're not in a vehicle.", thePlayer, 255, 0, 0) end end addCommandHandler({"getmods", "getmod"}, getModInfo) I get the error, Expected String at Argument 1 for CommandHandler, got table. Is there another way then? Instead of having a annoying list on each line?
  9. Your asking people to make stuff for you. Your going to be ignored. Try it on your own, you were given examples how and shown how to move in the right direction. At least try to do it yourself.
  10. Personally I dont care about your sob story. If theres a will theres a way. Else go find someone else to script. There isn't a excuse for that and you shouldnt just be asking us to do stuff for you for free.
  11. Like already said in this post. Use dxDrawImage. Thats all the help you need.
  12. How can I make a gridlist, list in alphabetical order when I click on one of the columns? Right now clicking the column shows the arrow changing direction but doesn't update the list.
  13. Is it possible to use API's like strawpoll in MTA? https://github.com/KenanY/strawpoll If so how can it be installed to a server to be used?
  14. Controlled

    scare

    Quick improvement for server. function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name~=nil then -- Change this so "if name" actually does something. As you defined before you want it or nil. for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end addCommandHandler("scaree", function(player, command, target) local target = getPlayerFromPartialName(target) if target then triggerClientEvent(target, "scareJumpThem", target) end end ) Try this with the client. Root wasn't defined. function drawIt() -- Do whatever. end function scare() addEventHandler("onClientRender", root, drawIt) end addEvent("scareJumpThem", true) addEventHandler("scareJumpThem", getRootElement(), scare)
  15. Controlled

    Hello!

    You can post the script here and we can help you
  16. Then do what he said. Make a label and make a function that allows the player to edit it. Like change it to a edit box to change the text, then a button that applies the text to the label and removes the edit box
  17. addCommandHandler("spawn", function(player) local skinID = getElementModel(player) spawnPlayer(player, 2485.3604, -544.28711, 97.96978, 0, skinID) setCameraTarget(player) end) You should just look stuff up on the wiki for things like this. Its clearly on the spawnPlayer page.
  18. Actually figured this out on the wiki. For anyone else looking at this thread wondering too. if isElement( argument ) and getElementType( argument ) == "player" then
  19. Is their a function or way I can tell the difference between a ped or a player? if source==ped then return end if source==player then --continue Something like that...?
  20. Was wondering how to get a different math.random result if the number is the same as the last time. So in this script position is saved, and it checks if it was the old position. But I don't know how to get another math.random thats not the same.... heres the script pos = math.random(1,#cams); math.random(1,#cams); math.random(1,#cams) local x, y, z = cams[pos][1], cams[pos][2], cams[pos][3] if pos1 then if pos==pos1 then -- Something end end --pos = math.random(1, #cams) local tx, ty = cams[pos][4], cams[pos][5] local cx, cy, cz = cams[pos][6], cams[pos][7], cams[pos][8] pos1 = pos
  21. Please read these. It will help you understand how scripting in MTA works: https://wiki.multitheftauto.com/wiki/Sc ... troduction https://wiki.multitheftauto.com/wiki/Resources
×
×
  • Create New...