Question And Error..
#1

Okay So Far i Want the players name And Id to show in there text.. k Well it works It shows Buzzbomb(0): BLahh

But When i get More then 3 Players or More My name Turns into Buzzbomb: BLAHH

Here my Code

pawn Код:
if(ChatSystem == 1)
   {
       new pName[MAX_PLAYER_NAME],str[128];
       GetPlayerName(playerid,pName,sizeof(pName));
       format(str,sizeof(str),"%s(%d): %s",pName,playerid,text);
       SendClientMessageToAll(WHITE,str);
       return 0;
   }
I have alot others and Ive done research and wiki and Im getting confused half the time i want to rip my eyes out...
Please help me before i lose My eye sight..
Reply
#2

The code looks alright. Make sure there is no other chat system that interferes with this one.
Reply
#3

I have These But Would they be causing problems

pawn Код:
public OnPlayerText(playerid, text[])
{
   for(new i = 0; i <MAX_PLAYERS; i++)
   {
      if(AdminOn == 0)
      {
           new pName[MAX_PLAYER_NAME],str[128];
           GetPlayerName(playerid,pName,sizeof(pName));
           format(str,sizeof(str),"%s(%i):{FFFFFF} %s",pName,playerid,text);
           SendClientMessageToAll(RED,str);
           ChatSystem = 0;
           return 0;
      }
      else if(PlayerInfo[playerid][pMechTeam] == 5)
      {
           new pName[MAX_PLAYER_NAME],str[128];
           GetPlayerName(playerid,pName,sizeof(pName));
           format(str,sizeof(str),"%s(%i):{FFFFFF} %s",pName,playerid,text);
           SendClientMessageToAll(BROWN,str);
           ChatSystem = 0;
           return 0;
       }
      else if(PlayerInfo[playerid][pMedicTeam] == 4)
      {
           new pName[MAX_PLAYER_NAME],str[128];
           GetPlayerName(playerid,pName,sizeof(pName));
           format(str,sizeof(str),"%s(%i):{FFFFFF} %s",pName,playerid,text);
           SendClientMessageToAll(PINK,str);
           ChatSystem = 0;
           return 0;
       }
      else if(PlayerInfo[playerid][pPoliceTeam] == 3)
      {
           new pName[MAX_PLAYER_NAME],str[128];
           GetPlayerName(playerid,pName,sizeof(pName));
           format(str,sizeof(str),"%s(%i):{FFFFFF} %s",pName,playerid,text);
           SendClientMessageToAll(LIGHTBLUE,str);
           ChatSystem = 0;
           return 0;
       }
       else if(PlayerInfo[playerid][pFireTeam] == 2)
       {
           new pName[MAX_PLAYER_NAME],str[128];
           GetPlayerName(playerid,pName,sizeof(pName));
           format(str,sizeof(str),"%s(%i):{FFFFFF} %s",pName,playerid,text);
           SendClientMessageToAll(LIGHTRED,str);
           ChatSystem = 0;
           return 0;
       }
   }
   if(ChatSystem == 1)
   {
       new pName[MAX_PLAYER_NAME],str[128];
       GetPlayerName(playerid,pName,sizeof(pName));
       format(str,sizeof(str),"%s(%i): %s",pName,playerid,text);
       SendClientMessageToAll(WHITE,str);
       return 0;
   }
   return 1;
}
Reply
#4

It would be nice if Someone would respond..
Reply
#5

So uhhm, what exactly is the problem? the disappearing (0)?
Reply
#6

Um yeah and other names..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)