damien111 Posted February 2, 2013 Share Posted February 2, 2013 I need help with getting this to work, there will probally be more questions after this on this topic, okay, so right now , the problem is that i get a debug error when i try to get the teamcolor..Im not sure why, as it is all defined, any ideas? local pArea = createRadarArea( -1442.904296875, -971.251953125, 100, 100, 0, 0, 0, 125 ) local pCuboid = createColRectangle( -1442.904296875, -971.251953125, 100, 100 ) BigSmokes = createTeam("Nazis", 255, 0, 255) addEventHandler("onResourceStart",resourceRoot,function() end ) addEventHandler('onColShapeHit', root, function( p ) -- you should have added player param here local pTeam = getPlayerTeam( p ) local iR, iG, iB = getTeamColor( pTeam ) local rR, rG, rB = getRadarAreaColor ( pArea ) if (getPlayerTeam( p )) then if( source == pCuboid ) then if ( iR == rR and iG == rG and iB == rB ) then else if(getElementData( aCuboid, "TurfInProgress" )) then else setRadarAreaFlashing ( aArea, true ) setElementData( aCuboid, "TurfInProgress", true ) wave1 = setTimer( function() setElementData( aCuboid, "TurfInProgress", false ) setRadarAreaColor ( aArea, tR, tG, tB, 125 ) setRadarAreaFlashing ( aArea, false) country = getElementData( p, "Country" ) setElementData( aArea, "CountryOwned", country) end, 60000, 1 ) end end end end end ) addEventHandler( 'onColShapeLeave', root, function( ) if( source == pCuboid ) then setRadarAreaFlashing( pArea, false ) setElementData( aCuboid, "TurfInProgress", false ) setRadarAreaFlashing ( aArea, false) end end ) addEventHandler( "onPlayerWasted", getRootElement( ), function() if( source == pCuboid ) then setRadarAreaFlashing( pArea, false ) setElementData( aCuboid, "TurfInProgress", false ) setRadarAreaFlashing ( aArea, false) end end ) Link to comment
AJXB Posted February 2, 2013 Share Posted February 2, 2013 this is manve1 turf system, did you ask him? Link to comment
damien111 Posted February 2, 2013 Author Share Posted February 2, 2013 I cut out alot of it, i took some basics as i was learning from it, i had waves of NPC's and such, but no, i didn't. Link to comment
damien111 Posted February 2, 2013 Author Share Posted February 2, 2013 And actually this has a bit more Link to comment
K4stic Posted February 2, 2013 Share Posted February 2, 2013 it's basic and easy local pArea = createRadarArea( -1442.904296875, -971.251953125, 100, 100, 0, 0, 0, 125 ) local pCuboid = createColRectangle( -1442.904296875, -971.251953125, 100, 100 ) BigSmokes = createTeam("Nazis", 255, 0, 255) addEventHandler("onResourceStart",resourceRoot,function() end ) addEventHandler('onColShapeHit', root, function( p ) -- you should have added player param here local iR, iG, iB = getTeamColor(getPlayerTeam( p ) ) local rR, rG, rB = getRadarAreaColor ( pArea ) if (getPlayerTeam( p )) then if( source == pCuboid ) then if ( iR == rR and iG == rG and iB == rB ) then else if(getElementData( aCuboid, "TurfInProgress" )) then else setRadarAreaFlashing ( aArea, true ) setElementData( aCuboid, "TurfInProgress", true ) wave1 = setTimer( function() setElementData( aCuboid, "TurfInProgress", false ) setRadarAreaColor ( aArea, tR, tG, tB, 125 ) setRadarAreaFlashing ( aArea, false) country = getElementData( p, "Country" ) setElementData( aArea, "CountryOwned", country) end, 60000, 1 ) end end end end end ) addEventHandler( 'onColShapeLeave', root, function( ) if( source == pCuboid ) then setRadarAreaFlashing( pArea, false ) setElementData( aCuboid, "TurfInProgress", false ) setRadarAreaFlashing ( aArea, false) end end ) addEventHandler( "onPlayerWasted", getRootElement( ), function() if( source == pCuboid ) then setRadarAreaFlashing( pArea, false ) setElementData( aCuboid, "TurfInProgress", false ) setRadarAreaFlashing ( aArea, false) end end ) and replace all aCuboid to pCuboid and aArea to pArea Link to comment
manve1 Posted February 2, 2013 Share Posted February 2, 2013 this is manve1 turf system, did you ask him? If someone is learning from a script that i made, i'm ok with it Link to comment
K4stic Posted February 2, 2013 Share Posted February 2, 2013 Manve not only damien111 learn something from your turf system from it and i learn something so big thanks you because make this resource Link to comment
manve1 Posted February 2, 2013 Share Posted February 2, 2013 Np Skipper, but I can't be bothered to update it, so im alright if people learn from it and make their own Link to comment
Adistar Posted February 3, 2013 Share Posted February 3, 2013 As skipper said, you should change all aArea/aCuboid to pArea/pCuboid because the p gets the playerteam as it has a function in the script. Link to comment
damien111 Posted February 3, 2013 Author Share Posted February 3, 2013 Yeah, Thanks again i guess I made it like 3000 times more complex with a bunch of shit for the WW2 server so Link to comment
Adistar Posted February 3, 2013 Share Posted February 3, 2013 Haha aight, will visit it once when you're done 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