Yussuf Posted May 30, 2011 Share 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 ? Link to comment
Yussuf Posted May 31, 2011 Author Share 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.... Link to comment
Castillo Posted May 31, 2011 Share Posted May 31, 2011 https://wiki.multitheftauto.com/wiki/GetTeamColor Link to comment
Yussuf Posted June 1, 2011 Author Share 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 ? Link to comment
Castillo Posted June 1, 2011 Share Posted June 1, 2011 It all depends in what game mode are you using at your server, we can't guess. Link to comment
Yussuf Posted June 1, 2011 Author Share Posted June 1, 2011 I'm using Play mode ! any idea ??? Link to comment
Castillo Posted June 1, 2011 Share Posted June 1, 2011 So, you are using Freeroam, right? that resource includes a custom script that gives you a random blip/chat colour. Link to comment
Yussuf Posted June 2, 2011 Author Share 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) ??? Link to comment
CowTurbo Posted June 3, 2011 Share Posted June 3, 2011 stop playerblips resource, and create your own functions for blips. Link to comment
Yussuf Posted June 3, 2011 Author Share Posted June 3, 2011 Can you help me to do it ? Link to comment
CowTurbo Posted June 3, 2011 Share 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... Link to comment
Yussuf Posted June 6, 2011 Author Share 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 ! ???? Link to comment
CowTurbo Posted June 11, 2011 Share 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 Link to comment
Yussuf Posted June 11, 2011 Author Share Posted June 11, 2011 thanks ! but when I tried it , playerblips was changed to red ! any idea ??? Link to comment
CowTurbo Posted June 11, 2011 Share Posted June 11, 2011 was team color or nametag color red for player? Link to comment
Yussuf Posted June 11, 2011 Author Share Posted June 11, 2011 no ! the red color became the default blipscolor even the player color isn't red :!!!! Link to comment
Baseplate Posted June 15, 2011 Share Posted June 15, 2011 hmm you know the rule to do not triple post...don't bump your topic Link to comment
Yussuf Posted June 23, 2011 Author Share Posted June 23, 2011 I need answer please... 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