-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
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)
-
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)
-
Players cannot make animations while dead. It is possible, but you have to prevent the player to die.
-
@yoya99 READ IT! Function which is responsible for the changes: setPlayerHudComponentVisible
-
The script is fine, one of your other resources is making the radar visible again.
-
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"]
-
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 } } } }
-
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
-
You don't have two tables. Remove that [1] Your index isn't 1, it is only the client.
-
Well check the variables(if the table has it's data etc.) and at which part it stops working.
-
Empty the grid list first. https://wiki.multitheftauto.com/wiki/GuiGridListClear
-
look at the syntax. Function is second argument. If you want to know when the process is completed, you can call your finished function between line: 30 and 31. Example/test run: local theTable = {3,5,36,547,36,3,8,9,3,6,7,8,5,4,7,8,4,8,5,2,2,1} function executeProcess (index, par) outputChatBox(tostring(index) .. " " .. tostring(par)) -- do your stuff here -- end startSlowLoop ( theTable, executeProcess, 5) Afaik you need the code, then you test it. Go ahead.
-
@Drakath No there isn't, you have to sync the data like your player is sync his position to the server. So as you said a timer and triggerServerEvent. Depending how critical the data is, will require another update rate. How critical is the data and must it be secure? Because there is also clientside saving.(which can be edited by smart guys and will not be included at other pc's you play it on)
-
I don't think that is possible and even if it is possible, there isn't guaranteed it will reach the server. Connection will be broken after unloading of the resources.
-
https://wiki.multitheftauto.com/wiki/Is ... rBoxActive
-
My version, not tested. local slowLoopTable = {} local maxItemsPerLoop = 30 local slowLoopFunction = function (theTable) local tableData = slowLoopTable[theTable] if tableData then local startValue = tableData["startValue"] local endValue = tableData["endValue"] local processFunction = tableData["processFunction"] for i=startValue, endValue do tableData["processFunction"](i,theTable[i]) end local maxItemsPerLoop = (theTable["maxItemsPerLoop"] or maxItemsPerLoop) local newStartValue = endValue+1 if newStartValue <= #theTable then tableData["startValue"] = newStartValue local newEndValue = newStartValue+maxItemsPerLoop if newEndValue > #theTable then tableData["endValue"] = #theTable else tableData["endValue"] = newEndValue end --tableData["timer"] = setTimer(slowLoopFunction,400,1,theTable) resetTimer (tableData["timer"]) else slowLoopTable[theTable] = nil end end end function startSlowLoop (theTable,processFunction,itemsPerLoop) local slowLoopTimer = setTimer(slowLoopFunction,400,1,theTable) if slowLoopTimer then local maxItemsPerLoop = tonumber(itemsPerLoop) or maxItemsPerLoop -- protect the variable against overwrite if maxItemsPerLoop > #theTable then maxItemsPerLoop = #theTable end slowLoopTable[theTable]= { ["timer"]= slowLoopTimer, -- can be useful for a quick abort and reset. ["startValue"]= 1, ["endValue"]= maxItemsPerLoop, ["maxItemsPerLoop"]= maxItemsPerLoop, ["processFunction"]= processFunction } end end --[[ supports multiply tables ----------------------------- ]] syntrax startSlowLoop ( theTable, processFunction [, itemsPerLoop = 30] ) Send to process function. ( index, par )
-
Study triggerClientEvent, which is about communication between serverside to clientside. https://wiki.multitheftauto.com/wiki/TriggerClientEvent Watch the examples with care.
-
Car speed can be locked by adjust: https://wiki.multitheftauto.com/wiki/SetControlState
-
XML is slow, you should load it slowly. without what to be exact?
-
I just gave you that and you are too lazy to check it out. this is the scripting section, not the request section.
-
You are creating a line, one of your rotation (x or y)as is depending on your start and end point of the line itself. Also it would be named as: "dxDrawImage3D" Start---------------------end Start | | | | | end
-
server https://wiki.multitheftauto.com/wiki/Se ... amageProof client > nitro https://wiki.multitheftauto.com/wiki/Cl ... _functions
-
np. As long as you understand, that I am here to spend my time to help you with scripting.
