Jump to content

Gang's problem


Yussuf

Recommended Posts

Posted

Hello ! :D

I have a gangs system , but when a player create a team , the teams don't be saved ! (I have a save system) !?

And i would that player's colors (chatbox/radar) be assigned by the team color , and if they didn't joined any team , the default color is white !

Please , do you have a solution for my 2 question ?

Posted

Hi ! I think that I get a solution to solve gang problem....

Can any one give me an idea about nickname's0 color (radar/chatbox) just this !!!!

Please....

Posted

Thanks !

But it don't show the player's color in the chatbox/radar ! It shows player's color just when he died (kill message) !

do you have an idea ?

Posted

I have a problem ! player's blip color is always green ! How can I change it like color team (=> if team color red , player's blip red) ???

Posted

or, easyest way is edit playerblips resource.

-- needs configurable blip colors, and team support 
root = getRootElement () 
players = {} 
resourceRoot = getResourceRootElement ( getThisResource () ) 
  
function onResourceStart ( resource ) 
    for id, player in ipairs( getElementsByType ( "player" ) ) do 
        if ( players[player] ) then 
            if ( getPlayerTeam" class="kw2">getPlayerTeam ( player ) ) then 
            local r, g, b = getTeamColor ( player ) 
            createBlipAttachedTo ( player, 0, 2, r, g, b ) 
        else 
            createBlipAttachedTo ( player, 0, 2, 255,255,255 ) 
        end 
        else 
            createBlipAttachedTo ( player, 0, 2, r,g,b ) 
        end 
    end 
end 
  
function onPlayerSpawn ( spawnpoint ) 
    if ( players[source] ) then 
    if ( getPlayerTeam" class="kw2">getPlayerTeam ( player ) ) then 
            local r, g, b = getTeamColor ( player ) 
            createBlipAttachedTo ( player, 0, 2, r, g, b ) 
        else 
            createBlipAttachedTo ( player, 0, 2, 255,255,255 ) 
        end 
    else 
        local r, g, b = getPlayerNametagColor ( player ) 
        createBlipAttachedTo ( source, 0, 2, r, g, b ) 
    end 
end 
  
function onPlayerQuit () 
    destroyBlipsAttachedTo ( source ) 
end 
  
  
  
function onPlayerWasted ( totalammo, killer, killerweapon ) 
    destroyBlipsAttachedTo ( source ) 
end 
  
function setBlipsColor ( source, commandName, r, g, b ) 
    if ( tonumber ( b ) ) then 
        color = { tonumber ( r ), tonumber ( g ), tonumber ( b ) } 
        for id, player in ipairs( getElementsByType ( "player" ) ) do 
            destroyBlipsAttachedTo ( player ) 
            if ( players[player] ) then 
                if ( getPlayerTeam" class="kw2">getPlayerTeam ( player ) ) then 
                local r, g, b = getTeamColor ( player ) 
                createBlipAttachedTo ( player, 0, 2, r, g, b ) 
              else 
                createBlipAttachedTo ( player, 0, 2, 255,255,255 ) 
             end 
            else 
                local r, g, b = getPlayerNametagColor ( player ) 
                createBlipAttachedTo ( player, 0, 2, r, g, b ) 
            end 
        end 
    end 
end 
  
function setBlipColor ( source, commandName, r, g, b ) 
    if ( tonumber ( b ) ) then 
        destroyBlipsAttachedTo ( source ) 
        players[source] = { tonumber ( r ), tonumber ( g ), tonumber ( b ) } 
        if ( getPlayerTeam" class="kw2">getPlayerTeam ( player ) ) then 
            local r, g, b = getTeamColor ( player ) 
            createBlipAttachedTo ( player, 0, 2, r, g, b ) 
        else 
            createBlipAttachedTo ( player, 0, 2, 255,255,255 ) 
        end 
    end 
end 
  
addCommandHandler ( "setblipscolor", setBlipsColor ) 
addCommandHandler ( "setblipcolor", setBlipColor ) 
addEventHandler ( "onResourceStart", resourceRoot, onResourceStart ) 
addEventHandler ( "onPlayerSpawn", root, onPlayerSpawn ) 
addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) 
addEventHandler ( "onPlayerWasted", root, onPlayerWasted ) 
  
function destroyBlipsAttachedTo(player) 
    local attached = getAttachedElements ( player ) 
    if ( attached ) then 
        for k,element in ipairs(attached) do 
            if getElementType ( element ) == "blip" then 
                destroyElement ( element ) 
            end 
        end 
    end 
end 

try this... :/

Posted

Ok thanks !

but always I have an error message : <"exepted ')' near kw2 "> like this ! I tried to edit it but I didn't success !

????

Posted

replace all those lines which u found after copying text:

if ( getPlayerTeam" class="kw2">getPlayerTeam ( player ) ) then

with

if ( getPlayerTeam ( player ) )

(( [lua][/lua] tags makes getPlayerTeam and set .. to wrong :S

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