[SOLVED]Please Help this Rank Chat
#1

I don't know what is wrong I made this and when ever player writes something it

All the textmessage shows at the same time

pawn Код:
if(GetPlayerScore(playerid) >=0)
  {
    new str[128], Pname[24];
    GetPlayerName(playerid, Pname, 24);
    format(str, sizeof(str), "[Private]%s: %s", Pname, text);
    SendClientMessageToAll(COLOR_ORANGE, str);
   
    }
  if(GetPlayerScore(playerid) >=10)
  {
    new str[128], Pname[24];
    GetPlayerName(playerid, Pname, 24);
    format(str, sizeof(str), "[Corporal]%s: %s", Pname, text);
    SendClientMessageToAll(COLOR_ORANGE, str);
   
  }
  if(GetPlayerScore(playerid) >=20)
  {
    new str[128], Pname[24];
    GetPlayerName(playerid, Pname, 24);
    format(str, sizeof(str), "[Sergeant]%s: %s", Pname, text);
    SendClientMessageToAll(COLOR_ORANGE, str);
   
    }
  if(GetPlayerScore(playerid) >=30)
  {
    new str[128], Pname[24];
    GetPlayerName(playerid, Pname, 24);
    format(str, sizeof(str), "[Lieutenant]%s: %s", Pname, text);
    SendClientMessageToAll(COLOR_ORANGE, str);
   
    }
  if(GetPlayerScore(playerid) >=40)
  {
    new str[128], Pname[24];
    GetPlayerName(playerid, Pname, 24);
    format(str, sizeof(str), "[Major]%s: %s", Pname, text);
    SendClientMessageToAll(COLOR_ORANGE, str);
   
    }
  if(GetPlayerScore(playerid) >=50)
  {
    new str[128], Pname[24];
    GetPlayerName(playerid, Pname, 24);
    format(str, sizeof(str), "[Colonel]%s: %s", Pname, text);
    SendClientMessageToAll(COLOR_ORANGE, str);
   
    }
  if(GetPlayerScore(playerid) >=70)
  {
    new str[128], Pname[24];
    GetPlayerName(playerid, Pname, 24);
    format(str, sizeof(str), "[LieutenantColonel]%s: %s", Pname, text);
    SendClientMessageToAll(COLOR_ORANGE, str);
   
    }
  if(GetPlayerScore(playerid) >=90)
  {
    new str[128], Pname[24];
    GetPlayerName(playerid, Pname, 24);
    format(str, sizeof(str), "[MajorGeneral]%s: %s", Pname, text);
    SendClientMessageToAll(COLOR_DARKRED, str);
   
    }
  if(GetPlayerScore(playerid) >=110)
  {
    new str[128], Pname[24];
    GetPlayerName(playerid, Pname, 24);
    format(str, sizeof(str), "[General]%s: %s", Pname, text);
    SendClientMessageToAll(COLOR_DARKRED, str);
   
    }
  if(GetPlayerScore(playerid) >=210)
  {
    new str[128], Pname[24];
    GetPlayerName(playerid, Pname, 24);
    format(str, sizeof(str), "[GeneralOfTheArmy]%s: %s", Pname, text);
    SendClientMessageToAll(COLOR_RED, str);
   
    }
  return 0;
Reply
#2

Put them in reverse order, and add return 0; after each SendClientMessage

pawn Код:
if(GetPlayerScore(playerid) >=210)
  {
    new str[128], Pname[24];
    GetPlayerName(playerid, Pname, 24);
    format(str, sizeof(str), "[GeneralOfTheArmy]%s: %s", Pname, text);
    SendClientMessageToAll(COLOR_RED, str);
    return 0;
}
if(GetPlayerScore(playerid) >=110)
  {
    new str[128], Pname[24];
    GetPlayerName(playerid, Pname, 24);
    format(str, sizeof(str), "[General]%s: %s", Pname, text);
    SendClientMessageToAll(COLOR_DARKRED, str);
    return 0;
}
//etc.
Reply
#3

Quote:
Originally Posted by Joe Staff
Put them in reverse order, and add return 0; after each SendClientMessage

pawn Код:
if(GetPlayerScore(playerid) >=210)
  {
    new str[128], Pname[24];
    GetPlayerName(playerid, Pname, 24);
    format(str, sizeof(str), "[GeneralOfTheArmy]%s: %s", Pname, text);
    SendClientMessageToAll(COLOR_RED, str);
    return 0;
}
if(GetPlayerScore(playerid) >=110)
  {
    new str[128], Pname[24];
    GetPlayerName(playerid, Pname, 24);
    format(str, sizeof(str), "[General]%s: %s", Pname, text);
    SendClientMessageToAll(COLOR_DARKRED, str);
    return 0;
}
//etc.
Thanks And I will try
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)