When I use player.Name in MessagePlayer, the name is shown in white. How to make it color using skin color
https://forum.vc-mp.org/?topic=3834.msg28608#msg28608
You should get an idea from this.
Quote from: KuRiMi on Nov 16, 2017, 05:45 PMhttps://forum.vc-mp.org/?topic=3834.msg28608#msg28608
You should get an idea from this.
this is accually addung class using on scrupt load which I dont want. A direct method I want to know. Cant be their a variable named player.name = player. Colour and and name. If then what would be the syntax
First create a new function like
function GetPlayerTeamColor( Color )
{
if ( Team == 0 )
return "[#00FF50]";
else if ( Team == 1 )
return "[#1E90FF]";
else if ( Team == 2 )
return "[#FFD700]";
else if ( Team == 3 )
return "[#FF0000]";
}
and set each team colors here like I did here
after that, use "+GetPlayerTeamColor( player.Color )+" inside MessagePlayer
try this for example
if ( cmd == "color" )
{
MessagePlayer("Your team color is, "+GetPlayerTeamColor( player.Color ), player );
}
Quote from: umar4911 on Nov 16, 2017, 05:57 PMQuote from: KuRiMi on Nov 16, 2017, 05:45 PMhttps://forum.vc-mp.org/?topic=3834.msg28608#msg28608
You should get an idea from this.
this is accually addung class using on scrupt load which I dont want. A direct method I want to know. Cant be their a variable named player.name = player. Colour and and name. If then what would be the syntax
Are you blind? The one who made that topic literally is asking thing you are.
Quote from: KuRiMi on Nov 16, 2017, 10:46 PMQuote from: umar4911 on Nov 16, 2017, 05:57 PMQuote from: KuRiMi on Nov 16, 2017, 05:45 PMhttps://forum.vc-mp.org/?topic=3834.msg28608#msg28608
You should get an idea from this.
this is accually addung class using on scrupt load which I dont want. A direct method I want to know. Cant be their a variable named player.name = player. Colour and and name. If then what would be the syntax
Are you blind? The one who made that topic literally is asking thing you are.
You did not understand. My colours come in chat but not when using command example /mute player. Message comes Admin muted player. I want that the "player" colour should be changed to player colour
I made a code
local plrName = playernamecolorshow(plr, plr.Team) + plr.Name + "[#FFFFFF]";
local playerName = playernamecolorshow(player, player.Team) + player.Name + "[#FFFFFF]";
the playerName worked but plrName gives error
Quote from: zeus on Nov 18, 2017, 12:26 PMQuote from: umar4911 on Nov 18, 2017, 07:25 AMerror
Post it here
The index plr does not exist
then I used if(!plr) but still not
Off topic: 100 post 8)
Quote from: umar4911 on Nov 18, 2017, 12:47 PMQuote from: zeus on Nov 18, 2017, 12:26 PMQuote from: umar4911 on Nov 18, 2017, 07:25 AMerror
Post it here
The index plr does not exist
then I used if(!plr) but still not
Off topic: 100 post 8)
Have you declared the plr variable?
Quote from: umar4911 on Nov 18, 2017, 07:25 AMI made a code
local plrName = playernamecolorshow(plr, plr.Team) + plr.Name + "[#FFFFFF]";
local playerName = playernamecolorshow(player, player.Team) + player.Name + "[#FFFFFF]";
the playerName worked but plrName gives error
Quote from: umar4911 on Nov 18, 2017, 01:16 PMI used local plr = 0
You have set the index plr to integer and tried to get an instance value plr.Team
Use
local plr = player;
if it doesn't solve your problem use
local plr = FindPlayer(0);
Quote from: zeus on Nov 18, 2017, 01:40 PMQuote from: umar4911 on Nov 18, 2017, 07:25 AMI made a code
local plrName = playernamecolorshow(plr, plr.Team) + plr.Name + "[#FFFFFF]";
local playerName = playernamecolorshow(player, player.Team) + player.Name + "[#FFFFFF]";
the playerName worked but plrName gives error
Quote from: umar4911 on Nov 18, 2017, 01:16 PMI used local plr = 0
You have set the index plr to integer and tried to get an instance value plr.Team
Use
local plr = player;
if it doesn't solve your problem use
local plr = FindPlayer(0);
Actually I have local plr in many other cmds and both didnot work
I solved it my myself