Jump to content

BaseArea51.


xeon17

Recommended Posts

Hello ,i crated a script Area51 base and the base can be buyed . TAPL helped me allerdy 1 time but i wanna change my gang system and how now when some gang buy the base , the base no get that gang's color can someone help me please

Here the Area 51 base script :

radararea2 = createRadarArea( 110.91990, 1800.89435, 200, 145, 255, 255, 255, 225 ) 
createBlip(279.40317, 1831.25439, 7.72656,61) 
marker2 = createMarker(298.98865, 1815.90613, 3.71094,"cylinder",2,0,0,255,255)   
addCommandHandler("buyarea51", 
function(player) 
    local gangName = exports.gang_system:getPlayerGang(player) 
    if gangName then 
        local money = getPlayerMoney(player) 
        if (money >= 1000000) then 
            takePlayerMoney(player, 1000000) 
            local color = exports.gang_system:getGangColor(gangName) 
            setRadarAreaColor(radararea, color[1], color[2], color[2], 255) 
            outputChatBox("#FFF000[bASE] #00FFFFYour gang buyed a base #00FF00 Area #FFF000 51", player, 0, 0, 0, true) 
        end 
    end 
end) 

The gang system what i use now , not the old Solidsnake's gang system.

local root = getRootElement() 
  
function create( player, commandName, teamName ) 
    if ( getPlayerTeam(player) ~= false ) and ( countPlayersInTeam(getPlayerTeam(player)) == 1 ) then 
                destroyElement(getPlayerTeam(player)) 
            end 
    local dasTeam = getTeamFromName ( teamName ) 
    if ( dasTeam ) then 
        setPlayerTeam ( player, dasTeam ) 
        if ( dasTeam ) then 
            outputChatBox( getPlayerName(player) .." has joined the gang "..teamName, root, 255, 0, 0) 
            local tr, tg, tb = getTeamColor(gang) 
            setPlayerNametagColor ( player, tr, tg, tb )         
        end 
    else 
        local gang = createTeam( teamName ) 
        if (gang) then  
            setPlayerTeam( player, gang ) 
            setTeamColor ( gang, math.random(0,255), math.random(0,255), math.random(0,255) ) 
            outputChatBox( getPlayerName(player) .." has created the gang " ..teamName, root, 255, 0, 0) 
        end 
    end 
         
end 
addCommandHandler("gang", create ) 
  
function nogangdamage ( player ) 
    local dieGang = getPlayerTeam ( player ) 
    if ( getTeamFriendlyFire( dieGang ) == true ) then 
        setTeamFriendlyFire ( dieGang, false) 
        outputChatBox("FriendlyFire disabled", player, 255, 0, 0 ) 
    else 
        setTeamFriendlyFire ( dieGang, true ) 
        outputChatBox("FriendlyFire enabled", player, 255, 0, 0 ) 
    end 
     
end 
addCommandHandler("gangff", nogangdamage ) 
  
function gangFarbe ( player, commandName, r, g, b ) 
    local team = getPlayerTeam ( player ) 
    setTeamColor ( team, r, g, b ) 
    outputChatBox("The Gang "..getTeamName(team).." changed the color", root, tonumber(r), tonumber(g), tonumber(b)) 
end 
addCommandHandler("gangcolor", gangFarbe ) 
  
function gangName ( player, commandName, newName ) 
    local theTeam = getPlayerTeam ( player ) 
    setTeamName ( theTeam, newName ) 
    outputChatBox("The gang "..getTeamName(theTeam).." changed the name to "..newName, root, 255, 0, 0) 
end 
addCommandHandler("gangname", gangName ) 
  
  
function deletegang () 
    if ( getPlayerTeam(source) ~= false ) and ( countPlayersInTeam(getPlayerTeam(source)) == 1 ) then 
        destroyElement(getPlayerTeam(source)) 
    end 
end 
addEventHandler("onPlayerQuit", getRootElement(), deletegang) 
  
function quitgang(player, cmd) 
    if ( getPlayerTeam(player) ~= false ) then 
        local team = getPlayerTeam(player) 
        outputChatBox(getPlayerName(player).." quitted the gang "..getTeamName(team), getRootElement(), 255, 255, 0) 
        setPlayerTeam(player, nil) 
    end 
end 
addCommandHandler("quitgang", quitgang) 
  

Link to comment
radararea2 = createRadarArea( 110.91990, 1800.89435, 200, 145, 255, 255, 255, 225 ) 
createBlip(279.40317, 1831.25439, 7.72656,61) 
marker2 = createMarker(298.98865, 1815.90613, 3.71094,"cylinder",2,0,0,255,255)   
addCommandHandler("buyarea51", 
function(player) 
    local gangName = exports.gang_system:getPlayerGang(player) 
    if gangName then 
        local money = getPlayerMoney(player) 
        if (money >= 1000000) then 
            takePlayerMoney(player, 1000000) 
            local color = exports.gang_system:getGangColor(gangName) 
            setRadarAreaColor(radararea2, color[1], color[2], color[2], 255) 
            outputChatBox("#FFF000[bASE] #00FFFFYour gang buyed a base #00FF00 Area #FFF000 51", player, 0, 0, 0, true) 
        end 
    end 
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...