-
Posts
2,973 -
Joined
-
Last visited
-
Days Won
3
Everything posted by 50p
-
I think you should learn how to help first. CallumD, show us your code. There are events that are triggered for every client (with source of remote player). You can use one of them or make your own and pass the remote player in triggerEvent or triggerClientEvent.
-
If you're making money by charging people then you must have some money for someone to make the animals for you. I can make them for you for very low price of only £999 (VAT not inc.)! I think it's the price right for you.
-
I would not advise to use console for debugging just like the guy did on FreeStateProject server with old spawning script... It's sent to everyone and in case you forget about 1 line, your players' console will fill up with your debug messages. Use it only if you have want to output lots of lines (eg. for loop) so that you can see every line and not missing lines in debug window.
-
What is the reason to sync the click count?
-
When does it not spawn? When you join server? When you die? You need to know when it doesn't spawn you and once you know just check the function attached to the specific event. Debug! Debug! Debug! All of you people out there, you should start to learn how to debug your script.. Once you know how to debug your script, you can solve every single problem you have with your script (as far as you know how to fix it). It's easy and won't take you long to learn it. It's just using outputChatBox, outputDebugString or outputConsole in the places when you think your code fails. Have a read: https://wiki.multitheftauto.com/wiki/Debugging
-
How come it used to save files and now it stopped? Your "Script Editor.exe" hasn't changed, has it? If it hasn't, then why should it stop saving or detect changes in file? I have no idea why it doesn't work for you. Maybe give some details on what did you do before it stopped working, what is your OS (SP2, SP3)? Also, are you talking about "New" files not being saved or already opened file from a resource? If it's a "New" file then was it added to your resource (in Resource explorer)? I just need more details.
-
He added too many ) so expect it to fail. Remove 1 ) (at the line with setTimer) and you will be fine.
-
What do you mean 3 seconds? The difference between 30fps and 50fps is only 20fps which is not 3 seconds (it's 1 second on slow PCs). getTickCount is solution for you. Just getTickCount when you started to show text add amount of seconds that text should last for and then check if getTickCount returns more than your (start tick count + your time). You should know how to do it, but in case you don't: startedAt = getTickCount( ) ----- if getTickCount( ) < startedAt + 4000 then -- 4seconds -- show your text else -- stop showing your text end
-
You can't get that error message on this line, probably the next one. People should start to learn to debug scripts themselves. getElementsByType returns indexed table of elements. These elements are not tables so ZoneInfo[v].Name is invalid! 1. ZoneInfo[ v ] == nil (it's nil because v is element ZoneInfo is (number) indexed table therefore it's invalid) 2. ZoneInfo[ v ].Name == nil (because ZoneInfo[ v ] == nil, you can't get elements out of nil) 3. v ~= table (v is not table, even v.Name will be invalid) Solution: if ( getElementData( v, "Name" ) then -- your outputChatBox.... here end
-
It's not possible with just 1 function. You would have to hide vehicle names with showPlayerHudComponent and than you'd have to use dxDrawText to draw your own text (your own vehicle names).
-
But it doesn't always work properly.
-
Are you sure? I have windows 7 and for some reason I can't save any scripts. There are no errors I just don't get the dialog, and it doesn't overwrite existing files either. Any thoughts? Vista users must run this application with admin privileges otherwise the files are saved in different directory. Maybe 7 works the same. Try to run it with admin rights. Also, when the files is saved you will see confirmation message in status bar saying "File 'filename.lua' saved...".
-
It's possible to make SQLite DB editor with MTA's GUI functions, as a matter of fact, I was making such but MTA doesn't have a function to find out whether query failed or not so I stopped. I made a request for such function or new return value for executeSQLQuery, but as usually I was ignored, I guess. You can make a simple SQLite editor for MTA without checking if query failed. It's not even hard to make. http://bugs.mtasa.com/view.php?id=4034
-
Why don't you make "player" element as the index in the table? Player element will stay the same for as long as player is connected (even when he/she changes his/her name). addEventHandler( "onPlayerJoin", getRootElement(), function( ) timersForbidenNick[ source ] = { }; -- and rest of the code ... end ) function killPlayerTimers( player ) for timerKeyFN, timerValueFN in ipairs( timersForbidenNick[ player ] ) do killTimer ( timerValueFN ) end timersForbidenNick[ player ] = nil; end --then for example: addEventHandler( "onPlayerChangeNick", getRootElement(), function ( ) killPlayerTimers( source ); end )
-
You just showed timersForbidenNick[ newForNick ] = {} but your code complains about timersForbidenNick[oldForNick]. Why don't you learn debugging? https://wiki.multitheftauto.com/wiki/Debugging This will solve most of your problems if you know what the error message tells you. Add this function to your code and call it whenever you want to kill player timers... function killPlayerTimers( playerName ) for timerKeyFN, timerValueFN in ipairs( timersForbidenNick[ playerName ] ) do killTimer ( timerValueFN ) end timersForbidenNick[ oldPlayerName ] = nil; end Let's kill some timers: local playerName = getPlayerName( player ) killPlayerTimers( playerName ) Bare in mind that getPlayerName returns what is player's name NOW (at the time of calling) not the old name.
-
triggerClientEvent ( "onPlayer_hide_instruktion", g_Root ) This will be triggered for every player. This client-side event hides your text, so if you trigger this event for everyone you will hide the text for everyone. What is this supposed to do: timersFN = getTimers ( timersForbidenNick[oldForNick] ) timersForbidenNick[oldForNick] this is a table... getTimers doesn't expect you to pass table. And why don't you do it all client-side and just tell server when to kick the player? There is onClientPlayerChangeNick event client side. Also, why do you use this?: string.find(string.lower(joinedPlayerName), forbidenNickFinded) Why do you want to kick players that have nick like "ImGod:O"? I haven't looked harder into this script but these 3 are just quickly found... I bet there are more things you should think about.
-
You've got black screen because there is no resource running. You have to start "play" resource. You need to get into scripting or at least read how to administrate your server. Also, I just gave you the command "waterlevel" -.-' https://wiki.multitheftauto.com/wiki/Resources check what is a "resource" and have a look at "Getting started" section there https://wiki.multitheftauto.com/wiki/Main_Page
-
You can make one yourself. Don't waste money for someone to write for you ~5 lines of code that would take him couple of minutes to make. Water functions: https://wiki.multitheftauto.com/wiki/Ser ... _functions Take this as an example: addCommandHandler( "waterlevel", function ( plr, cmd, newlevel ) setWaterLevel( tonumber( newlevel ) ); end ); Someone has already made similar resource... https://community.multitheftauto.com/index.html?p ... ils&id=351 I haven't tested it and don't know how it works but you can check this out.
-
it's not only floating point numbers unless the money is actually a floating point number but than rounded? Try to give yourself lots of money via admin panel and see how much money the panel will display.
-
1. There are 2 ways. a) Make a command /me and than use executeCommandHandler in onPlayerWasted event handler. b) outputChatBox ( getPlayerName( source ) .. " committed a suicide" ); in onPlayerWasted event handler. 2. Add a timer in onPlayerWasted event handler: setTimer( spawnPlayer, 5000, 1, source, X, Y, Z ); -- where X, Y, Z is spawn position. 5000 = seconds Make sure other resources don't spawn players when they die.
-
Don't use getResorceFromName in addEventHandler unless you do it in function. It's useless. Why would you want to add the event handler to a different resource not "this"?
-
What do you mean "default"? https://wiki.multitheftauto.com/wiki/Set ... ngineState
-
It might be also the reason why getPlayerMoney() (client-side) returns not exact amount of money if that is large number. Eg. if player's money is between 99 999 999 and 99 999 992 than you will get 1 000 000 000. It seems to change only every 8 numbers.
-
I have no idea what your problem is now. Warning messages disappear but they shouldn't? I don't get it.
