-
Posts
866 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Mr_Moose
-
(login remember me system)Are MTA Serials 'reliably unique'?
Mr_Moose replied to LonelyRoad's topic in Scripting
Don't be lazy, encryption isn't hard at all and some clients can't protect their files in a good way, what if they play on a computer with many other users too etc.. Anyway it's your own choice if you want to deal with angry users who lost their account due to bad security. -
Version 1.4.8 released Main focus this time has been on performance and optimization as well as preparation for the 1.4 release of MTA which in this case is about the brown streak carriages, the only thing that is missing from making this the perfect train system for all kinds of servers in general. Compression and streaming out features will now work without mixing up the carriages on different tracks, trains will also stop permanent at the blocks and slow down near train stations to pickup and drop off passengers and cargo before it continues it's path. Changes in 1.4.8: * Improved sync performance by 10x * Tested in MTA 1.4 with brown streak carriages (works) * Fixed a bug in the stop blocks described in comments * Optimized default values
-
Well after using google and searching for the above provided sentence you need to click on the links that appears to visit the page where you can find the information you search for. Let me suggest this for instance: the first result which contains a youtube video where a guy setup port forwarding in that router. You already have the ports 22003, 22005 and 22126 specified. Good luck.
-
Not sure if you can hide scrollbars since they seem to appear automatically on overflow, but you may try this function: https://wiki.multitheftauto.com/wiki/GuiSetProperty
-
(login remember me system)Are MTA Serials 'reliably unique'?
Mr_Moose replied to LonelyRoad's topic in Scripting
Autologin should be optional since some players might join from public computers, to make a unique identification you could probably combine multiple parameters for example serial and ip, otherwise the best solution is probably to store the account data on the users local computer by saving an xml file client side, just remember to encrypt passwords and other secret data. -
Turned out that it didn't saved properly but the USB sticks was a good idea at lest, the server is now back on windows 7 which is probably even more amazing with that performance but still no lag at all even thought it runs advanced RP scripts.
-
Check out AC RP turn indicators: http://mta.albonius.com/index.php?topic=262.0 https://www.youtube.com/watch?v=IRuc8ylOnFw, way more efficient than the one you showed in the video since it uses the current existing vehicle lights instead of adding new.
-
Set this to resolved, I managed to fix it, see it live here: http://mta.albonius.com/s1/. The solution was "simple", Linux puppy was the solution, the 8GB USB stick for the actual OS and server and the 2GB one to transfer files, works out of the box without hard drives and if the remaining parts of the server fails I just move the USB stick to another computer. Linux puppy only takes 128MB RAM and loads the entire OS into the memory, that means it's really fast as a server and 1GB is not that bad for an MTA server as long you got the right scripting skills. Remember that this used to be on Windows 7, which is way more heavy to run. I guess I'll post a tutorial about this later since it's a pretty good idea after all, if you don't trust me just visit the server, I will keep it up 24-7 now.
-
After running an MTA server on windows7 24-7 for a long time on an old HP Compaq nx7000 notebook, the hard drive broke down and all that's left working is the remaining components and 2 USB sticks in 8GB respectively 2GB connected to USB2.0, I've been running Linux from USB before but this time it should be optimized for best performance for an MTA server, so basically which Linux distribution would you recommend for this purpose. (Old notebook computer and USB storage). Some specifications: CPU: (32-bit) 1.4GHz RAM: 1.25GB Network: 100Mb/s up and down Storage: USB stick 8GB respective 2GB connected to USB 2.0
-
It's all about basic math, then you can apply the exact same method on all GUI elements: local sx, sy = guiGetScreenSize() local posXCenter = (sx-guiX)/2 -- Center of x local posXRight = (sx-guiX) -- Right side local posXLeft = 0 -- Left side The same can be applied on y, another thing to remember is that all of these are relative to it's parent element, for example a button which has a GUI window as parent will have it's (0,0) point in the top left of the window, root element in this case is the screen of any player.
-
Thanks, I know something was misspelled, corrected anyway if I or anyone else makes a better group system for this I'm ready to modify it to work better from the beginning, currently it's still some stuff to fix no matter what group system that is used but as long it's open source I hope it shouldn't bee too hard.
-
Ever searched for a turf system in the community with the hope to find what you're actually looking for? Well this is your lucky day, this is a turf system based on open source which uses an SQLite database to create radar/map areas (colored squares) to fight about, even thought I was against this idea of colored squares in a limited area, I soon realized that this is exactly what people expect from a turf system. This one is even better than that. Download link: https://community.multitheftauto.com/index.php?p=resources&s=details&id=9056 Help and support: Bug reports Related questions Demo server But why should we stop in a limited area, well I can't answer that question by myself so due to that you will find turfs in all three city's (around 50 in total). To provoke a turf you need to either be in the team "Criminals" or "Gangsters", you need to create these teams manually in order to make this work. Another requirement is to be a member of a group or gang. By default this system uses the exported function "outputTopBar" from ac-message which can be found here: https://community.multitheftauto.com/index.php?p=resources&s=details&id=8620, if you don't want to use that you can simply replace "outputTopBar" with "outputChatBox". setElementData(player,"Group","any_name_here") This can also be solved by using a group system and for that I recommend this: https://community.multitheftauto.com/index.php?p=resources&s=details&id=8291 since it's also open source. Below is a part from the "data.lua" file which is used to configure the system "for dummies" members_in_turf = {{ }} -- Counts the amount of players in each group in each turf capturing = { } -- Boolean to check whenever someone is trying to capture a specific turf cooldown = { } -- Cooldown timer to prevent spam kills for stats farming time_syncer = { } -- Timers to update the client status text with information about how much time is left to capture a turf db = dbConnect("sqlite", "/turfs.db") -- Database connection (SQLLite), mysql is supported as well, see syntax for dbConnect here: -- [url=https://wiki.multitheftauto.com/wiki/DbConnect]https://wiki.multitheftauto.com/wiki/DbConnect[/url] payout_time_interval = 10800 -- Time interval between payments for owned turfs (seconds). turf_payments_max = 400 -- Maximum payments for 1 single turf during payouts. Multiplyed by turfs count divided by gangmembers count turf_payments_min = 200 -- Minimum payments for 1 single turf during payouts. (See above) lowest_amount_to_display = 50 -- Specify the lowest amount of money which is worth to notice the players about during payouts. group_system_name = "GTWgroups" -- Used for exported functions in the group system in case you want a different name of the resource file top_bar_messages = "GTWtopbar" -- (See above) team_criminals = "Criminals" -- Specify teams that are allowed to turf team_gangsters = "Gangsters" -- (See above) money_pickpocket_max = 1000 -- Specify how much (or less) money the gangmembers will pickpocket from their enemies during a kill inside a turf money_pickpocket_min = 50 -- (See above) armor_max = 35 -- The maximum amount of armor the killer will get after killing an enemy armor_min = 5 -- The minimum amount of armor the killer will get after killing an enemy weapon_stats_max = 50 -- The maximum amount of stats for the current weapon the killer will gain after killing an enemy weapon_stats_min = 5 -- The minimum amount of stats for the current weapon the killer will gain after killing an enemy turf_capture_payment_max = 3000 -- Maximum payment for capturing a turf turf_capture_payment_min = 1000 -- Minimum payment for capturing a turf time_to_capture_max = 360 -- Maximum time before a gang captures a turf (seconds) time_to_capture_min = 180 -- Minimum time before a gang captures a turf (seconds) Also note that line 12 and 13 are useful to set the name of the two exported functions globally in case you want to use a different filename. Installation: 1. Check the file names of your resources, top bar messages and a group system on line 12 and 13 in data.lua. It's important that those names match exactly. 2. The group system you use must have support for turf colors, and a exported function that can pass these colors to this turf system, to solve that simply add the above function in your group system server file. function getGroupTurfColor(group) if (not groupTable[group]) then return 255, 255, 255 end local color = fromJSON(groupTable[group][6]) return color[1], color[2], color[3] end 3. Make sure your group system has exported the getGroupTurfColor function by looking at it's meata.xml file where this line should exist: <export function="getGroupTurfColor" type="server"/> Further questions can be asked within this thread.
-
There isn't many packages containing all RPG resources but you might check the community for individual resources. I got some useful RP and RPG resources which you can use. https://community.multitheftauto.com/index.php?p=profile&id=361446
-
@-stolka- https://community.multitheftauto.com/index.php?p=resources&s=details&id=8620, there you go, just remember to change the name in either export or the actual filename so it matches.
-
create a cooldown timer: cooldown = setTimer(function() end, 30*60, 1) and check if it exists by using: if not isTimer(cooldown) then -- Do something end if you plan to use this server side (multiple players), use a table: cooldown = { } -- Creates the table cooldown[thePlayer] = ... -- Assign a timer for a specific player (call this inside the function) if not isTimer(cooldown[thePlayer]) then --Check for a specific player -- Check if a cooldown timer for a specific player not exist and does something end
-
I came up with a solution to the original problem which was "How to check if a player is admin or moderator client side", updated my reply to make it clear.
-
Could probably be like that, most functions and events which is originally made for single elements but applies the same properties to their source elements merging and creates new functions like setElementHealth() for instance, which used to be setPlayerHealth(), setVehicleHealth() (If I remember correct), etc.. Anyway I had this issue in my store robbery script not long ago which also was supposed to protect peds from getting killed.
-
server triggered clientside event but event is not added
Mr_Moose replied to nikitafloy's topic in Scripting
In this case you should run this payment system on the server completely as the others described. The reason for your error however is because the server trigger the client event when the resource is started, at that moment, none of the clients has finished their downloads of this resource. -
It says ped in the wiki and I managed to cancel it for peds as well in v1.3.5. Unless if it's changed recently it should work for peds too.
-
Note, this is a solution to the original problem. By using the onPlayerLogin server side and set a value, for example: setElementData( thePlayer, "staff", level ) where "level" would represent a number that is equal to the rank of the players acl group level. This value can then be accessible from any resource both server and client and you can set it to nil onPlayerLogout to save some memory (not required due to security aspects). As a final complement to this you might also make commands to promote and demote players admin level and then sync this element data value at the same time. I guess that's the easiest (and safest) solution.
-
I think you need onClientPlayerStealthKill event too since stealth kills might not trigger onClientPlayerDamage. Not sure about it thought.
-
function changeTurfColor(plr, cmd, r, g, b) local r, g, b = r or 255, g or 255, b or 255 local group = exports["ac-groupsys"]:getPlayerGroup(plr) if (not group) then return end if (not exports["ac-groupsys"]:checkGroupAccess(plr, 13)) then return end dbExec(db, "UPDATE turfs SET red=?, green=?, blue=? WHERE owner=?", r, g, b, group ) for w,area in ipairs(getElementsByType("radararea")) do if getElementData(area,"owner") == group then setRadarAreaColor( area, r, g, b, 130 ) end end end addCommandHandler("turfcolor", changeTurfColor) This is the part where the turf color is changed, in the groupsystem you'll find a command handler with the exact same name which saves the turf color to the group system database, meanwhile this will save the same data to the turf system database. First of all you need to make sure that the filenames matches, the groupsystem default filename is not "ac-groupsys" so make sure that you change the code to the same file name as the groupsystem has. Secondly make sure that you have the resource ac-message installed: https://community.multitheftauto.com/index.php?p=resources&s=details&id=8620 (Works out of the box) And finally, make sure that all required functions are exported in the group system by checking it's meta.xml file. These two should be added: <export function="getGroupChatColor" type="server"/> <export function="getGroupTurfColor" type="server"/> Version 0.8.9 will have it's own settings file and use less exports so another option is to wait for that to be released. Probably within a week or so. Edit: You might also look at the element data in which a player group is stored, the groupsystem may use something else than "Group" by default and that would cause issues, add "Group" to the scoreboard and see if your group is there or not. There might also be a couple of modifications in the group system related to the turfcolors, this is what I'm using currently in the group system: function changeTurfColor(plr, cmd, r, g, b) local r, g, b = r or 255, g or 255, b or 255 local group = getPlayerGroup(plr) if (not group) then return end if (not checkGroupAccess(plr, 13)) then return end if (not groupTable[group]) then return end local color = {r, g, b} dbExec(db, "UPDATE groups SET turfcolor=? WHERE name=?", toJSON(color), group) groupTable[group][6] = toJSON(color) exports["ac-message"]:outputTopBar("Turf colour changed to R: "..r.." G: "..g.." B: "..b, plr, r, g, b, "default-bold", true, 0.15) groupLog(group, getPlayerName(plr).." has set turf color to: "..r..", "..g..", "..b) end addCommandHandler("turfcolor", changeTurfColor) Compare with yours and maybe you find something more that isn't synced. Also try to download the latest version to make sure that there isn't more than this to change.
-
Well this is a beta version and the current version of this turf system (0.8.9) is currently only available in AC RP, there are still a couple of bugs to resolve before the next version will be uploaded, you can follow the bugs and their solutions here: http://mta.albonius.com/index.php?board=8.0 and report other bugs you may find in the AC RP scripts. The recommended group system is this: https://community.multitheftauto.com/index.php?p=resources&s=details&id=8291 and you might also modify it since it doesn't use "Group" as default name for groups or gangs by default. It must be manually changed to make it synced between the group system and the turf system.
-
Then it's called a "dummiecar", create it with a local pointer client side, change the color on the client then when the configuration is done and the user press ok or spawn you save the configuration in local variables but removes the actual car. After that you should trigger a server event, pass the configuration parameters and then spawn a car server side that looks exactly like the client sided car you just removed.
-
onVehicleEnter is triggered after the player has entered the vehicle and the animation is finished, if you goanna use removePedFromVehicle then it should be used with onVehicleEnter, otherwise it won't have any effect. The same applies for onVehicleStartEnter which will trigger at the same moment a player presses the enter key and there is a vehicle nearby, by cancelling onVehicleStartEnter the animation won't even start so this is the best solution when it comes to blocking people from entering police cars. Also remember that removePedFromVehice won't have any effect if it's triggered from onVehicleStartEnter since the ped isn't even in the vehicle at that moment. The example made by Nikolai96 is only useful if both onVehicleStartEnter and onVehicleEnter trigger the same function, in that case the resulting function will block players that for example is warped into a police car by a staff of the server or similar. Could be useful too but don't forget to verify that the player you tries to remove is inside the vehicle by calling: getPedOccupiedVehicle(player thePlayer) If that value is nil or false then you shouldn't call removePedFromVehicle since it would cause errors.