Jump to content

IIYAMA

Moderators
  • Posts

    6,062
  • Joined

  • Last visited

  • Days Won

    208

Everything posted by IIYAMA

  1. hhhhmmm first check your syntax. local noobf.aggios = { f.aggio1, f.aggio2, f.aggio3 --... } for index, allf.aggios in pairs (noobf.aggios)do -- index is left, not right. if isElement (allf.aggios) then -- some vehicles can be delete by adminpannel(or something else) you will get errors/warnings. Check with isElement(). respawnVehicle (allf.aggios) end end I will not recommend you to use "." between normal value's, but I leave the script for what it is. and no I don't know what you mean. Check if people are inside: https://wiki.multitheftauto.com/wiki/Ge ... eOccupants
  2. IIYAMA

    Prompt

    https://wiki.multitheftauto.com/wiki/SetFogDistance (never tried you have to try some values) For more FPS improvements: (trust me these seriously help) https://wiki.multitheftauto.com/wiki/SetHeatHaze setHeatHaze (0) or maybe when you car in the air. https://wiki.multitheftauto.com/wiki/SetCloudsEnabled setCloudsEnabled ( false )
  3. The problem with your script was that local data won't exit the function. local cars = 0 function onenter (player) cars = cars+1 --local cars = cars+1[/color] outputChatBox (cars, root) end addEventHandler ("onVehicleEnter",root,onenter) local A = 0 if A then > local A = A +1 -- local will not exit > outputChatBox(A) -- in the chatbox you will see "1" because it is in the function.(local) end outputChatBox(A) -- in the chatbox you will see "0" Try the function/event of denny, it is the best/fastest sample.
  4. IIYAMA

    draw distance

    300 is maximum of distance units. I force all my clients to load everything on 300 so the objects will be loaded at eagle speed. I also like to go more then 300, pity it won't be supported. 10000! I also put setfarclipdistance to 600 (gta san world) (normal is 400) https://wiki.multitheftauto.com/wiki/SetFarClipDistance Farclipdistance can only de-increase the load distance from elements when you put the settings lower then 400, but it gives a nice overview.(nice for mapping) 600/800 is ok I tried 20000 farclip it was laggy, but when I put 1000000 my gta started to crash
  5. You mean, move the map you made from location? http://mta.dzek.eu/mmove/ else your question is unclear.
  6. You can set it to nil. But will the account + keyword still remain? With tables it can't be removed like this. playerT= {} playerT[1] = player playerT[1] = nil #playerT --1 --playerT={nil} but table.remove(,) Also when you use key names like this. playerT={} playerT[player]={} playerT[player]=nil -- #playerT does not work. (not in fake array) It will probably look like this: playerT={[player1]=true,[player2]=true} and when nil: playerT={[player1]=nil,[player2]=nil}
  7. Ik heb dat inladen van client files ook geprobeerd of althans dat denk ik, alleen het werkte niet Voor niet belangrijke dingen gebruik ik gewoon 1 timer en een table. Voor hele belangrijke informatie die toch vaak uitgevoerd moet worden gebruik ik, onClientRender/onClientPreRender in combinatie met tick-count. Ik heb het niet zo op timers, zelfs voor respawn van spelers gebruik ik een timer van 0.5 sec die door een table loopt. Niet erg precies althas maar verhinderd heel veel lagg. Niet op mijn manier, script in totaal is al over de duizend regels heen. (niet alles is wapens, maar wel player sync "movement")
  8. hmm not yet, I will check it out. Thank you! btw: will it unbind the keys or only disable them? ("This means that any keybinds or MTA binds are overidden")
  9. Well I am not sure, some how the bug is temporary gone. But at that moment I was 100% sure it was admin. I checked admin and I found only 1 single bind and one single unbind P
  10. Hello I have a problem with my binds, when I make client binds in my script and I open admin pannel and close it, the mouse binds are stopping working. very strange.... Is it possible that admin unbinds all mouse binds? NOTE: only with admin pannel It is very annoying because this script has been made to replace the gta/mta san controls....
  11. aha Ik script eigenlijk alles wat te maken heeft met wapens, serversync en anti lagg. Zo als server/client sync damage, voertuig kills (mensen hun voertuig stuk schieten en killen), voertuigwapens, anti bind systeem (zonder krijg je veel bugs en animaties die falen +teleportatie). en ben nu eindelijk bezig met mijn eigen gamemode, spy vs spy (death-match mode) en klein beetje gebaseerd op btf3. Ik kan je verzekeren dat het veel code is, al probeer ik het zo klein mogelijk te houden. that kind of shit.
  12. Denny voor wat voor gamemode script jij?
  13. I mean add this in your code so scripters can help you more. Because I am not going to read your whole script. I have other things to do. 1 add outputDeBugString in your script. Like this: function myfunction outputDebugString ("myfunction got started") end 2 : login as admin 3 : write /debugscript 3 and see how far your script goes, etc.
  14. use: outputDeBugString ("till here"), in your code. so you can see with /debugscript 3 what went wrong.
  15. I had something else on my mind. Well maybe it is handy to use one timer to update some non important stats. Save it within the tables and update the database when the timer get executed. Tables are still in the memory they can easy and fast be changed, but a database write directly/indirect on the hard drives.(as far I know) Unload the tables after you store the data. Of course there can be a risk when the power falls off or crash. (with in this second) Make sure you script will store the data after the resource stops. It is just how I would do it. Probably some people are against it. Only slow data.
  16. and try out getTickCount() --Script can only executed every 1 second (tickcount is in milliseconds) local lastControlFire = 0 function myFunction () if 1000 - (getTickCount()-lastControlFire) < 0 then lastControlFire = getTickCount() end end Nice for add to gui buttons, or something that works on onClientRender or onClientPreRender. (No timers needed your onClientRender is your timer and will take real time, does not matter how much fps lagg you got. It will always be circa 1 second.)
  17. return or remove the event. or post your script......
  18. omfg server side. selling = createMarker (getElementPosition ( source ) , "Cylinder", 4.0, 255, 0, 0, 255 ) UPDATED
  19. selling = createMarker ( x, y, z [, "Cylinder", 4.0, 255, 0, 0, 255 ] ) must be: selling = createMarker ( x, y, z, "Cylinder", 4.0, 255, 0, 0, 255 ) He forgot to remove the " [] " from the wiki.
  20. Is this possible? setVehicleEngineState(vehicle, not state) ? function toggleEngine(source) local vehicle = getPedOccupiedVehicle(source) if vehicle then if getVehicleEngineState(vehicle) then setVehicleEngineState(vehicle, false) else setVehicleEngineState(vehicle, true) end end end addCommandHandler( "engine", toggleEngine )
  21. Elementdata you only use on server side will lagg you bandwidth. It will give you more code+time, but it will reduce lots of ping lagg in the future. Since you use bots, it will require double+ of players their internet speed. Add to much Element data and you have teleporting peds. Use instead Tables: local botsTable[bot] = {} local botsTable[bot]["bot.animation"] = true -- or anim etc. if botsTable[bot]["bot.animation"] then local anim = botsTable[bot]["bot.animation"] end -- you can also put it in "array"(mta does have a kind of array, but it also not array) when you need it. table.insert (botsTable,bot) --or local i = 1 botsTable[i]=bot -- i = index 1,2,3,4,5 --[[NOTE:]] botsTable[#botsTable+1] = bot --[[]] table.insert(botsTable,bot) botsTable[i]["bot.animation"]= "lol" for i, bot in ipairs(botsTable) do -- botsTable[i] = bot if isElement(bot) and thisBot == bot then outputChatBox(botsTable[i]["bot.animation"]) botsTable[i]["bot.animation"]= "new lol" end end -- clear elements when they got destroyed, don't loop while to much. While can crash your server when your code might be incorrect. for i, bot in ipairs(botsTable) do while botsTable[i] and not isElement(bot) do table.remove (botsTable, i) end end
  22. IIYAMA

    Admin

    Not very clear: if isObjectInACLGroup("user." ..accountname, aclGetGroup("Admin")) then outputDebugString ("Admin") elseif isObjectInACLGroup("user." ..accountname, aclGetGroup("SuperModerator")) then outputDebugString ("SuperModerator") end elseif is for spilt the admin from the supermoderator and will only be checked when the if isn't true. It is faster than if end/if end/if end.* if admin then -- check elseif mod then -- check only when if is false. else -- only when if and elseif are false. (false when not true or not exist>elseif) end You can also write it down in a table when they are with more then 4/5 for efficiently. I don't know what is faster, ipairs or elseif. It probably depends on the amount of data. I prever ipairs, because it reduce the lines. local accountname = getAccountName(getPlayerAccount(thePlayer)) for i, type in ipairs({"Admins","SuperModerator"}) do if isObjectInACLGroup("user." ..accountname, aclGetGroup(type)) then end end
×
×
  • Create New...