Yussuf Posted May 30, 2011 Posted May 30, 2011 Hello ! 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 ?
Yussuf Posted May 31, 2011 Author Posted May 31, 2011 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....
Yussuf Posted June 1, 2011 Author Posted June 1, 2011 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 ?
Castillo Posted June 1, 2011 Posted June 1, 2011 It all depends in what game mode are you using at your server, we can't guess.
Castillo Posted June 1, 2011 Posted June 1, 2011 So, you are using Freeroam, right? that resource includes a custom script that gives you a random blip/chat colour.
Yussuf Posted June 2, 2011 Author Posted June 2, 2011 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) ???
CowTurbo Posted June 3, 2011 Posted June 3, 2011 stop playerblips resource, and create your own functions for blips.
CowTurbo Posted June 3, 2011 Posted June 3, 2011 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...
Yussuf Posted June 6, 2011 Author Posted June 6, 2011 Ok thanks ! but always I have an error message : <"exepted ')' near kw2 "> like this ! I tried to edit it but I didn't success ! ????
CowTurbo Posted June 11, 2011 Posted June 11, 2011 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
Yussuf Posted June 11, 2011 Author Posted June 11, 2011 thanks ! but when I tried it , playerblips was changed to red ! any idea ???
Yussuf Posted June 11, 2011 Author Posted June 11, 2011 no ! the red color became the default blipscolor even the player color isn't red :!!!!
Baseplate Posted June 15, 2011 Posted June 15, 2011 hmm you know the rule to do not triple post...don't bump your topic
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