Jump to content

Bug :O


xeon17

Recommended Posts

i got a bug in my script , help idk how to fix it

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 ( "comprar51", 
function ( player ) 
    local playerTeam = getPlayerTeam ( player ) 
    if ( playerTeam ) then 
        local r, g, b = getTeamColor ( playerTeam ) 
        if(isElementWithinMarker(player,marker2)) then 
            setRadarAreaColor ( radararea2, r, g, b, 155 ) 
            local money = getPlayerMoney ( player ) 
            if ( money >= 1000000 ) then 
                takePlayerMoney ( player, 1000000 ) 
                local color = getTeamColor ( playerTeam ) 
                outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang comprou a base #00FF00 Area 51!", player, 0, 0, 0, true ) 
            end 
        end 
    end 
end 
) 
  
addEventHandler("onMarkerHit", marker2, 
function (player) 
    outputChatBox ( "#FFF000 [bASE] #FF0000 Para comprar a base digita #00FF00 /comprar51 (1000000$)", player, 0, 0, 0, true) 
end 
) 
function Vender ( player ) 
               if(isElementWithinMarker(player,marker2)) then 
               local playerTeam = getPlayerTeam ( player ) 
               if ( playerTeam ) then 
               givePlayerMoney ( player, 1000000 ) 
               setRadarAreaColor ( radararea2, 255, 255, 255, 155 ) 
               outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang vendeu a base #00ff00 Area 51!", player, 0, 0, 0, true ) 
           end 
        end 
    end 
addCommandHandler ( "vender", Vender ) 
  
function Car Color ( player ) 
                 if(isElementWithinMarker(player,marker2)) then 
                 local playerTeam = getPlayerTeam ( player ) 
                 if ( playerTeam ) then 
                 local r, g, b = getTeamColor ( playerTeam ) 
                 setVehicleColor( Maverick, r, g, b ) 
              end 
        end 
   end 
addCommandHandler ( "comprar51", Car Color ) 

Bug :

[2014-01-27 15:17:02] SCRIPT ERROR: Bases\Area51.lua:44: '(' expected near 'Color' 
[2014-01-27 15:17:02] ERROR: Loading script failed: Bases\Area51.lua:44: '(' expected near 'Color' 

Link to comment

Don't use spaces with the function :

function Car Color ( player ) 
                 if(isElementWithinMarker(player,marker2)) then 
                 local playerTeam = getPlayerTeam ( player ) 
                 if ( playerTeam ) then 
                 local r, g, b = getTeamColor ( playerTeam ) 
                 setVehicleColor( Maverick, r, g, b ) 
              end 
        end 
   end 
addCommandHandler ( "comprar51", Car Color ) 

To

function Car_Color ( player ) 
                 if(isElementWithinMarker(player,marker2)) then 
                 local playerTeam = getPlayerTeam ( player ) 
                 if ( playerTeam ) then 
                 local r, g, b = getTeamColor ( playerTeam ) 
                 setVehicleColor( Maverick, r, g, b ) 
              end 
        end 
   end 
addCommandHandler ( "comprar51", Car_Color  ) 

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...