-
Posts
866 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Mr_Moose
-
@IIYAMA Unlike you I expected mega9 to be smart enough to realize the fact that a undefined variable points at nil and therefore it can't be indexed. The original question was about multidimensional arrays or tables, that has nothing to do with what you can use in order to index each row, the rows doesn't even need an index either, there are many ways to solve this kind of issue in, but just because everyone doesn't use your solution doesn't mean they are idiots. @mega9 You do realize that all you did was to create a bad implemented table, index it to nil, and then change it to a regular one dimensional array like you had in the first place. [ and ] should not be used in one dimensional arrays only in multidimensional ones like in my first example. If you want a sample that works out of the box then you should specify the details in the description.
-
@Citizen I remember that video, that's actually what's inspired me to make my train script which also has all the features you need to attach a train, see the videos: https://www.youtube.com/watch?v=ap6h331MfRo https://www.youtube.com/watch?v=cxEMsUCEsUI And here's the script: https://community.multitheftauto.com/index.php?p=resources&s=details&id=8060 Automatic trains https://community.multitheftauto.com/index.php?p=resources&s=details&id=8338 Vehicle system with support for trains with multiple locomotives attached. This includes a sync algorithm, creation of trains and sync of tracks as well as distance between carriages, the first video demonstrates a script similar to what you saw in Citizen's video but with a player that drives the train instead. Since the carriages is spawned in the same location they will sync the distance to eachothers as soon a player is nearby. See this: https://forum.multitheftauto.com/viewtopic.php?f=108&t=72085 for more details on how you can use this feature and good luck.
-
No problem at all then, try this: local exampleTable = { [stringKey1] = { "Value 1", "value 2", "value 3" }, [stringKey2] = { "Value 1a", "value 2a", "value 3a" }, [stringKey3] = { "Value 1b", "value 2b", "value 3b" } } Multidimensional table if that's what you asked for
-
local exampleTable = { [stringKey1] = "Value 1", [stringKey2] = "Value 2", [stringKey3] = "Value 3", } That should do the trick.
-
There used to be one as far as I remember but I can't find it currently, maybe it's removed. Anyway I could also reccomend this one: https://community.multitheftauto.com/index.php?p=resources&s=details&id=8338 which is a vehicle spawn system but you are able to lock, spawn from a GUI with some payment features, sell/return rental vehicle, it's probably easier to use this rather than making a new vehicle shop system from scratch.
-
That's origionally the AC RP robbery script which was made using the exported function outputTopBar from "ac-message" which has the same syntax as outputChatBox, however due to complaints from lazy players who didn't wanted to download and use this: https://community.multitheftauto.com/index.php?p=resources&s=details&id=8620, I had to write a special version for mta community, however since this bug was a part of the current script it ended up in the final version, it will be upgraded soon due to the amount of dowanloads. Solution: Line 111, server, change from this: outputChatBox( "Robbery sucsessfull, you earned: "..tostring(money), crim, 0, 150, 0 ) to this: outputChatBox( "Robbery sucsessfull, you earned: "..tostring(amount), crim, 0, 150, 0 ) Do not remove the local on line 66, server since that will give all players the same amount during any robbery and change it while a store is robbed in case another player is robbing. The variable should be local and passed as an argument to the function payForRob which is used to verify that the players actually stayed in the store until the time expired and avoid getting arrested or killed.
-
A complete vehicle system might also be a good solution: https://community.multitheftauto.com/index.php?p=resources&s=details&id=8338 This one let the players spawn or rent vehicles from markers with GUI's and destroys the vehicles when the player logs out, spawn another one or destroy it by themselves with a command, exploded vehicles are cleaned up as well so it's very performance effective. Since it's also using pointers in a table it's easy to create an admin GUI for instance with a list over all existing vehicles where you as a staff can manage them or whatever, and of course it also includes some other interesting features like headlight control by pressing the L key, locking system etc. Luckily vehicles doesn't require very much performance in the first place and the whole idea of removing a vehicle after 30 seconds unused as you suggested may lead to complaints from your players since most players finds it annoying to loose a vehicle in this game.
-
Correct syntax for setPedAnimation is: setPedAnimation ( ped thePed [, string block=nil, string anim=nil, int time=-1, bool loop=true, bool updatePosition=true, bool interruptable=true, bool freezeLastFrame = true] ) You forgot to specify the animation block for your animations, take a look here to see which blocks you should use according to your animations, I guess they are in the same block named dance or something You may also use a # to get the length of your table instead of that loop local randomDanceAnimID = math.random(#DanceTable) And last detail, setting this on the client will result in that only you will see the animation, other players won't see you dance so either user triggerServerEvent or convert the entire script to the server.
-
Well I was actually talking about the police resource which I also described first, which contains the police job and the wanted level system, and now you're trying to buy the entire server for just 30$ or trade with some other scripts you for from your "friend" since his server with "200" players doesn't exist anymore? Seems completely unlogic to me to be honest and it looks a lot like those classical scammers we face every day. Anyway I will continue to upload high quality scripts and I do appreciate your visit and the fact that you liked my realistic law system. I rather work on my own conditions and publish my work for free and accept donations instead of selling my scripts.
-
I got a interesting CnR system currently which may still be considered as a beta version but it's still pretty advanced, not sure if I'm goanna sell it but I may upload it in the community within the upcoming weeks if everything works as it should then. Some of the features: Complete police job with support for other law teams stored in a array like Army, FBI, SWAT and SAPD /criminal - command to join the criminal team /fine - to get rid of your wanted level if no cops are nearby and you can afford it /wanted - a list of wanted players, their location and distance /jail and /unjail for staff Using the current police departments interiors as jail and police officers actually have to deliver the arrested players into their cells literally Tazer (silenced) Up to 30 reasons to get wanted, everything from killing, aiming or attacking players and vehicles to derail a train, drive too fast, steal government vehicle, attacking mailboxes etc. These functions are also exported so you can add more "crimes" in other resources. Ability to calculate the distance to nearest cop, criminal etc (This is how the tracking works currently) Support for kill arrests, arresting suiciders or evaders, violent status to indicate whenever it's allowed for cops to perform a "kill arrest" or not, Ability to use any vehicle during transport to jail and you may enter and exit it however you want and even switch vehicle during transport Relative values like jailtime, payments etc, it's all depending on the suspects wanted level Reducing and increased wanted level, to reduce your wanted level you need to be really far away from any cop, otherwise it may increase /wl - to see your actual wanted level as a float (usefull when it goes above 6 stars) In total there is around 4000 lines of code so if you're interested feel free to have a look at it.
-
Soon it's time for the official release of version 1.4.7, see feature list below. Features: Guaranteed open source code Improved the sync algorithm with support for accordion technique, this means that the train compress and decompress after a certain distance from the sync player, by using this technique there is 0% chans for derailment and 0% chans for mixed tracks. Added more tracks, spawners and trigger points, this time also with SF docks train tracks. Added stop blocks which prevent trains from driving in areas where the tracks isn't mapped in case they end up in a "non circular" track. Useful in case you don't like flying trains. More randomized selection of locomotives and carriages. More accurate acceleration as well as deceleration close to stations and stop blocks.
-
The main usage of that event is basically if you want to draw a text for instance with dxdrawtext, I'm using it in multiple resources and every frame it calls getElementData to verify if it should write anything, defines around 0-10 local variables (to calculate distance between some objects and output it), and some more. Let's not forget thought that this is a client sided function so the performance required to use it will be provided by the client computers and not the server. As long you doesn't add really heavy CPU wasting code in it there won't be any problem.
-
And there's the problem, the function actually seems to work but if it's checked every frame change then you won't be able to notice the change at all, first of all the script will notice the your are turning right and change it to left but when the next frame comes it will notice that the vehicle is driving left and change it back to right. Try calling this with a timer and set the interval to 5 or 10 seconds maybe or by using a command.
-
Paradise Roleplay is a complete open source role play game mode as far as I know. Writing these by yourself or downloading a full project doesn't mean you can't have 0% scripting knowledge, the best thing you can do is to read their wiki page on github (where you probably downloaded it from).
-
"onClientResourceStart" triggers when a player just joined the game and all client sided resources where downloaded successfully, at that moment this player isn't logged in so the AccountName() function in Anubhav's script should be triggered from the server sided event: addEventHandler( "onPlayerLogin", getRootElement( ), AccountName ) You may also update the client script, line 2 again. function AccountName(acc) otherwise the variable "acc" would not be defined.
-
Well you could make a licensing system by using the php api, then set up a webpage with a mysql database to allow people to actually try your scripts for free within a limited time and then ask for payment. Compiling for v1.3.4 and above is currently impossible to decompile as far as I know and decompiling in general is hard. However the best solution would probably be to release everything for free as open source, if your scripts are well made then you get known as a good scripter and people may donate some money to you, most people are actually very generous and those who use your scripts for free will still know that you are the author and recommend you, that makes it much harder for anyone else to steal it or take the credits for it. Since I'm also running a server by now I know that around 95% of those who are trying to sell scripts (compiled) are scammers or just steal or download scripts from the community, change the credits and compile it and then try to sell it. Anyway go ahead with open source and use donations with for example paypal, real payments would also require support and guarantees and other legally binding actions that you might not be able to handle all the time while donations won't require anything of that.
-
Line 2 in the server script should be: return getAccountName( source ) However I'm not sure if triggerServerEvent are able to just return like this but if it works then this should help.
-
Uploaded by mistake: https://community.multitheftauto.com/index.php?p=resources&s=details&id=8822 Original resource: https://community.multitheftauto.com/index.php?p=resources&s=details&id=8060 DONE
-
I guess your goal is to make this look just like a real Nokia phone with Windows phone os, first of all I don't think the tab panel are the best thing to keep, after all this is a GUI window, holding an image of the phone which holds a tab panel, I suggest using GUI window elements for all "apps" including the start screen, then show and hide depending on which is active. I'm planning to add those features in the next release of this script anyway but we'll see when there is time for that.
-
v1.4.6 is now released as 100% open source code again.
-
Good idea, not sure if there is so much more to improve in it thought but if you find any way of improvement I would like to hear about it. v1.4.6 is now released.
-
Well I guess the next version will be open source then, and by that I hope that more people will start to publish as open source. Just a few more days since the latest version needs to be tested. Features in 1.4.6 Added a check to prevent trains from spawning inside each others Sync direction when trains exist on the tracks to prevent collisions Improved default values and debug mode 2 ToDo: Add the tracks in SF docks.
-
Well that was kind of wasted time then...
-
I used to upload the open source version of this one in earlier versions, what do you need to change then?
-
There is a few ways to access the console from outside thought, I guess most of the servers has the web admin interface up and running, usually on port 22005 with the same public ip as your server, if this player entered that page and logged in with any admin account or similar he could ban all of you "from the console" so maybe it's someone that know your password or has a admin account in your server. As many other replied above, you should check the acl file and make sure that the rights are correctly setup, but as an addition to that, never add people you don't know to the staff team. MTA is full of scammers which has smaller servers as their targets, they simply join your server and ask if they can become admin, if you say no they will try to offer you scripts, maps and other stuff (mostly stolen or just downloaded from the community). As soon they get the rights they simply ban you and steal your recourses or does other harmful things just to destroy for you.