xeon17 Posted January 13, 2014 Share Posted January 13, 2014 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
WASSIm. Posted January 13, 2014 Share Posted January 13, 2014 where function and event ? Link to comment
xeon17 Posted January 13, 2014 Author Share Posted January 13, 2014 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
WASSIm. Posted January 13, 2014 Share Posted January 13, 2014 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
xeon17 Posted January 13, 2014 Author Share Posted January 13, 2014 Thanks bro but i have a problem , when the player get in contact with marker nothing happen , when he write /comprarfabrica , then he get the chatbox from isElementWithinMarker. Link to comment
xeon17 Posted January 13, 2014 Author Share Posted January 13, 2014 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
WASSIm. Posted January 13, 2014 Share Posted January 13, 2014 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
xeon17 Posted January 13, 2014 Author Share Posted January 13, 2014 Nothing happen when a player get in contact with marker. Link to comment
WASSIm. Posted January 13, 2014 Share Posted January 13, 2014 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
xeon17 Posted January 13, 2014 Author Share Posted January 13, 2014 Thank you ! this is perfect , now i know what function i need to use for the market You are best Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now