enum pInfo { pDonator, pAdmin } new PlayerInfo[MAX_PLAYERS][pInfo];
public OnPlayerText(playerid, text[]) { if(PlayerInfo[playerid][pAdmin] >= 1) //pAdmin is my enum i don't know whats your enum, also number "1" indicates the level of the admin, i got 1-8 admin levels, you can choose what level are yours. { new string[150], name[MAX_PLAYER_NAME]; //Lets make a new string and a name.. GetPlayerName(playerid, name, MAX_PLAYER_NAME); // This is the name format(string,sizeof(string),"{993300}[ADMIN] {33CC99}%s {999999}[%i]: {FFFFFF}%s", name, playerid, text); //Make your format, you can change the colors... SendClientMessageToAll(GetPlayerColor(playerid), string); //SendClientMessageToAll so all can see your chat, "GetPlayerColor" doesn't work if put a color on his name, remove the color so he if he do /red ( if you have a command ) his name will be color red.. return 0; }
if(PlayerInfo[playerid][pDonator] >= 1) { new string[150], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); format(string,sizeof(string),"{FF6600}[DONATOR] {990099}%s {999999}[%i]: {FFFFFF}%s", name, playerid, text); SendClientMessageToAll(GetPlayerColor(playerid), string); return 0; }
if(PlayerInfo[playerid][pAdmin] >= 0) //Recommended, also put this at the really bottom( i don't know why), just put in at the very bottom at the Playertext, this is the Chat of the Player we need GetPlayercolor here.. { new string[150], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); format(string,sizeof(string),"%s {999999}[%i]: {FFFFFF}%s", name, playerid, text); SendClientMessageToAll(GetPlayerColor(playerid), string); return 0; } return 1; }
public OnPlayerText(playerid, text[]) { if(PlayerInfo[playerid][pAdmin] >= 1) { new string[150], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); format(string,sizeof(string),"{993300}[ADMIN] {33CC99}%s {999999}[%i]: {FFFFFF}%s", name, playerid, text); SendClientMessageToAll(GetPlayerColor(playerid), string); return 0; } if(PlayerInfo[playerid][pDonator] >= 1) { new string[150], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); format(string,sizeof(string),"{FF6600}[DONATOR] {990099}%s {999999}[%i]: {FFFFFF}%s", name, playerid, text); SendClientMessageToAll(GetPlayerColor(playerid), string); return 0; } if(PlayerInfo[playerid][pAdmin] >= 0) { new string[150], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); format(string,sizeof(string),"%s {999999}[%i]: {FFFFFF}%s", name, playerid, text); SendClientMessageToAll(GetPlayerColor(playerid), string); return 0; } return 1; }
public OnPlayerText(playerid, text[])
{
new string[128], name[MAX_PLAYER_NAME] ;
GetPlayerName(playerid, name, sizeof(name));
if(PlayerInfo[playerid][pAdmin] >= 1)
{
format(string,sizeof(string),"{993300}[ADMIN] {33CC99}%s {999999}[%i]: {FFFFFF}%s", name, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string); // ?? GetPlayerColor???? you put color {993300}
return 0;
}
else if(PlayerInfo[playerid][pDonator] >= 1)
{
format(string,sizeof(string),"{FF6600}[DONATOR] {990099}%s {999999}[%i]: {FFFFFF}%s", name, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string); // Again use GetPlayerColor?? Put color {FF6600}
return 0;
}
else
{
format(string,sizeof(string),"%s {999999}[%i]: {FFFFFF}%s", name, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
return 1;
}
I not see a tutorial, I see a broken script without offending
i think: pawn Код:
|
public OnPlayerText(playerid, text[])
{
new string[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(PlayerInfo[playerid][pAdmin])
format(string,sizeof(string),"{993300}[ADMIN] {%06x}%s {999999}[%i]: {FFFFFF}%s", GetPlayerColor(playerid) >>> 8, name, playerid, text);
else if(PlayerInfo[playerid][pDonator])
format(string,sizeof(string),"{FF6600}[DONATOR] {%06x}%s {999999}[%i]: {FFFFFF}%s", GetPlayerColor(playerid) >>> 8, name, playerid, text);
else
format(string,sizeof(string),"%s {999999}[%i]: {FFFFFF}%s", name, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
Can't use case in that case, because it's not the same variable,
read this A better way to do it. pawn Код:
|