[HELP WANTED] I need some help with player colors and some other things
#1

Hello, I would like to have some help with player colors,

You know, when you press TAB in-game you see the list of players in game with all kinds of colors, how can I make it so everyone has got a white color as name?

And how can I make that if you talk not everyone in the game hears it but only players near you?

Hope u understand, Thanks alot if you would like to help me out...

Thanks

Dirk
Reply
#2

Hmm sorry, i dont know about the second question,but about the name colors..
Add this under OnPlayerSpawn
pawn Код:
SetPlayerColor(playerid,0xFFFFFFFF);
Very simple isnt it?
Reply
#3

FIrst you gotta make classes to be chosen and maybe use gTeam .. Then you need to make under OnPlayerSpawn you can make colors by using
Код:
SetPlayerColor(playerid,COLOR_ID);
as 3xPloSioNxXx already told you
Reply
#4

When you connect to a server you are auto-matically given a color, so if you do this on public OnPlayerRequestClass(playerid, classid); it will show them as white once the server will return 1; for IsPlayerConnected(playerid)

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerColor(playerid,0xFFFFFFFF);
return 1;
}
or you can choose to use OnPlayerUpdate(playerid); - this can be useful to detect exactly when they return 1 on connection... like so


pawn Код:
public OnPlayerUpdate(playerid)
{
if(IsPlayerConnected(playerid) == 1)
{
SetPlayerColor(playerid,0xFFFFFFFF);
return 1;
}

return 0;
}

This function is frequently called, about every second


now here for the chat
pawn Код:
#define CHATRADIUS /*radius*/

public OnGameModeInit()
{
  LimitGlobalChatRadius(CHATRADIUS);
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)