manve1 Posted September 2, 2012 Share Posted September 2, 2012 i got a problem, im trying to work out how to get player team so that if a player is on a team, he can only turf, if player doesn't have a team, he can't. addEventHandler( 'onColShapeHit', root, function( p ) -- you should have added player param here if (getPlayerTeam) then if( source == pCuboid ) then outputChatBox("------||~ INFO ~||------", p, 0,255,0) outputChatBox("Turf owners: coming soon!", p, 255,255,0) outputChatBox("Taken time: 10minutes.", p, 255,255,0) outputChatBox("Wait 10min to take turf.", p, 255,255,0) outputChatBox("------||~ END ~||------", p, 255,0,0) setRadarAreaFlashing( pArea, true ) local pTeam = getPlayerTeam( p ) -- source is the col shape, you should use 'p', the player arg local iR, iG, iB = getTeamColor( pTeam ) setTimer( function() setRadarAreaColor (pArea, iR, iG, iB, 100); givePlayerMoney( p, 4000 ); outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); setRadarAreaFlashing( pArea, false ) end, 600000, 1 ) end end end ) Link to comment
Guest Guest4401 Posted September 2, 2012 Share Posted September 2, 2012 addEventHandler( 'onColShapeHit', root, function( p ) -- you should have added player param here if (getPlayerTeam( p )) then if( source == pCuboid ) then outputChatBox("------||~ INFO ~||------", p, 0,255,0) outputChatBox("Turf owners: coming soon!", p, 255,255,0) outputChatBox("Taken time: 10minutes.", p, 255,255,0) outputChatBox("Wait 10min to take turf.", p, 255,255,0) outputChatBox("------||~ END ~||------", p, 255,0,0) setRadarAreaFlashing( pArea, true ) local pTeam = getPlayerTeam( p ) -- source is the col shape, you should use 'p', the player arg local iR, iG, iB = getTeamColor( pTeam ) setTimer( function() setRadarAreaColor (pArea, iR, iG, iB, 100); givePlayerMoney( p, 4000 ); outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); setRadarAreaFlashing( pArea, false ) end, 600000, 1 ) end else outputChatBox("You don't have a team",p) end end ) 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