Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. Of course it returns false, there is no variable called: targetPlayer there. And it DOEN'T RETURN THE PLAYER NAME, IT RETURNS A PLAYER. When you put a userdata in to a grid list, it becomes a string. This is what it does: local targetPlayer = tostring(localPlayer) -- convert the userdata to a string local player = findPlayerByUserDataString (targetPlayer) -- find the player who is matching this userdata string. Use it between line 104 and 105. (clientside) It looks like you don't know which types of data there are out there. Use the function type(variable) to figure that out, it returns the type. This link might help you: https://wiki.multitheftauto.com/wiki/De ... strategies
  2. no, one side. clientside or serverside. The first one is just a useful function. The second one is how you can use the function.
  3. I understand now what you mean. Except how do I know which characters do I have to ignore? string.gsub is also using these special characters, so I can't replace them using that.
  4. IIYAMA

    a question

    https://wiki.multitheftauto.com/wiki/Dx ... entEnabled
  5. Line 20. if killer == localPlayer then
  6. getElementsByType("player") already is a table, no need to overheat your code. If you convert usedata to strings, you can't convert them back. Try: function findPlayerByUserDataString (targetPlayer) local players = getElementsByType("player") for i=1,#players do local player = players[i] if targetPlayer == tostring(player) then return player end end return false end local player = findPlayerByUserDataString (targetPlayer) But managing a table next to your gridlist is much better.
  7. That are a lot of characters. Is there a way to disable the function of the special characters while comparing?
  8. It is only that character which causes this problem?
  9. local reactionCharacters = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"} local reactionSpecialCharacters = { "!","@","~","&","#","$","%","*","?","+","-","_" --[[,"^",,"`" ,"(",")",,,"=","{","}","[","]",";",":","'",'"',"|","<",",",">",".","/",]] } local function playerChat(message, messageType) if messageType == 0 then --Global (main) chat if newReaction then if string.match(message,newReaction) then outputChatBox("Good result.") cancelEvent() end end end end addEventHandler("onPlayerChat", root, playerChat) I am trying to make a reaction system. But with some characters math.match don't work. Does anybody knows which ones don't work? Thank you very much.
  10. IIYAMA

    Water level

    yes I can see you do it by command, but the command: /waterlevel 30 ? afaik yes, the race resource is editing the water level every round you play. But has nothing to do with admin rights.
  11. IIYAMA

    Water level

    Lets start with the SECOND code. Is it serverside? and how did you execute this?
  12. IIYAMA

    Water level

    setTimer setWaterLevel wiki knows everything.
  13. Why resourceRoot? Because else it triggers for every resource you start. and why triggering resourceRoot? Because you want to make sure you know what you are sending through. and why it doesn't work? Because the client hasn't loaded his code before server side already triggered the event. You would have seen that inside your debug logs if you debugged it, but no of course you didn't......... Adding onClientResourceStart at clientside would do better the job.
  14. addEventHandler ( "onResourceStart", resourceRoot, function() triggerClientEvent ( "m1", resourceRoot ) end)
  15. He did the responsive element (resourceRoot) correct, so his code is not as inefficient as yours except for the ipairs part. If you had other code executed by that event, you would have bugs. it is only so WTF that WASSIm. isn't explaining his changes.
  16. Seriously Bilal135, writting code for a requester? If you are too stuppid to support the rule breakers, use atleast the pm system. From those requests we only get more requests and this section loses it's purpose. You are also destroying it for yourself.
  17. https://wiki.multitheftauto.com/wiki/GetVehicleType
  18. @roddydennvor It is all on the wiki. https://wiki.multitheftauto.com/wiki/PlaySound
  19. This section is NOT for requesting. Give that a try on the resource section.
  20. Player must be defined as source. and the first argument(of the function) is the last account he was in.
  21. IIYAMA

    [HELP] Please

    buy a better pc... Gta is a VERY old game, seriously. Anyway you can set up the draw distance in your menu. Settings > video: Draw distance (slider 0 t/m 100%)
  22. You forgot to define how much it repeats: setTimer(hay,2000,1) 1 = 1 time 10 = 10 times 0 = infinity
  23. Yea, try clientside.
  24. what if you disable streaming?
  25. and when does it hang in the air?
×
×
  • Create New...