-
Posts
2,973 -
Joined
-
Last visited
-
Days Won
3
Everything posted by 50p
-
Upload it on https://community.multitheftauto.com/index.php?p=resources
-
What do you think MTA is? Multiplayer or Website browser? Haha
-
2. add this to the resource you want to restart after X hours: addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), function() setTimer( restartResource, 4*3600000, 1, getThisResource ) -- change 4 to how many hours you want to restart the resource end ) 3. I think you have got admin chat in admin resource. Just open the panel (press p) and choose Admin Chat tab, you should be able to chat with other admins using that tab.
-
[SOLVED]Problem with file handling (has final code in posts)
50p replied to CodeMaster's topic in Scripting
You should try opening file when it's needed and close it when you finish reading/writing. Are you able to open file if it's already opened by MTA? I don't think so, you'll get a message saying that file is opened by other program. That's why you should close it when you're done writing the coords to the file. And: -
setAccountData deletes stuff if you set data on a guest account, so check if player's accounts is guest one before setting data? i use that on my server and never had problems quick fix _setAccoutData = setAccounData function setAccountData ( account, data, value ) if ( not isGuestAccount ( account ) ) then return _setAccountData ( account, data, value ) end return false end Else you could save stuff anywhere you want still using build-in accounts, i see a lot of disadvantage using alternative accounts system Look into my "bank" resource, I do check whether account is a guest account and if it isn't then I setAccountData.
-
If function like setAccountData deletes all the accounts then why should I use that? DP3 will come out - nobody knows when - and it's not been said it'll be fixed. I stopped using accounts features when I found out that setAccountData deletes accounts, since that function is used the a lot. Imagine running 10 resources and each of them having say 4 variables saved in an account and you have 1000 accounts. How long would that take to get some data from such big accounts.xml file? XML is just plain text. Why not creating custom register system using SQLite? That would speed things up.
-
It's good to refresh topics sometimes! I'll start working on it really soon.
-
Riiiight, so let me refer to this part of your post: Wiki tells you that. eg.: These bold pieces are the things that you have to pass as the arguments. player - you can get player element using handlers or other functions (eg. getPlayerFromNickname) team - team element which is returned from createTeam or getPlayerTeam functions. What's the first "bool"? That's what function returns. [b]team[/b] createTeam ( string teamName, [int colorR = 255, int colorG = 255, int colorB = 255] ) see this team? That's what's needed in setPlayerTeam. If you create team, assign what's returned to a variable team1 = createTeam( "Robbers" ) now team1 is a team element which can be passed to setPlayerTeam function as a param.
-
Dude, have you ever done something yourself? Wiki waits "with hands wide open", if this is your first programming language then I'd suggest read documentation first: http://www.lua.org/ When you don't understand anything from that (just like my first time), take a rest, eat something (prefere sweets) and come back to it, that should help since sugar raise your concentration, you'll "pull" knowledge easier. Take a look here and then here, what do you think setPlayerTeam or setTeamColor does? Isn't it self-explained? I think so.
-
I know it's not difficult to create a file and type couple of lines in it but if you don't want to type it yourself, you can use this simple web page which generates the file content for you. How to use: 1. Fill all the fields you need and click "generate meta.xml" button. 2. Click "select all" button to select the lines that gets generated. 3. Press Ctrl+C to copy to clipboard (had to say it, lol). Test it here: http://y50p.50g.com/meta_generator.html To download it click here: http://y50p.50g.com/archives/mta/meta_generator.zip
-
I guess you have it already. Visit you server and type /register. Custom login system would be required for RPGs/massive gamemodes.
-
Make sure that gui script is client-side and that account script is server-side. When you get message: It usually is caused by using function that doesn't exist. So "server-side only" function will not work in client-side script and vice versa. Check whether function is client-side or server-side on wiki before you use it.
-
You probably created client-side script that's why other players can't see your ramps.
-
I'd recommend you download the least version of my speedometer. The speed bar won't raise that far. Nice idea of that boost script.
-
If I'll get some free time, yeah sure. Weekend has finished, so it'll be more difficult to stay by the desk.
-
I think I know what's the problem: I shouldn't use setAccountData I guess.
-
Line 123 in bank.gui.client.lua I was displaying it because I the first 'if' statement never passed but it should, it was caused by misspelling. I haven't tested the Transfer functionality since I was testing it myselft, but it should work.
-
Never noticed that! If you could find out when the accounts gets deleted then maybe I could fix it you it might be MTA bug. If you didn't report the bugs, the script wouldn't be useful and nobody would download it.
-
When does it usually happens? EDIT: Found it. Fixed it. Re-download it.
-
If you want to comment it, do it. But you want your players to know that this script is running, so they can go banking.
-
An update! Go to MTA resources center for more: https://community.multitheftauto.com/index.php?p= ... ails&id=54
-
It wouldn't be, but it would be laggy.
-
ifEventAlreadyHandled This message comes if you want to addEventHandler the same function. How to avoid it? To avoid it I have to use a boolean variable which is set to true when I add the handler and is set to false when I remove the handler. So I know if the event was handled already or not. If we had isEvenAlreadyHandled we didn't have to do the trick that I do. isPlayerInMarker Same trick here. We have to create a variable and set it to true when player enters marker or to false when player leaves marker. That's the way I created isPlayerInBank in bank script to check whether player can use commands.
-
Can you imagine submarine at the speed of dinghy. Wouldn't that be too fast?
-
What ID? This is not SA:MP where vehicles have IDs, here vehicles are elements. If the submarine has collision then how would you get in the dinghy which is inside the submarine?