Jump to content

50p

Retired Staff
  • Posts

    2,973
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by 50p

  1. You need some MTA scripting knowledge not just Lua itself. This is your highest priority. Then you can make it yourself with a 10 lines script: https://wiki.multitheftauto.com/wiki/Resource:Race What do you need money for on a race server? Where do you spend it?
  2. string.find looks for patterns. If you don't want it, just turn it off (4th parameter).
  3. Is the module loaded? You probably didn't follow the installation description properly.
  4. Sort of. You don't check and take player money. You don't need triggerServerEvent... what is it for? I suggest you look into other scripts or get to know MTA scripting more by reading wiki.
  5. 50p

    Nametag color

    You pass only 3 arguments in triggerServerEvent but you use 4 in server-side event handler. You used gMe as 2nd argument in triggerServerEvent, so this is going to be source. Remove player from nametagcolor function and use source in setPlayerNametagColor.
  6. 50p

    Nametag color

    Obviously not... Client-side scripts don't affect the server. Server doesn't know about you changing colour so how would other players know about it?
  7. 50p

    Nametag color

    I'm surprised you don't get an error or warning even... Do you ever use "debugscript 3" command? You can't pass string to setPlayerNametagColor... They have to be numbers. So, what about tonumber( red )? Why not make it server-side so that others can see the change?
  8. I don't know if I'll fix the auto-complete bug in the next release. And no, as I said, some crashes are extremely hard to figure out how to fix it... I mean, sometimes I get crash reports which don't tell me much. What's even worse is that I don't know how to reproduce these crashes because the last time I had a crash was the time when I was testing the "crash catcher".
  9. IMO plain files are slower. If your file will get bigger, split function will be slower but if your server is just for your friends, you are fine with file functions.
  10. If it's "compiled" it doesn't mean you can't "decompile" it...
  11. Yes, this has been reported already but I like to see people actually report faults here on the forum. Sometimes, it's extremely hard to find out what cause the crash from crash reports which I get from time to time. You can solve the problem with auto-complete being pain in the ass just by saving the file. Basically, I'm used to saving any changes I make (Ctrl+S), even after 1 line of code. This avoids auto-completing code after pressing Enter.
  12. Haven't you heard of that split function? I'd suggest you use xml files or SQL.
  13. 50p

    Walk Ped?

    This is what I made in Nov 29 2008 with setPedControlState: It was before MTA 1.0. If you calculate the walk angle for peds correctly then you are fine.
  14. I'm not an MTA Dev but if you run MTA and look into "Credits", you will find me in "Patch contributors" section. I made a few patches for MTA before they moved to Git. I always help people because I was born to help as much as I can and share my knowledge with others
  15. OK, then you can get player's location instead of typing it in because some people may not know the name of place where they are, like so: addCommandHandler( "call", function( plr, _, whatTeam, ... ) local myName = getPlayerName( plr ); -- get my nick local team = getTeamFromName( "Cops" ); -- get the team --local team = getTeamFromName( whatTeam ); -- get the team that you call, eg. "/call Cops" local locName = getZoneName( getElementPosition( plr ) ); -- get the name of location where the player is for _, player in ipairs( getElementsByType( "player" ) ) do -- loop through players local plrTeam = getPlayerTeam( player ); -- get player's team if plrTeam == team then -- check if he is in "Cops" team outputChatBox( myName .. " needs help! Location: " .. locName, player ); -- if he is, send the message to him --outputChatBox( myName .. " " .. table.concat( arg, " " ) .. " - Location: " .. locName, player ); -- send whatever you typed after "/call ", eg. "/call Cops I need help!" end end end ) If you want to use "/call " then you have to uncomment the 2 lines and comment the line above the commented line.
  16. 50p

    kill time

    This way he will not be able to kill the player. He'll have to triggerServerEvent which is pointless because the command can be server-side without any problems. SolidSnake14, you have a global variable locktime which is set by any player and because it's just simple variable you check if it's already set to 1 (by other player). Solution: Make a table which will hold value for each player separately or use set/getElementData to determine if player used the command within the last minute. You have to remember, setTimer lets you pass additional arguments to the functions it will call, so you can pass player element to a function which would "unlock" the command for him. NOTE: You didn't need timer to set locktime to 1. You could set it inside the if clause. You also don't need to hold timers in a table because you don't even use them anywhere, killing them, etc.
  17. I'll make the command for you because I'm in good mood and it isn't hard at all but I expect you to try and understand how it works! addCommandHandler( "call", function( plr, _, ... ) local myName = getPlayerName( plr ); -- get my nick local message = table.concat( arg, " " ); -- make a string of all the words typed after "/call " local team = getPlayerTeam( plr ); -- get my team for _, player in ipairs( getElementsByType( "player" ) ) do -- loop through players local plrTeam = getPlayerTeam( player ); -- get player's team if plrTeam == team then -- check if his team is the same as yours outputChatBox( myName .. ": " .. message, player ); -- if it is, send the message to him end end end )
  18. What have you heard about me? I don't know if this is good gamemode idea for multiplayer. If people want to play RE they can buy it. I liked all RE for PSX but again, I don't know how this gamemode is good for multiplayer.
  19. You can't create import custom character models to MTA, only their textures can be replaced.. I could help you modelling some environment if the idea was more expanded and got some more interest...
  20. "Stack overflow" means that this function has been calling itself without actually finishing execution of the first call. It's like infinite loop.
  21. You can get darker colour by yourself... Make it static and don't change it as player's health change.
  22. What do you need help with?
  23. https://wiki.multitheftauto.com/wiki/Main_Page
  24. You don't need the if statement... Just: ... addEventHandler( "onResourceStart", getResourceRootElement(), OnResourceStart );
  25. What do you want? There is no onPlayerCommand event to catch the command player typed in. You can only use addCommandHandler. You can make a table of commands and add their handlers, like so: teleCmds = { [ "abc" ] = { 123.2122, 123.3342, 124.3435 }, [ "def" ] = { 243.3432, 2345.234, 30.3452 }, [ "ghi" ] = { 2134.1234, 2452.0934, 22.23 }, } function addCommands( ) for cmd in ipairs( teleCmds ) do addCommandHandler( cmd, someFunc ) end end function someFunc( plr, cmd ) -- you can loop your table here again for tcmd in pairs( teleCmds ) do if tcmd == cmd then setElementPosition( plr, teleCmds[ tcmd ][ 1 ], teleCmds[ tcmd ][ 2 ], teleCmds[ tcmd ][ 3 ] ); end end end I may have made a mistake here but that's the idea you're looking for I think... Although, it's easier to make separate function for different teleport and even faster then a loop.
×
×
  • Create New...