Jump to content

IIYAMA

Moderators
  • Posts

    6,064
  • Joined

  • Last visited

  • Days Won

    209

Everything posted by IIYAMA

  1. 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.
  2. 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.
  3. IIYAMA

    Water level

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

    Water level

    setTimer setWaterLevel wiki knows everything.
  5. 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.
  6. addEventHandler ( "onResourceStart", resourceRoot, function() triggerClientEvent ( "m1", resourceRoot ) end)
  7. 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.
  8. 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.
  9. https://wiki.multitheftauto.com/wiki/GetVehicleType
  10. @roddydennvor It is all on the wiki. https://wiki.multitheftauto.com/wiki/PlaySound
  11. This section is NOT for requesting. Give that a try on the resource section.
  12. Player must be defined as source. and the first argument(of the function) is the last account he was in.
  13. 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%)
  14. You forgot to define how much it repeats: setTimer(hay,2000,1) 1 = 1 time 10 = 10 times 0 = infinity
  15. what if you disable streaming?
  16. and when does it hang in the air?
  17. hellList = { -- stars were put for privacy reasons ["***569FE453BD4260ECAB1BA18F382A2"]=true, ["***C4B55138CDE1251CC684759FB23F2"]=true, ["***0FD3104DD5F1768A20CA2E6C8AEA3"]=true, ["***DEF127AD04771C1CB847F0B480BE3"]=true, ["***E4510F78C3E0AB1474292DACAADC4"]=true, ["***24608511608C41E9D94A3D4E7F742"]=true, ["***02F041B50CC509B1CC9EEA81F6EA2"]=true, ["***96EEFFA5FE6B5E9A826ABF4A25584"]=true, ["***790600040ABF44115F80E117841E4"]=true, ["***49AD57FD37519BBA9A1DADD168D12"]=true } function cIsPlayerBanned(noob,serial) if not isElement(noob) then return false end local serial = serial or getPlayerSerial(noob) if serial then if hellList[serial] then outputDebugString("player is banned") return true else outputDebugString("player isn't banned") return false end end return false end syntax cIsPlayerBanned(noob [,serial]) -- use as: cIsPlayerBanned(noob) -- or cIsPlayerBanned(noob,serial)
  18. Something like this. You can't prevent the dead, but you can prevent dying/getting hurt. local dataTransferLimiter = false addEventHandler("onClientPlayerDamage",localPlayer, function (attacker, weapon, bodypart,loss) if not dataTransferLimiter and getElementHealth(source) <= loss then triggerServerEvent("doDeadAnimation",localPlayer) dataTransferLimiter = true cancelEvent() end end) addEventHandler("onClientPlayerSpawn",localPlayer, function () dataTransferLimiter = false end) addEvent("doDeadAnimation",true) addEventHandler("doDeadAnimation",root, function () if isElement(client) then end end)
  19. Players cannot make animations while dead. It is possible, but you have to prevent the player to die.
  20. @yoya99 READ IT! Function which is responsible for the changes: setPlayerHudComponentVisible
  21. The script is fine, one of your other resources is making the radar visible again.
  22. https://wiki.multitheftauto.com/wiki/FromJSON Note: Indices of a JSON object such as "1": "cat" are being returned as string, not as integer. [ { "2": 175614 } ] JmyTable[2] local index = 2 JmyTable[tostring(index)] JmyTable["2"]
  23. Take a look at this, an example structure: local timers = { [userdata] = { -- [userdata] ["playerData1"]={ -- ["playerData1"] data1,-- [1] getTickCount() -- [2] }, ["playerData2"]={ data1, getTickCount() }, ["playerData3"]={ data1, getTickCount() } }, } --[[ timers [userdata] ["playerData1"] [1] timers[userdata]["playerData1"][1] = data1 timers[userdata]["playerData1"][2] = getTickCount() ]] and how does this work? local bufferedTable = timers[player] -- we index ones if not bufferedTable then -- we check if there is a player at this index, if not we set it. timers[player]={} -- < this table will be in the variable bufferedTable at the line below bufferedTable = timers[player] -- we index ones again and making sure the player has it's table anyway. end So what do we have now? The table structure is now: local timers = { [userdata] = {} -- = bufferedTable } These are some basic stuff, the base of our data storage. Now lets add our archive. bufferedTable["playerData1"] = {data1,getTickCount()} So what do we have now? The table structure is now: local timers = { [userdata] = { -- = bufferedTable ["playerData1"] = { data1,getTickCount() } } } Lets do it again: bufferedTable["playerData2"] = {data1,getTickCount()} The table structure is now: local timers = { [userdata] = { -- = bufferedTable ["playerData1"] = { data1,getTickCount() }, ["playerData2"] = { data1,getTickCount() } } } You have to see it as layers. Or like the folder structure at your windows pc: Like: D:\Program Files (x86)\MTA San Andreas 1.4 Lets make a table of it: --D:\Program Files (x86)\MTA San Andreas 1.4 myMTALocation = { ["D:"]={--D: ["Program Files (x86)"] = {--\Program Files (x86) ["MTA San Andreas 1.4"] = {--\MTA San Andreas 1.4 ["mods"]={},--\mods ["MTA"]={},--\MTA ["screenshots"]={},--\screenshots ["server"]={},--\server ["skins"]={},--\skins "Multi Theft Auto.exe",--\Multi Theft Auto.exe "Uninstall.exe"--\Uninstall.exe } } } }
  24. of course you need another table. Every time you index a table, it is requires a table, as simple as that. if time and client then timers[client] = {time} -- time at pos [1] end
×
×
  • Create New...