Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/07/17 in all areas

  1. New update added, changes: - This time actually made the promise of low server/client performance usage, true. More optimizations. (resource eats only about 0.15% server CPU now - Improved sync, added option to select syncer by lowest ping (disabled by default; change in variable .lua, may cause issues with players that have low FPSes..) - Added option to disallow players hurting eachother while in the zombie field (variable in clientside .lua, called 'noPVP') - Added option to respawn back players in the zombie-field when they die while in the area, at the hands of a zombie. (so only for participants) (variable in serverside .lua) - Adjusted position of player zombiekill stats and made its box scrollable if too many players join the area for it to fill up. New admin commands: - /wipefield (removes all players inside the zombiefield, you can use this for various purposes like many AFKers distracting zombies to their positions for no good) - /populate (selects and warps 5 random players to the zombie field; use with care, depending on your gamemode it may disrupt players if they get warped without asking for it; might be useful hosting zombiekill events) Bug fixes: - Fix limitation you could only headshot zombies. Now, you can shoot them anywhere on the body or blow them up.
    2 points
  2. Debugging Do you know what debugging is? You might think you do, but unfortunately (in my opinion) only ~15% of the scripters in the community do know the full definition of it. Many people think that debugging code is the same as looking in to the Debug Console and waiting for warning + errors to show up. That's indeed debugging and yet it never provide all information you need to build your scripts. It only can say what goes wrong at a certain line. With other words, the Debug Console by default will only show a limited amount of mistakes you have made in your code. So what is next? You fixed all warnings and errors and yet it doesn't work. You start with making your code visible! I guess 70% would think: Making code visible? Ehhh how??? Let me write it down a little bit different: By using Debug Information making the behaviour of the code visible. I guess 50% would think: Eh what? behaviour of code????? Let me give you an example. Example: (1) outputDebugString("the script has started") -- < this is a debug line if true then outputDebugString("code works here") -- < this is a debug line else outputDebugString("code shouldn't be working here") -- < this is a debug line end Debug console "the script has started" "code works here" The debug console is NOT information for players, it is information for YOU developers! BTW this is a debug line outputDebugString("test") -- < this is a debug line In this case it is just a piece of code that shows information in the debug console. Example: (2) local playerName1 = "snake1" local playerName2 = "cow" if playerName1 == playerName2 then outputDebugString("players playerName1 and playerName2 do share the same name. Name: " .. tostring(playerName1)) -- < this is a debug line else outputDebugString("players playerName1 and playerName2 do NOT share the same name. playerName1: " .. tostring(playerName1) .. ", playerName2: " .. tostring(playerName2)) -- < this is a debug line end Debug console "players playerName1 and playerName2 do NOT share the same name. playerName1: snake1, playerName2: cow" Easy isn't? The concept behind this debug method is to see what the code does / doesn't execute. Is this method handy? It is actually the very basic of debugging, for code that doesn't contain any errors/warnings. I would say it is handy and it is a very powerful method too. It is also handy for people who do not know how to script. If you want people to help you with your code, but you do not know what is wrong with it. You can add those debug lines and point out to where the code stops working. This will make it more efficient for you and the scripter to work out the problem, because the scripter knows where to look. How much debug lines do you have to add to your script? 1? 10? 100? 1000? You could start with around 100 debug lines and as you learn how to script, you can reduce it to 10+ debug lines. Too much debug lines are not always good, because they will give you too much information and it will cost time to manually filter them. So I recommend you to remove some of them afterwards. When you are finished with the tested code, you can remove 90+% of them. Feel free to disable them instead of removing them, if you know that you are going to need them again. For complex code, I use around 25 debug lines, SO DON'T HOLD BACK! Render events It is strongly recommended to remove debug lines that are executed on onClientRender/render events when you are finished with your code. Because that can have influence on the smooth fps.(It will not drop much of the fps, but it can make it feel unsmooth) Clearing the debug console? /cleardebug Know your tools: outputDebugString -- Show a message on the Debug Console bool outputDebugString ( string text, [ int level=3, int red=255, int green=255, int blue=255 ] ) --- outputConsole -- Show a message on the F8 panel. bool outputConsole ( string text ) -- client bool outputConsole ( string text, [ element visibleTo=getRootElement() ] ) -- server --- inspect -- Convert one mixed value to a string. string inspect ( mixed var ) --- print -- Show a message on the terminal / serverwindow / Debug Console. bool print ( string var1[, string var2, string var3...] ) --- tostring() -- Convert a value in to a string. (but for objects/elements, inspect works better) --- iprint -- Show a message on the terminal / serverwindow / Debug Console (convert multiple mixed values automatic to string, no need for tostring or inspect) bool iprint ( mixed var1[, mixed var2, mixed var3...] ) --- outputChatBox -- You can also debug with outputChatBox (even though it is less efficient) bool outputChatBox ( string text [, int r=231, int g=217, int b=176, bool colorCoded=false ] ) -- client bool outputChatBox ( string text [, element visibleTo=getRootElement(), int r=231, int g=217, int b=176, bool colorCoded=false ] ) -- server Debug message levels 0: Custom message 1: Error message 2: Warning message 3: Information message (default) Addition by @Hale https://wiki.multitheftauto.com/wiki/OutputDebugString Advanced tools: local line = debug.getinfo(1).currentline -- get the line of the script where the code has been executed. 1 = current function. (can be useful if you want to get the line where this function has been called from) https://www.lua.org/pil/23.1.html WIKI MTA: WIKI MTA debugging tutorial/information. https://wiki.multitheftauto.com/wiki/Debugging
    1 point
  3. https://community.multitheftauto.com/index.php?p=resources&s=details&id=14568 Decided to go for a zombies script from scratch instead of relying on old and outdated ''zday'' zombies or slothboth. These zombies will follow you and try to kill you, once they get too close you'll be dead before you know it so make a good defense line. Location is open field near SF airport, zombies will only spawn and work inside that colshape. When player enters it (atleast one player must be there for any zombies to spawn and exist) he will see a stats window counting and saving his zombiekills, deaths and headshots on zombies. These stats will get saved to account if player is logged in. I will add a video demonstration soon. Zombie skins total size (34 gore skins): 250kb only (heavily optimized) and zombie moan/groan sound files about 77kbit each, no strain on client performance nor server (by the way, you can edit the amount of zombies and other variables in the beginning of zombies_s.lua;
    1 point
  4. Don't forget that the search function is fully functional: As for the vote/help manager, you never mentioned what you want to change, the outputChatBox messages?
    1 point
  5. والله لو 100000 واحد قلدو اسمك انت فـ قلوب الناس ما تنساك ...
    1 point
  6. addEvent("Retirefrominternet", true) addEventHandler("Returefrominternet", root, function()
    1 point
  7. Check if the vehicle entering is a Rhino ( event handler onvehicleenter ), and if it is, cancelEvent() my keyboard ain't workin correctly.
    1 point
  8. ؟؟no such mod installed }deathmatch}
    1 point
  9. You should set interior/dimension server side only. I had problems with this in the past as well.
    1 point
  10. # تحديث جديد تم اضافة خاصية حظر اللاعب وفك الحظر بإستخدام اللوحة - تم اضافة ملف ديربي معدل وكامل لجعل الحظر يعمـل - تم اضافة معلومات لـ استخدامها اذا اردت حظر شخص بملف الديربي الخاص بـك - تم اصلآح بعض المشاكـل - #
    1 point
  11. 1 point
  12. It really doesn't show any errors/warnings? Because you can't possibly store elements (ie. teams) in account data. However, you could store the team name and then use getTeamFromName to set the team.
    1 point
  13. I wasted hours fixing a completely perfect script of mine until I just went YOLO and changed the command because there was nothing else left to do Fun times... (not)
    1 point
  14. Who would actually think that the problem might be with the command name..? I found out the hard way as well... You're welcome.
    1 point
  15. I think this situation is related to: https://forum.multitheftauto.com/topic/97169-hello/ right? Same host, he said that he lost access, I advise you to talk to him to find out more but I can tell you: we can't really help you. But what I do know is that you guys (CIP server etc) have been surrounded by many issues, debates and disputes, of hacking, resource stealing accusations, infecting MTA players with rat viruses (for which CIP clan member got banned) and generally thinking you can come to the forums and seek some higher-up action. You are in other words, a very problematic group of people who come to the forums and expect MTA staff to solve your misery created by dealing with unreliable people/not securing your server environment. So I would ask kindly to tell everyone at CIP to stop doing that and try to take care of your own business by preventive measures. @Origin and @envy
    1 point
  16. Salut, Tiens sur le Wiki directement il y a quelques pages en français, sinon tu peux apprendre le reste en anglais: https://wiki.multitheftauto.com/wiki/FR/Introduction_Programmation https://wiki.multitheftauto.com/wiki/FR/Ressources https://wiki.multitheftauto.com/wiki/FR/Introduction_GUI Je recommande souvent aussi ce tutoriel LUA en français, qui est simple et compréhensible: http://wxlua.free.fr/Tutoriel_Lua/sommaire.php
    1 point
  17. There you go, I have it since MTA 1.4 came out it's a RAR archive since the executable doesn't work with other than MTA 1.3.5 https://mega.nz/#!Aw4wjAxL!75tSMz1CTenosiKBXi2ka9NTMvKDpkecAa3WyHobgl8
    1 point
×
×
  • Create New...