Jump to content

[Help] Turfing


damien111

Recommended Posts

Posted

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 
) 

Posted

this is manve1 turf system, did you ask him?

~ This has to be the worst board post I have ever read. It simply makes no sense. You start off by talking about space or something, then you randomly start babbling about cupcakes, and you end off with random fish names.

~ Don't listen to this guy, any board with the categories 'dinosaurs, spaceships, fried foods, wild animals, alien abductions, business casual, robots, and fireworks' has true potential.

 

Posted

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

Giving a Fuck? Nope, That isn't in My Skill Set

castie11.png

Posted

Manve not only damien111 learn something from your turf system from it and i learn something :) so big thanks you because make this resource

Giving a Fuck? Nope, That isn't in My Skill Set

castie11.png

Posted

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.

Revolution Gaming ~ Race, RPG(coming), TDM(coming) and DayZ(Coming)!

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