Jump to content

Anderl

Members
  • Posts

    2,266
  • Joined

  • Last visited

Everything posted by Anderl

  1. function makeadmin( player, command, target ) local targetAcc = getAccountName( getPlayerAccount( getPlayerFromNamePart( tostring( target ) ) ) ) if( targetAcc ) then if( isObjectInACLGroup( 'user.' .. targetAcc, aclGetGroup( 'Owner' ) ) ) then aclGroupAddObject( aclGetGroup( 'Admin' ), 'user.' .. targetAcc ); else outputChatBox( 'You do not have permission to use this command!', player, 255, 0, 0, false ); end else outputChatBox( 'Unable to find player!', player, 255, 0, 0 ); end end addCommandHandler( 'makeadmin', makeadmin ); function getPlayerFromNamePart( string ) if( string and type( string ) == 'string' ) then local matches = { } for k,v in ipairs( getElementsByType 'player' ) do if( string.find( getPlayerName( v ), tostring( string ), 0 ) ) then table.insert( matches, v ); end end if ( #matches == 1 ) then return matches[1]; end end return false; end
  2. Sim, mas o seu código está errado. guiGetText(editWanted1,getPlayerFromNamePart) Certo: getPlayerFromNamePart( tostring( guiGetText( editWanted1 ) ) ) E: triggerServerEvent( 'onStupidStar', getlevel, gethename ) Está errado também, o segundo argumento é o elemento. triggerServerEvent( 'onStupidStar', localPlayer, getlevel, gethename ) Mostre o server-side também.
  3. No, we can't. Buy with the mapper.
  4. Código não tabulado: function teste() print('hola'); if(false~=true)then print('bye bye'); else print('welcome'); end end Código tabulado: function test( ) print( 'hola' ); if( false ~= true ) then print( 'bye bye' ); else print( 'welcome' ); end end Verifique meu post anterior também
  5. Tabula o código cara -- Pega o texto do edit com guiGetText e, para pegar o elemento do jogador, use getPlayerFromNamePart: function getPlayerFromNamePart( string ) if( string and type( string ) == 'string' ) then local matches = { } for k,v in ipairs( getElementsByType'player' ) do if( string.find( getPlayerName( v ), tostring( string ), 0 ) ) then table.insert ( matches, v ); end end if( #matches == 1 ) then return matches[1]; end end return false; end E para definir o nível de procurado, chame um evento server-side onde você vai passar o número que está no edit e defina o nível.
  6. Did you try checking if player is in the group "Owner" and not if he has permission to use command 'makeadmin'?
  7. You must buy them or trade maps ( map trading is not legal, I think ).
  8. When I created gameserver for first time, HTTP Server was disabled but I don't know why. Check your mtaserver.conf
  9. What happens? Error? Could not connect to HTTP server? Enable HTTP Server in mtaserver.conf
  10. I can install it for you for free, just PM me.
  11. Here is an example: local tempData = { 'hasAccount', 'loggedIn'; } function PlayerSave( player, k ) for i = k, #getAllElementData( player ) do for z, x in pairs( impData ) do if( i == x ) then PlayerSave( player, i + 1 ); return; end outputChatBox( tostring( i ) .. ' - ' .. tostring( getAllElementData( player )[i] ) ); dbExec( db, 'UPDATE `account` SET `??` = ? WHERE `username` = ?', k, v, getPlayerName( player ) ); end end end Not tested. It should work that way: PlayerSave( myPlayerElem, 1 );
  12. Create loop function to loop from determinated index. Then in your function when it reaches the values in 'tempData' just break the loop and continue the loop in the next index by calling the loop function.
  13. Variable hud1 is local, not global. setColor function does not exists. It isn't even a method and dxDrawText doesn't return an object so you can't use the function that way. Also, you can't have two dxDrawText functions with same variable name, it will overwrite. Example: b = 'Hey Hey Hey'; print( b ); -- Hey Hey Hey b = 'lol'; print( b ); -- lol
  14. "SYNTAX: "..commandName" [PlayerName]" "SYNTAX: "..commandName.." [PlayerName]"
  15. Anderl

    Help setting up server

    Check if port 22005 is being used.
  16. A site to host gameservers? Hm, that doesn't seems to work.
  17. Anderl

    Delete This!

    Of course they affect. There must be something that won't work that way.
  18. Anderl

    Open Window

    I don't think so. -- I learned and I still learn in the way 50p said too.
  19. Anderl

    Delete This!

    Who would pay for a fucking bugged BASIC roleplay script? So much bugs.. Are they from the gamemode? That's what seems to be.
  20. Use a função "guiSetInputEnabled", é mais fácil.. De qualquer jeito, reporte no Bug Tracker: http://bugs.mtasa.com/
  21. The thing in the link I gave you, if you want.
  22. I understood that he is talking abou that window. I just didn't understand what he wants to say with "and it window?". If you want to make Java apps see this page: http://www.oracle.com/technetwork/java/ ... 46242.html
×
×
  • Create New...