Jump to content

Bugs


xeon17

Recommended Posts

I got bugs in my base script , when player write /comprar then it get his money , and he get the outchatbox ''you buyed the base'' thats wrong , if player no have team then he can't buy a base

----------------------------------------------------- 
-- script  Bases Area 51 MTA:SA Gang War 
-- @author EufraT & TAPL 
-- @update 28/1/2014 
----------------------------------------------------- 
  
radararea2 = createRadarArea( 110.91990, 1800.89435, 200, 145, 255, 255, 255, 225 ) 
createBlip(279.40317, 1831.25439, 7.72656,62) 
marker2 = createMarker(298.98865, 1815.90613, 3.71094,"cylinder",2,0,0,255,255)   
Maverick = createVehicle ( 487, 251.64256286621,1920.413574218817,640630722046 ) 
  
 addCommandHandler ( "comprar", 
function ( player ) 
local money = getPlayerMoney ( player ) 
local playerTeam = getPlayerTeam ( player ) 
local r, g, b = getTeamColor ( playerTeam ) 
local teamMates = getPlayersInTeam ( playerTeam ) 
        if(isElementWithinMarker(player,marker2)) and ( money > 1000000 )  then 
         takePlayerMoney ( player, 1000000 ) 
         setRadarAreaColor ( radararea2, r, g, b, 999 ) 
         outputChatBox ( "#FFF000 [bASE] #FF0000 Voce comprou base a base Area 51 por $1000000", player, 0, 0, 0, true ) 
        for _, v in ipairs(teamMates) do 
        outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang comprou a base #00FF00 Area 51!", v, 0, 0, 0, true ) 
        end 
        else 
        outputChatBox ( "#FFF000 [bASE] #FF0000 Voce precisa estar no centro do checkpoint e $1000000", player, 0, 0, 0, true ) 
        end 
        end) 

[2014-02-06 14:16:34] WARNING: Bases\Area51.lua:16: Bad argument @ 'getTeamColor' 
[2014-02-06 14:16:34] WARNING: Bases\Area51.lua:17: Bad argument @ 'getPlayersInTeam' 
[2014-02-06 14:16:34] WARNING: Bases\Area51.lua:20: Bad argument @ 'setRadarAreaColor' [Expected number at argument 2, got boolean] 
[2014-02-06 14:16:34] ERROR: Bases\Area51.lua:22: bad argument #1 to 'ipairs' (table expected, got boolean) 

Link to comment
----------------------------------------------------- 
-- script  Bases Area 51 MTA:SA Gang War 
-- @author EufraT & TAPL 
-- @update 28/1/2014 
----------------------------------------------------- 
  
radararea2 = createRadarArea( 110.91990, 1800.89435, 200, 145, 255, 255, 255, 225 ) 
createBlip(279.40317, 1831.25439, 7.72656,62) 
marker2 = createMarker(298.98865, 1815.90613, 3.71094,"cylinder",2,0,0,255,255)   
Maverick = createVehicle ( 487, 251.64256286621,1920.413574218817,640630722046 ) 
  
 addCommandHandler ( "comprar", 
function ( player ) 
local money = getPlayerMoney ( player ) 
local playerTeam = getPlayerTeam ( player ) 
    if ( not playerTeam ) then 
        return 
    end 
local r, g, b = getTeamColor ( playerTeam ) 
local teamMates = getPlayersInTeam ( playerTeam ) 
        if(isElementWithinMarker(player,marker2)) and ( money > 1000000 )  then 
         takePlayerMoney ( player, 1000000 ) 
         setRadarAreaColor ( radararea2, r, g, b, 999 ) 
         outputChatBox ( "#FFF000 [bASE] #FF0000 Voce comprou base a base Area 51 por $1000000", player, 0, 0, 0, true ) 
        for _, v in ipairs(teamMates) do 
        outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang comprou a base #00FF00 Area 51!", v, 0, 0, 0, true ) 
        end 
        else 
        outputChatBox ( "#FFF000 [bASE] #FF0000 Voce precisa estar no centro do checkpoint e $1000000", player, 0, 0, 0, true ) 
        end 
        end) 

Try this.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...