How to make this OnPlayerText ?
#1

Its like .. when a elader of the team speacks... and before his name on the chat box .... comes
[LEADER] %S: %S
hOW
Код:
if(text[0] == '!')
	{
	  new string[128];  GetPlayerName(playerid, string, sizeof(string));
	  format(string, sizeof(string), "[*May Day!] %s: %s", string, text[1]);
I started it but i dont want to to be with the '!' to type the message .. if it is posible to make it automaticly.
And this is the team i want it to be TEAM_LEADER
Reply
#2

Try this (Not tested but should work)

pawn Код:
public OnPlayerText(playerid, text[])
{
  if(GetPlayerTeam(playerid) == TEAM_LEADER)
  {
    new str[128];
    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    format(str, sizeof(str), "[LEADER] %s: %s", playername, text[1]);
    //for(new i = 0; i < MAX_PLAYERS; i++)
      //if(IsPlayerConnected(i) && GetPlayerTeam(i) == GetPlayerTeam(playerid))
        //SendClientMessage(i, GetPlayerColor(playerid), str);
    return 0;
  }

  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)