Jump to content

50p

Retired Staff
  • Posts

    2,973
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by 50p

  1. 50p

    call function

    Make sure the function is exported. You can easily export functions from within MTA:SE by right-clicking the function name. It's also easy to call exported functions by loading exported functions list on the right and double clicking an exported function name. You can't call client-side exported function in a server-side script. Also, easier syntax to call exported functions is: groupSlots = exports[ "SPY-vs-SPY" ]:onWeaponInfoRequest( );
  2. Best bet would be to stop the server, do what is necessary and then start the server to see if it has changed. For some reason, admin panel doesn't update the map's compatibility when you change meta.xml after you've logged and opened admin panel.
  3. Open up meta.xml and make sure has gamemode attribute, eg: <info author="You" type="map" gamemode="race"/>
  4. local weapons = { 12, 14, 15, 20, 30, 31 } addEventHandler( "onPlayerSpawn", root, function ( ) giveWeapon( source, weapons[ math.random( #weapons ) ] ) ); end )
  5. 50p

    Autoteams

    Why are you missing "end" on line 20? I'm pretty sure you get more error/warning messages but you showed us only 1 of them which tells us there is something wrong with the argument but there isn't. Better code indentation will solve your problem.
  6. Show your ACL group. Tested it with and worked fine: <group name="Robber"> <object name="user.50p"></object> </group>
  7. Simply copy and replace the old code at line 21: -- line 21: local classACL = aclGetGroup( class.name ); local plrAccount = getPlayerAccount( client ); if ( classACL ) then if ( not isGuestAccount( plrAccount ) ) and ( not isObjectInACLGroup( "user." .. getAccountName( plrAccount ), classACL ) ) then outputChatBox( "You are not member of this team/gang. Choose different team!", client, 200, 50, 50 ); requestMenu( client ); return; elseif isGuestAccount( plrAccount ) then outputChatBox( "If you are member of \"" .. class.name .. "\" then please log in before you proceed.", client, 200, 50, 50 ); requestMenu( client ); return; end end Tested it and it works.
  8. As I've mentioned long time ago but I'm sure nobody has read all 30 pages of this topic. Eclipse is heavy weight (over 100MB? MTA:SE is only ~2MB) therefore I don't want beginners to download heavy-weight Eclipse just for an add-on. Also, I've never used Eclipse so it'd take me some time to get used to it and then to make an add-on which is another adventure. I've tried to make an extension for Notepad++ but I just couldn't get my head around it, it was hard to make some sort of "Resource explorer" so I gave up. MTA:SE does have a syntax checker, it doesn't stop at the first error and it checks the syntax whenever you edit the file so it does refresh when it is necessary. People need to have choice and this is why there are many shops selling the same or similar things. This is also the reason why there are so many different types of TV's or computer hardware, that's called competition (but I don't compete). If you like Notepad go for it, if you like Notepad++ feel free to use it. I can't make you use MTA:SE which is one of the tools I'm making for fun not for money :> Thanks for your opinion. It has support for almost all MTA functions and they are highlighted as needed. Client-side functions are red (including GUI functions), server-side functions are orange and both client and server are blue but as I mentioned before, I do not highlight MTA functions when you open a .lua script from within Windows explorer and the reason is that not all Lua scripts are MTA scripts. CryENGINE uses Lua scripts for their weapons/vehicles/etc. Word of Warcraft. Also, how does MTA:SE is supposed to know if the script is server-side or client-side? But if that is what people want I will add support for highlighting MTA functions of non-resource Lua script but it will highlight both, server-side and client-side functions which is not ideal. Thanks for your comments guys.
  9. Hi there, I was just wondering how many people actually use 3DS Max to create their own models or maps for GTA/MTA. I've made several scripts for 3DS Max in the past and one of them is Map exporting. I wanted to make some advanced scripts to allow user to render top-down view of their maps so that they can use them in MTA. I've always wanted to see custom maps on the radar but the problem I think people have is they don't know how to achieve it. All I want to know is how many people in MTA community actually use 3DS for custom model creation, so I'll know if it's worth making a script for custom radar minimaps. Regards, 50p
  10. 50p

    Online GUI-Editor

    Make everything in groups so that user knows what is what. Make a working area easier to spot because currently it looks like everything is in just 1 canvas. Good luck.
  11. There is a lot of problems when working outside of the GTA boundary. Water is one of these issues. That is probably because GTA engine allows you to swim away from the islands forever and the game need to deal with it somehow because I don't think Rockstar made the ocean so big. It's infinite and that causes problems.
  12. 50p

    What is faster?

    Its main role is to free the RAM from unused data (nil a variable and memory will be freed by garbage collector). Basically, something you don't need to worry about.
  13. 50p

    help plis

    You're asking me who made this script? How am I supposed to know that? Check meta.xml to find out who made it.
  14. 50p

    What is faster?

    Yes, it's true for most languages, but not for Lua. Setting a single value as nil doesn't force a rehash, so the table size remains the same (initially). Though as I mentioned, that is not a problem in most cases anyways. Garbage collector will deal with it. Setting value of nil will "remove" the field from a table as well as memory. This is also what you have to do when clearing shader/texture from memory. Simple destroyElement will only destroy the MTA element from memory but the memory address (a value) in a variable is still there, therefore it is necessary to nil the variable in order to free the RAM. Simple example explaining nil'ing variables: local tab = { 1,2,3,4,5,6 }; -- simple indexed table of size: 6 function table.size( t ) local i = 0; for k,v in pairs( t ) -- I use pairs in case "t" will be non-indexed table or one of table fields will be nil i = i + 1; end return i; end print( table.size( tab ) ); -- this will show you 6 tab[ 2 ] = false; -- assign new value of false to index 2 print( table.size( tab ) ); -- it's still 6 tab[ 2 ] = nil; -- delete the field at index 2 print( table.size( tab ) ); -- now you will see 5 because tab[2] does not hold any value and therefore size of the table will change
  15. 50p

    help plis

    Oh wait. It's an "else", so remove everything on that line except for else. Also, it's better to speak to the script author rather than ask here. He will be able to help you quicker because he knows his scripts.
  16. 50p

    What is faster?

    What do you mean? There are 2 functions for iteration. pairs and ipairs http://www.lua.org/pil/7.3.html Also, I've mentioned that in someone's topic that getElementsByType is not recommended for very frequent use for server. You can use client's power for this since most servers don't have as much processing power as client's PC. For you it will be more efficient to use a global table and update it when needed.
  17. 50p

    help plis

    Add then to line 119.
  18. This looks fine to me. Player is roughly 2units high, so your code would work fine. If your objects gets created underground then the model's pivot point is higher than you'd expect it to be. Even if the player is crouching his position is still at the same spot, this is also the reason why you can't crouch underneath other environment models (it's not just collision that's causing you not being able to crouch underneath objects). Your code is fine, but like DNL291 said, you can use getGroundPosition to get accurate ground position or processLineOfSight.
  19. Not sure if it'll work with pickups but you can try: https://wiki.multitheftauto.com/wiki/Se ... tDimension As far as I remember it worked fine but even when pickup was in different dimension you could still hit it and events were triggered. I don't remember if it's been fixed or not, just give it a try.
  20. 50p

    killTimer

    Your timer is a local variable. This will not be available outside the block it was defined in. function name( ) local a = "hello world"; end print( a ); -- this will print "nil" because 'a' is not a global variable If you want to make timers for each player then you need to use table and store timers in a table, otherwise you will have 1 global timer variable which you will kill for all players. There was a discussion about the same problem you're having yesterday: viewtopic.php?f=91&t=55691 Also, please search the forum before you post.
  21. As I said in one of the previous topic, MTA does not allow using 3rd party libraries for security reasons therefore you can't use any Lua libraries.
  22. 50p

    Move camera

    Once the "progress" will be >1 then the camera reached the destination so just add "else" to the "if" statement and then stop the camera movement (removeEventHandler + setCameraTarget to bring it back to player). You can also add new event and use trigger(Server)Event so that other scripts can use that event for their own purposes. I like using custom events.
  23. If you store the timer in a table for each player then it won't kill all the timers. local timers = { }; timers[ player ] = setTimer( outputChatBox, 1000, 1, "hello world", player ); -- it will create 1 timer for 1 player killTimer( timers[ player ] ); -- it will kill the timer previously created for that specific player NOT all the timers Show the code you're having problem with and we'll solve your "global" timer problem or do it yourself once you understand the idea. Remember, you need to create a timer for each player separately.
  24. 50p

    Move camera

    No problem. This is useful not only for 3D animations but also for 2D. You can move windows using the same function as well as resize them. For example a window popping up from outside of the screen or resize and pop up (eg. like in Windows 7). You can use different easing types for different animation styles. Good luck.
×
×
  • Create New...