Jump to content

NeonBlack

Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by NeonBlack

  1. I'm just here to inform. Nothing more. I agree with you that it was Tjong's decision to sell the script. But I disagreed with you withholding the detail that you haven't made FFS' carball resource from scratch (I heard attempts to reveal that got deleted) and according to your apparently slightly upset reactions it's a thing that matters quite much. As we are in the real world, all the people will draw their own conclusions about all this. I strongly doubt this will damage you or FFS in any noticable way long-term. So keep cool and carry on.
  2. Hello dear MTA community, I just wanted to leave this piece of information here (because knowledge is power): Tjong has sold his Carball mode and it's now used on FFS, i.e. (maybe the more important thing) on FFS there's an only slightly modified Carball script. Credits for Carball workarounds and stuff still go to Tjong. Have a link to the original announcement of this in the Neon forum. Discuss, spread, ignore – your choice. Greetings, NeonBlack (aka Firzen, Neon Administration)
  3. Hello, do you think there's any chance for me to get some of those old MTA:Race DM maps that were on servers like XIII, EPG or DDC years ago? Of course they kept those maps secret back then to stay exclusive, but today there's no server with these old maps, is there? So maybe one of the oldschool server keepers reads this and still has an unused archive with MTA:Race maps they could send me, I'd be happy. We'd use these maps on Neon United in the Classic Race Deathmatch mode. If you don't want them to be on Neon, please open a server with them. I think we can all agree that nobody has any advantages when they're just idleing on some HDD.
  4. So far the possibility to precompile Lua scripts has mostly been used to prevent clientside scripts from getting stolen and modified or even distributed as own work. If a scripter desires, they should be the only one deciding who is allowed to have and/or use script sources they created. If they want it to be open source, a valid alternative is leaving scripts uncompiled, yes. MTA opens a wide variety of creating really good effects and stuff clientside and more and more scripters use that to offer their players good experiences on their servers. However, they at least would like to have cool things they put much effort into exclusively on their servers or the servers they're scripting for, which is fully understandable. One of the most demotivating things is when a scripter puts lots of effort and time into a script for their server, only to have it stolen from someone, who makes his own server much more popular with the help of the stolen script. Thus leaving scripts uncompiled isn't a real option in most cases. On one hand the new MTA Lua compiler offers the possibility to encrypt scripts, on the other hand clients and servers will hold an unencrypted version anyway, as they'll need a decrypted version to be able to execute it, so the encryption might add another security layer, but it isn't breakable at all. In contrast to that it adds a very scripter-unfriendly system making them dependent on the official MTA server not only at compile-time, but also when servers and/or clients need to decrypt their scripts. This is a huge disimprovement that has the potential to seriously damage the MTA scripting scene. It's no loss offering this system optionally to those who want to use it, but making it mandatory is a very very bad idea. If anyone doesn't want to discuss that here or whatever I'm usually reachable in the IRC. My nick is Neon.
  5. The MTA Lua Compiler (http://luac.mtasa.com) is an online serverside application required to compile (and optionally encrypt) Lua scripts used for resources. This process seems to only happen on the official MTA servers, even when using one of the downloadable applications (mta_luac(.exe)). Apart from the fact that this means one will not be able to compile(/encrypt) scripts when the official server is unreachable or offline and that this builds up an infrastructure for collecting all scripts their authors mostly compile for the reason of protecting them from being stolen and/or abused I do not see the reason for why this procedure shouldn't be voluntary. The only reason to make it mandatory would be if the official MTA server/team/whatever took damage from something that's possible when using the default Lua compiler. I strongly doubt that. Your efforts to make MTA a secure and hardly hackable software are highly laudable, but professional scripters will definitely dislike having to do it this way. I would like to get to know the intention and the thoughts behind this system.
  6. NeonBlack

    Server list spam

    [uG] UnderCover Gaming DM+DD espxiineonlkoguagogamessg IP: 86.164.0.55:22003
  7. It started yesterday as I suddly was not able any more to join irc.gtanet.com. I thought maybe this problem solves itself and so I tried again today, but with the same result. The host cannot be resolved, so I think a ban is not the reason and in addition mibbit.com fails as well and downforeveryoneorjustme.com says gtanet.com is down. Just me excluded in a very mysterious way or is it really down? And if it's down: Why and why isn't a such important network not already up again? And why the fuck am I the first/only one(?) noticing and reporting this? Edit: I noticed now that there's an alternative host irc.multitheftauto.com... Do I really have been the only one using irc.gtanet.com? Edit2: Seemingly gtanet is just having DNS problems. Sorry for bothering you.
  8. Try printing out the elements' types by using getElementType on start and source.
  9. NeonBlack

    no idea..

    And you cannot add the event handler before defining the function.
  10. Neorange can has Oranges. :3 (once Neon)
  11. Hi, I'm from the NeoN GaminG multigaming clan and we just opened a new race server that shall be like XIII/EPG's one but not to compete against them but rather provide another great racing server if XIII/EPG's is (too) full. Our problem is that we don't have any nice maps so I want to ask all of you now if anyone of you would be so kind and provide us his map(s). We're searching for race, dd and especially dm maps. Unfortunately there seems no place where I can download any maps. Best regards, Neon(Black)
  12. I created a lua.xml for Notepad++, which contains all functions that are actually on the wiki. Therefore I needed function lists I took from the wiki. You can download the results of my day here. <.< And yes, I know, there's already an API and maybe also function lists, but some said they might be not actual and now it's too late anyway. (I already wasted my day ) So I hope this is useful for anyone. I'll try to keep them up to date. You might also post suggestions here. Maybe I'll add the Lua standard functions later. Lua.xml for Notepad++ (MTA DP2.3 + 1.0 functions from 06/04/2009 without Lua standard functions) MTA Function List (Server + Client, no doubles!) MTA Server Function List MTA Client Function List (Last update: 06/04/2009) The functions in the API should be all marked with “version/serverorclient:” in front of the function name. version can be dp2.3 or 1.0, dp2.3 are the deprecated functions, 1.0 are all functions that are compatible with MTA 1.0 (nightly). serverorclient can be sevrer, client or both. There are probably many functions with incorrect parameterlist or some other bugs since the wiki seems not to have the same syntax for every function entry. Just report such bugs. You can use the API by copying the lua.xml into your \Notepad++\plugins\APIs directory. You'll probably have to restart Notepad++ to use the function list. Go to Settings -> Preference... -> Backup/Auto-completion and set your auto-completion settings there. Then you will be able to use the API in any .lua-file. I hope this isn't completely useless. NeonBlack Last Changes: - added outputChatBox argument list since it's a common used function (06/04/2009)
  13. If you still need help... I had the same problem. If you have MTA SA DM installed you need to go into your GTA San Andreas directory and rename the folder named MTA to something like MTA_DM or MTA_backup or whatever, it must only be different from MTA. Then reinstall MTA Race and it should work fine. If you then want to play MTA SA DM again you must rename the MTA folder in your GTA SA directory to something like MTA_race and rename the MTA_DM or however you named it back to MTA. So finally you have to swap these folders by changing from DM to Race or vice versa. I hope I could help you.
  14. Did you pass the Function Name as a String?
  15. NOTE: Who ever used my Explode Function before 27th June 2008 should get the new Version! The old one has a bad Bug! I edited the Explode Function. I was tired of creating a new Event for every Function I wanted to call from Client to Server or vice versa, so I made a CallClientFunction and CallServerFunction Handler. You'll have to add this Script server-side: function CallClientFunction(client, funcname, ...) triggerClientEvent(client, "OnServerCallsClientFunction", getRootElement(), funcname, unpack(arg)) end function CallServerFunction(funcname, ...) _G[funcname](unpack(arg)) end addEvent("OnClientCallsServerFunction", true) addEventHandler("OnClientCallsServerFunction", getRootElement(), CallServerFunction) And this Script must be added client-side: function CallClientFunction(funcname, ...) _G[funcname](unpack(arg)) end function CallServerFunction(funcname, ...) triggerServerEvent("OnClientCallsServerFunction", getRootElement(), funcname, unpack(arg)) end addEvent("OnServerCallsClientFunction", true) addEventHandler("OnServerCallsClientFunction", getRootElement(), CallClientFunction) Then you can use void CallClientFunction(element player, string function, [arguments...]) SERVER-SIDE and void CallServerFunction(string function, [arguments...]) CLIENT-SIDE NOTE: Neither CallClientFunction nor CallServerFunction return Anything! This is, no Data is passed by returning something if you use one of these Functions! And here also the Complement to FormatNumber: number UnformatNumber(string formattedNumber, string comma, string milsep) function UnformatNumber(formattedNumber, comma, milsep) if (milsep) then formattedNumber = formattedNumber:gsub(milsep, "") end if (comma) then formattedNumber = formattedNumber:gsub(comma, ".") end return tonumber(formattedNumber) end
  16. SetVehicleLightState: I experimented a bit with this Function and it seems randomly not to work... First tries on the front Lights worked well, as I started trying to break the rear Lights it just reset the Game Time to 0:00. With a Command that switches off both rear Lights I got them off, but there was no Way to get them back on, just resets the Game Clock. Also, after I broke the rear Lights the Front Lights also just reset the Game Clock to 0:00. So after breaking and reparing some Lights the Function just resets the Game Clock. Really randomly. SetVehicleDoorState: Does only work for all Doors, so the Door Argument doesn't do anything. State 1 is the same as State 0. State 3 and 4 work. For all my Testings I used a Sentinel. Should work with it.
  17. Hi Scripters, I made a Skin-Selection for my Server where you get three Keys Bound: One to choose the next Skin, one to choose the previous Skin and one to Change the Gender of the Skins. It protects already used Skins (that are saved in a MySQL Table) from being used another time and just shows civil Skins. (No Police, Medical or not working ones) So my Server Script loads a List of already Used Skins and stores it in a Table named dbUsedSkins. It also loads an xml-File, which contains Information about every Skin like SkinID, Type (civil, not working, police, ...) and Gender (male or female). All the Information from the XML File is stored in a Table called dbSkins with a Syntax like dbSkins[skinid][field] (field = gender or type). If now a new Client joins the Game the Server sends both Tables to the Client via triggerClientEvent and the Client Script stores them in Script-Global Tables named like the ones in the Server Script. If the Player in the Skin Selection now presses the Key to get the next Skin, a repeat until Loop is called, which increases the actual skinid until the Skin with the skinid... ... is working. (Not "fucked") ... has the same Gender as the actual Skin of the Player. ... is not listed in dbUsedSkins. If the Script found the next SkinID that fulfills these Conditions it sets it as the new Skin of the Player. (setPlayerSkin) The Problem now is that this (changing the skin to the next one) takes very much time, which should not be and can not be. I can't find any logical reason for the long Loading time... (Sometimes MTA even freezes because of loading so long) I arranged the relevant Code Snippets and posted them on the MTA Pastebin. » http://mta.pastebin.com/m574cd26e I appreaciate any Help or even Questions or at least if you read this Posting Hope I get this Problem solved. Greetz, Neon. PS.: You may download an exported Version of my Skin Selection on http://www.neon-rpg.de/files/skinsel.zip. Please note that it won't work the first Time you join the Server because the Client Events are called before the Resource is loaded. Second Time should work, because then you already downloaded the Client Script.
  18. Yes, Objects also use txd-Files as Textures and you can also change them. Almost every Model and Texture is stored in gta3.img. Hmm, never tested it but maybe it will cause Problems because of Object Properties. Just try it and look also for an ide Tutorial, where Syntax is explained... There might be more than one txd-File for one dff-File. You should just add them all. Too much txd's won't cause any Problems, if they don't have the same Name like any other Texture that does not belong to the added dff. They are either for Tuning Paintings or just for making the Car's overprint dynamic.
  19. More Functions. This time for Strings and formatting Numbers. int Encrypt(string string) Returns a Hash (Integer). For Example used to save Passwords so that nobody can read them. I used the Adler-32 Algorithm. function Encrypt(string) local length = #string local s1, s2 = 0, 1 for n=1, length do s1 = (s1 + string.byte(string:sub(n, n))) % 65521 s2 = (s2 + s1) % 65521 end return (s2 * 2^16) + s1 end table Explode(string separator, string ensemble) Splits ensemble at all Occurrences of separator and stores the Pieces in a Table, which is returned. function Explode(separator, ensemble) local i, j = 1, ensemble:find(separator) local pieces = {} while (i) do if (j) then j = j - 1 end table.insert(pieces, ensemble:sub(i, j)) if (j) then i = j + #separator j = ensemble:find(separator, i) else break end end return pieces end string FormatNumber(number number, [int digits=0, int decimals=0, string komma=".", string milsep]) Needs the Explode() Function! Formats any Number and returns the formatted Number as a String. If digits is greater than the Number of digits of number it will fill up with Zeroes. If it's smaller the Number of Digits won't be changed. decimals sets the Number of Digits after the Comma, if it's greater than the Number of Decimals of number it will fill up with Zeroes, else it will cut off the Rest without rounding. komma sets the String that shall replace the Decimal Point. Useful for People like me who come from Germany, where a "," is used to separate floating Point Numbers. Finally milsep sets the String that should separate Thousands. If you leave this nil Thousands won't be separated. function FormatNumber(number, digits, decimals, komma, milsep) digits = digits or 0 decimals = decimals or 0 komma = komma or "." local strNumber = Explode("%.", tostring(number)) strNumber[2] = strNumber[2] or "0" if (milsep) then local revint = strNumber[1]:reverse() strNumber[1] = "" for block in revint:gmatch("%d%d%d") do strNumber[1] = strNumber[1]..block..milsep end strNumber[1] = strNumber[1]..revint:sub(-(#revint % 3)) strNumber[1] = strNumber[1]:reverse() if (#strNumber[1] % 4 == 0) then strNumber[1] = strNumber[1]:sub(2) end end if (digits > #strNumber[1]) then strNumber[1] = string.rep("0", digits - #strNumber[1])..strNumber[1] end if (decimals == 0) then return strNumber[1] end if (decimals < #strNumber[2]) then strNumber[2] = strNumber[2]:sub(1, decimals) else strNumber[2] = strNumber[2]..string.rep("0", decimals - #strNumber[2]) end return strNumber[1]..komma..strNumber[2] end Greetz, Neon PS.: All of my Functions may have Bugs. If you finde some, report them in this Thread please.
  20. Because I could not find any Thread like this on the Forums I decided to start one on myself. You may post your Useful Functions, Commands and Code Snippets here so that the others can use them and don't have to script on their own. I'll start with three useful functions concerning Date and Time. int GetTimestamp([int year, int month, int day, int hour, int minute, int second]) Returns the UNIX Timestamp of any Date after 1st January of 1970 ignoring Summertime(!) (of course as an Integer) All Arguments are optional, GetTimestamp() returns the UNIX Timestamp of the actual Datetime. function GetTimestamp(year, month, day, hour, minute, second) local i local timestamp = 0 local time = getRealTime() local monthDays = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } if (not year or year < 1970) then year = time.year + 1900 month = time.month + 1 day = time.monthday hour = time.hour minute = time.minute second = time.second else month = month or 1 day = day or 1 hour = hour or 0 minute = minute or 0 second = second or 0 end for i=1970, year-1, 1 do timestamp = timestamp + 60*60*24*365 if (IsYearALeapYear(i)) then timestamp = timestamp + 60*60*24 end end if (IsYearALeapYear(year)) then monthDays[2] = monthDays[2] + 1 end for i=1, month-1, 1 do timestamp = timestamp + 60*60*24*monthDays[i] end timestamp = timestamp + 60*60*24 * (day - 1) + 60*60 * hour + 60 * minute + second return timestamp end table GetDateTime(int timestamp) Needs the IsYearALeapYear() Function! Complement to GetTimestamp. Returns a Table like GetRealTime does but without yearday and isdst. Note: It returns a year like 2008, you will not have to add 1900 like in getRealTime()! Also the Months start at 1 and end at 12! function GetDateTime(timestamp) local i local time = {} local monthDays = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } time.year = 1970 while (timestamp >= 60*60*24*365) do timestamp = timestamp - 60*60*24*365 time.year = time.year + 1 if (IsYearALeapYear(time.year - 1)) then if timestamp >= 60*60*24 then timestamp = timestamp - 60*60*24 else timestamp = timestamp + 60*60*24*365 time.year = time.year - 1 break end end end if (IsYearALeapYear(time.year)) then monthDays[2] = monthDays[2] + 1 end local month, daycount for month, daycount in ipairs(monthDays) do time.month = month if (timestamp >= 60*60*24*daycount) then timestamp = timestamp - 60*60*24*daycount else break end end time.monthday = math.floor(timestamp / (60*60*24)) + 1 timestamp = timestamp - 60*60*24 * (time.monthday - 1) time.hour = math.floor(timestamp / (60*60)) timestamp = timestamp - 60*60 * time.hour time.minute = math.floor(timestamp / 60) timestamp = timestamp - 60 * time.minute time.second = timestamp local monthcode = time.month - 2 local year = time.year local yearcode if (monthcode < 1) then monthcode = monthcode + 12 year = year - 1 end monthcode = math.floor(2.6 * monthcode - 0.2) yearcode = year % 100 time.weekday = time.monthday + monthcode + yearcode + math.floor(yearcode / 4) yearcode = math.floor(year / 100) time.weekday = time.weekday + math.floor(yearcode / 4) - 2 * yearcode time.weekday = time.weekday % 7 return time end boolean IsYearALeapYear(int year) Returns true if the year was/is/will be a Leapyear, else false. function IsYearALeapYear(year) if ((year % 4 == 0 and year % 100 ~= 0) or year % 400 == 0) then return true else return false end end You may also post feedback. Greetz, Neon
  21. Because I could not find any Thread like this on the Forums I decided to start one on myself. You may post your Useful Functions, Commands and Code Snippets here so that the others can use them and don't have to script on their own. I'll start with three useful functions concerning Date and Time. int GetTimestamp([int year, int month, int day, int hour, int minute, int second]) Returns the UNIX Timestamp of any Date after 1st January of 1970 ignoring Summertime(!) (of course as an Integer) All Arguments are optional, GetTimestamp() returns the UNIX Timestamp of the actual Datetime. function GetTimestamp(year, month, day, hour, minute, second) local i local timestamp = 0 local time = getRealTime() local monthDays = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } if (not year or year < 1970) then year = time.year + 1900 month = time.month + 1 day = time.monthday hour = time.hour minute = time.minute second = time.second else month = month or 1 day = day or 1 hour = hour or 0 minute = minute or 0 second = second or 0 end for i=1970, year-1, 1 do timestamp = timestamp + 60*60*24*365 if (IsYearALeapYear(i)) then timestamp = timestamp + 60*60*24 end end if (IsYearALeapYear(year)) then monthDays[2] = monthDays[2] + 1 end for i=1, month-1, 1 do timestamp = timestamp + 60*60*24*monthDays[i] end timestamp = timestamp + 60*60*24 * (day - 1) + 60*60 * hour + 60 * minute + second return timestampend table GetDateTime(int timestamp) Needs the IsYearALeapYear() Function! Complement to GetTimestamp. Returns a Table like GetRealTime does but without yearday and isdst. Note: It returns a year like 2008, you will not have to add 1900 like in getRealTime()! Also the Months start at 1 and end at 12! function GetDateTime(timestamp) local i local time = {} local monthDays = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } time.year = 1970 while (timestamp >= 60*60*24*365) do timestamp = timestamp - 60*60*24*365 time.year = time.year + 1 if (IsYearALeapYear(time.year - 1)) then if timestamp >= 60*60*24 then timestamp = timestamp - 60*60*24 else timestamp = timestamp + 60*60*24*365 time.year = time.year - 1 break end end end if (IsYearALeapYear(time.year)) then monthDays[2] = monthDays[2] + 1 end local month, daycount for month, daycount in ipairs(monthDays) do time.month = month if (timestamp >= 60*60*24*daycount) then timestamp = timestamp - 60*60*24*daycount else break end end time.monthday = math.floor(timestamp / (60*60*24)) + 1 timestamp = timestamp - 60*60*24 * (time.monthday - 1) time.hour = math.floor(timestamp / (60*60)) timestamp = timestamp - 60*60 * time.hour time.minute = math.floor(timestamp / 60) timestamp = timestamp - 60 * time.minute time.second = timestamp local monthcode = time.month - 2 local year = time.year local yearcode if (monthcode < 1) then monthcode = monthcode + 12 year = year - 1 end monthcode = math.floor(2.6 * monthcode - 0.2) yearcode = year % 100 time.weekday = time.monthday + monthcode + yearcode + math.floor(yearcode / 4) yearcode = math.floor(year / 100) time.weekday = time.weekday + math.floor(yearcode / 4) - 2 * yearcode time.weekday = time.weekday % 7 return timeend boolean IsYearALeapYear(int year) Returns true if the year was/is/will be a Leapyear, else false. function IsYearALeapYear(year) if ((year % 4 == 0 and year % 100 ~= 0) or year % 400 == 0) then return true else return false endend You may also post feedback. Greetz, Neon
×
×
  • Create New...