Jump to content

Bug


xeon17

Recommended Posts

i wanna crate a when player is in contact with marker then he get some text in chatbox but i get some bug :/

marker1 = createMarker(2586.05591, 2840.79199, 9.82031,"cylinder",2,0,0,255,255) 
  
if isElementWithinMarker(thePlayer, marker1) then 
outputChatBox ( "#FFF000 [bASE] #FF0000  Sua gang comprei a base #00FF00 KACC!", player, 0, 0, 0, true ) end 

[2014-01-13 11:59:24] WARNING: marker\pro.lua:3: Bad argument @ 'isElementWithinMarker' [Expected element at argument 1, got nil] 

Link to comment

Look this .-.

Here is the full script :/

radararea4 = createRadarArea( 996.50629, 2048.92480, -80, 132, 255, 255, 255, 225 ) 
createBlip(939.85992, 2080.10718, 10.82031,62) 
marker3 = createMarker(927.96558, 2076.13110, 9.82031,"cylinder",2,0,0,255,255) 
  
addCommandHandler ( "comprarfabrica", 
    function ( player ) 
        local playerTeam = getPlayerTeam ( player ) 
        if ( playerTeam ) then 
            local r, g, b = getTeamColor ( playerTeam ) 
if(isElementWithinMarker(player,marker3)) then 
    outputChatBox ( "#FFF000 [bASE] #FF0000 Para comprar a base digita #00FF00 /comprarfabrica (600.000$)", player, 0, 0, 0, true) 
            setRadarAreaColor ( radararea4, r, g, b, 155 ) 
            local money = getPlayerMoney ( player ) 
            if ( money >= 600000 ) then 
                takePlayerMoney ( player, 600000 ) 
                local color = getTeamColor ( playerTeam ) 
                outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang comprei a base #00FF00 FABRICA!", player, 0, 0, 0, true ) 
            end 
        end 
    end 
) 

Whats wrong ? :/

[2014-01-13 12:13:19] SCRIPT ERROR: 51\Fabrica.lua:21: unexpected symbol near ')' 

Link to comment
radararea4 = createRadarArea( 996.50629, 2048.92480, -80, 132, 255, 255, 255, 225 ) 
createBlip(939.85992, 2080.10718, 10.82031,62) 
marker3 = createMarker(927.96558, 2076.13110, 9.82031,"cylinder",2,0,0,255,255) 
  
addCommandHandler ( "comprarfabrica", 
function ( player ) 
    local playerTeam = getPlayerTeam ( player ) 
    if ( playerTeam ) then 
        local r, g, b = getTeamColor ( playerTeam ) 
        if(isElementWithinMarker(player,marker3)) then 
            outputChatBox ( "#FFF000 [bASE] #FF0000 Para comprar a base digita #00FF00 /comprarfabrica (600.000$)", player, 0, 0, 0, true) 
            setRadarAreaColor ( radararea4, r, g, b, 155 ) 
            local money = getPlayerMoney ( player ) 
            if ( money >= 600000 ) then 
                takePlayerMoney ( player, 600000 ) 
                local color = getTeamColor ( playerTeam ) 
                outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang comprei a base #00FF00 FABRICA!", player, 0, 0, 0, true ) 
            end 
        end 
    end 
end 
) 

Link to comment

Should i try this ?

radararea4 = createRadarArea( 996.50629, 2048.92480, -80, 132, 255, 255, 255, 225 ) 
createBlip(939.85992, 2080.10718, 10.82031,62) 
marker3 = createMarker(927.96558, 2076.13110, 9.82031,"cylinder",2,0,0,255,255) 
  
addCommandHandler ( "comprarfabrica", 
function ( player ) 
    local playerTeam = getPlayerTeam ( player ) 
    if ( playerTeam ) then 
        local r, g, b = getTeamColor ( playerTeam ) 
            setRadarAreaColor ( radararea4, r, g, b, 155 ) 
            local money = getPlayerMoney ( player ) 
            if ( money >= 600000 ) then 
                takePlayerMoney ( player, 600000 ) 
                local color = getTeamColor ( playerTeam ) 
                outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang comprei a base #00FF00 FABRICA!", player, 0, 0, 0, true ) 
            end 
        end 
    end 
end 
) 
  
function marker ( player ) 
if(isElementWithinMarker(player,marker3)) then 
outputChatBox ( "#FFF000 [bASE] #FF0000 Para comprar a base digita #00FF00 /comprarfabrica (600.000$)", player, 0, 0, 0, true) 
end 

with this i get bug :

[2014-01-13 12:24:55] SCRIPT ERROR: 51\Fabrica.lua:19: ')' expected (to close '(' at line 5) near 'end' 
[2014-01-13 12:24:55] ERROR: Loading script failed: 51\Fabrica.lua:19: ')' expected (to close '(' at line 5) near 'end' 

Link to comment
radararea4 = createRadarArea( 996.50629, 2048.92480, -80, 132, 255, 255, 255, 225 ) 
createBlip(939.85992, 2080.10718, 10.82031,62) 
marker3 = createMarker(927.96558, 2076.13110, 9.82031,"cylinder",2,0,0,255,255) 
  
addCommandHandler ( "comprarfabrica", 
function ( player ) 
    local playerTeam = getPlayerTeam ( player ) 
    if ( playerTeam ) then 
        local r, g, b = getTeamColor ( playerTeam ) 
        setRadarAreaColor ( radararea4, r, g, b, 155 ) 
        local money = getPlayerMoney ( player ) 
        if ( money >= 600000 ) then 
            takePlayerMoney ( player, 600000 ) 
            local color = getTeamColor ( playerTeam ) 
            outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang comprei a base #00FF00 FABRICA!", player, 0, 0, 0, true ) 
        end 
    end 
end 
) 
  
function marker ( player ) 
    if(isElementWithinMarker(player,marker3)) then 
        outputChatBox ( "#FFF000 [bASE] #FF0000 Para comprar a base digita #00FF00 /comprarfabrica (600.000$)", player, 0, 0, 0, true) 
    end 
end 

Link to comment
radararea4 = createRadarArea( 996.50629, 2048.92480, -80, 132, 255, 255, 255, 225 ) 
createBlip(939.85992, 2080.10718, 10.82031,62) 
marker3 = createMarker(927.96558, 2076.13110, 9.82031,"cylinder",2,0,0,255,255) 
  
addCommandHandler ( "comprarfabrica", 
function ( player ) 
    local playerTeam = getPlayerTeam ( player ) 
    if ( playerTeam ) then 
        local r, g, b = getTeamColor ( playerTeam ) 
        setRadarAreaColor ( radararea4, r, g, b, 155 ) 
        local money = getPlayerMoney ( player ) 
        if ( money >= 600000 ) then 
            takePlayerMoney ( player, 600000 ) 
            local color = getTeamColor ( playerTeam ) 
            outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang comprei a base #00FF00 FABRICA!", player, 0, 0, 0, true ) 
        end 
    end 
end 
) 
  
addEventHandler("onMarkerHit", marker3, 
function (player) 
    outputChatBox ( "#FFF000 [bASE] #FF0000 Para comprar a base digita #00FF00 /comprarfabrica (600.000$)", player, 0, 0, 0, true) 
end 
) 
     

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