Jump to content

Anderl

Members
  • Posts

    2,266
  • Joined

  • Last visited

Everything posted by Anderl

  1. First, you're showing us your internal IP, not external IP. How do you expect us to join your server? Also, we don't script for you for free. Learn LUA, pay someone to do it for you or search in the community: https://community.multitheftauto.com
  2. If you don't know nothing about LUA then learn it lol http://www.lua.org http://lua-users.org/wiki/TutorialDirectory
  3. Man, the command /capture is when you start capturing the territory, not to when the capture is done.
  4. So? Where is server info? Website? Features? Nothing? Hum, nice.
  5. local progressBar = guiCreateProgressBar( x, y, width, height, true, nil ); progressTimer = setTimer( function( ) guiProgressBarSetProgress( progressBar, guiProgressBarGetProgress( progressBar ) + 5 ); if( guiProgressBarGetProgress( progressBar ) == 100 ) then killTimer( progressTimer ); end end, 1000, 0 );
  6. That should work: local ballasAreas = { createRadarArea( 2077.2470703125, -1099.728515625, -220, -180, 255,0,255, 100 ), createRadarArea( 1981.6513671875, -1350.298828125, -140, -130, 255,0,255, 100 ), createRadarArea( 2268.5859375, -1138.28515625, -100, -100, 255,0,255, 100 ), createRadarArea( 2184.7529296875, -1108.1435546875, -110, -120, 255,0,255, 100 ), createRadarArea( 2176.033203125, -1224.8935546875, -100, -80, 255,0,255, 100 ), createRadarArea( 2265.5126953125, -1233.033203125, -100, -80, 255,0,255, 100 ), createRadarArea( 2261.82421875, -1297.7451171875, -100, -80, 255,0,255, 100 ), createRadarArea( 2165.7333984375, -1305.1416015625, -100, -80, 255,0,255, 100 ); } addCommandHandler( 'capture', function( player, command ) local hitAreas = { } local posX, posY = getElementPosition( player ); for _,v in pairs( ballasArea ) do if( isInsideRadarArea( v, posX, posY ) ) then table.insert( hitAreas, v ); end end if( #hitAreas == 1 ) then if( getPlayerTeam( player ) and getTeamName( getPlayerTeam( player ) ) == 'Grove' or getTeamName( getPlayerTeam( player ) ) == 'Ballas' ) then local r, g, b, a = getRadarAreaColor( hitAreas[1] ); if( r == 255 and g == 0 and b == 255 ) then setRadarAreaColor( hitAreas[1], 0, 255, 0, 100 ); setRadarAreaFlashing( hitAreas[1], true ); else setRadarAreaColor( hitAreas[1], 255, 0, 255, 100 ); end end end end )
  7. Really nice job, keep it up dude!
  8. Your code is completely messed up, Jay Here all my code fixed, I think: function mute( player, command, target ) if( hasObjectPermissionTo( getThisResource( ), 'function.setPlayerMuted', true ) ) then if( hasObjectPermissionTo( player, 'command.aexec', true ) ) then local targetPlayer = getPlayerFromNamePart( target ); if( targetPlayer ) then if( not isGuestAccount( getPlayerAccount( targetPlayer ) ) ) then if( not isPlayerMuted( targetPlayer ) ) then if( setPlayerMuted( targetPlayer, true ) ) then setAccountData( getPlayerAccount( targetPlayer ), 'muted', true ); outputChatBox( getPlayerName( targetPlayer ) .. ' has been muted!', root, 255, 0, 0, false ); else outputChatBox( 'Unable to mute player!', player, 255, 0, 0, false ); end else outputChatBox( 'The player is already muted!', player, 255, 0, 0, false ); end else if( setPlayerMuted( targetPlayer, true ) ) then outputChatBox( getPlayerName( targetPlayer ) .. ' has been muted!', root, 255, 0, 0, false ); else outputChatBox( 'Unable to mute player!', player, 255, 0, 0, false ); end end else outputChatBox( 'Unable to find player!', player, 255, 0, 0, false ); end else outputChatBox( 'You do not have permission to do that!', player, 255, 0, 0, false ); end else outputChatBox( 'The resource does not have permission to mute players!', player, 255, 0, 0, false ); end end addCommandHandler( 'mute', mute ); 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 Off-topic: I don't know why, but I ever forget to use getPlayerName lol
  9. If you are using tostring, It won't be nil. It will be a string: "nil" target = nil tostring(target) --> "nil" [string] Oh, you're right. Let me edit the code.
  10. It does the same. If target is nil = targetPlayer will be nil too. It's not necessary.
  11. If you mean, if someone's name contains the string "nil" or it's just "nil", of course he will be muted cuz it's a string, it can contain everything. But, see my code, I used statement to check if target player exists.
  12. You forgot to put the function "getPlayerFromNamePart" and your code have some errors, Flaker. Try that, michael: function mute( player, command, target ) if( hasObjectPermissionTo( getThisResource( ), 'function.setPlayerMuted', true ) ) then if( hasObjectPermissionTo( player, 'command.aexec', true ) ) then local targetPlayer = getPlayerFromNamePart( target ); if( targetPlayer ) then if( not isGuestAccount( getPlayerAccount( targetPlayer ) ) ) then if( not isPlayerMuted( targetPlayer ) ) then if( setPlayerMuted( targetPlayer, true ) ) then setAccountData( getPlayerAccount( targetPlayer ), 'muted', true ); outputChatBox( targetPlayer .. ' has been muted!', root, 255, 0, 0, false ); else outputChatBox( 'Unable to mute player!', player, 255, 0, 0, false ); end else outputChatBox( 'The player is already muted!', player, 255, 0, 0, false ); end else if( setPlayerMuted( targetPlayer, true ) ) then outputChatBox( targetPlayer .. ' has been muted!', root, 255, 0, 0, false ); else outputChatBox( 'Unable to mute player!', player, 255, 0, 0, false ); end end else outputChatBox( 'Unable to find player!', player, 255, 0, 0, false ); end else outputChatBox( 'You do not have permission to do that!', player, 255, 0, 0, false ); end else outputChatBox( 'The resource does not have permission to mute players!', player, 255, 0, 0, false ); end end addCommandHandler( 'mute', mute ); 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 Don't forget to add the resource to the ACL Group "Admin" or anyone which has access to "setPlayerMuted" function.
  13. I don't think there are maps like he want.
  14. Eu chamei, triggerClientEvent.
  15. Obviamente, não Seu código está completamente errado: -- server side function visible( player ) local accName = getAccountName( getPlayerAccount( player ) ); if( isObjectInACLGroup( 'user.' .. accName, aclGetGroup( 'Admin' ) ) ) then triggerClientEvent( player, 'g_OnServerCallGUI', player ); end end addCommandHandler( 'wantedlevel', visible ); -- client side addEvent( 'g_OnServerCallGUI', true ); addEventHandler( 'g_OnServerCallGUI', root, function( ) guiSetVisible( wantedJanela, true ); showCursor( true ); guiSetInputMode( 'no_binds_when_editing' ); end )
  16. addEvent('onStupidStar', true) addEventHandler('onStupidStar', root, function(wantedToApply, playerToApply) if( setPlayerWantedLevel( playerToApply, tonumber( wantedToApply ) ) ) then outputChatBox( 'Seu nível de procurado foi alterado!', playerToApply, 255, 255, 0, false ); else outputChatBox( 'Ocorreu um erro ao tentar alterar o nível do jogador!', source, 255, 0, 0, false ); end end Passe o comando ou o bind ( o que você está usando para abrir a GUI ) para server-side daí cheque se o player tá no grupo 'Admin', se tiver, chame o evento client-side para criar a GUI, se não estiver, passe um erro ( outputChatBox ).
  17. Mande o server-side do código e... as funções de conta e ACL são server-side. Então coloque o comando/bind server-side e cheque o grupo, se tiver certo, chame o evento client-side e crie a janela, de outro jeito envie um erro ou qualquer coisa assim.
  18. Eu acho que esse jeito funcionará ( remova a linha onde tem setPlayerWantedLevel no server-side e bote isso abaixo ): if( setPlayerWantedLevel( playerToApply, tonumber( wantedToApply ) ) ) then outputChatBox( 'Seu nível de procurado foi alterado!', playerToApply, 255, 255, 0, false ); else outputChatBox( 'Ocorreu um erro ao tentar alterar o nível do jogador!', source, 255, 0, 0, false ); end
  19. I don't see any image drawn in the script. Only "icon.png" but I don't think it is the image for the background.
  20. addEvent('onStupidStar', true) addEventHandler('onStupidStar', root, function(wantedToApply, playerToApply) setPlayerWantedLevel(playerToApply, tonumber(wantedToApply)) outputChatBox('Seu nível de procurado foi alterado!',playerToApply,255,255,0) end)
  21. Not only that. Everyday, people will be trying to contact you, asking you for help. You will need to check everything, do a lot of things. It will be a hard work if you are starting alone.
  22. Your code is wrong, Todd. local function connect( ) -- retrieve the settings local server = get( "server" ) or "localhost" -- dont change it local user = get( "user" ) or "21313_mtauser" local password = get( "password" ) or "asshole123" local db = get( "database" ) or "13213_mta" local port = get( "port" ) or 3306 local socket = get( "socket" ) or nil You forgot an 'end' on the final. local function connect( ) -- retrieve the settings local server = get( "server" ) or "localhost" -- dont change it local user = get( "user" ) or "21313_mtauser" local password = get( "password" ) or "asshole123" local db = get( "database" ) or "13213_mta" local port = get( "port" ) or 3306 local socket = get( "socket" ) or nil end
  23. Yeah, you're right I didn't understand that was that lol
  24. Does it give you any message/error?
×
×
  • Create New...