SA-MP Forums Archive
[HELP WANTED] I need some help with player colors and some other things - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP WANTED] I need some help with player colors and some other things (/showthread.php?tid=100355)



[HELP WANTED] I need some help with player colors and some other things - dirkblok - 04.10.2009

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


Re: [HELP WANTED] I need some help with player colors and some other things - [XST]O_x - 04.10.2009

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?


Re: [HELP WANTED] I need some help with player colors and some other things - Peter_Corneile - 05.10.2009

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


Re: [HELP WANTED] I need some help with player colors and some other things - pagie1111 - 05.10.2009

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;
}