IRC cmd...
#1

Hey, I tried to make a /irc command but when i write anything it spams the chat with the irc message...

pawn Код:
dcmd_irc(playerid,params[])
    {
        new pName[MAX_PLAYER_NAME],string[256];
        GetPlayerName(playerid,pName,sizeof(pName));
        format(string,sizeof(string),"IRC: %s [%d]: %s",pName,playerid,params[0]);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
        if(PlayerInfo[i][pAdmin] >= 1)
        {
          SendClientMessage(i,COLOR_BLUEMEDIUM,string);
        }
        SendClientMessage(playerid,COLOR_BLUEMEDIUM,string);
        }
        return 1;
    }
thanks
Reply
#2

Try:
pawn Код:
dcmd_irc(playerid,params[])
{
  new pName[MAX_PLAYER_NAME],string[256];
  GetPlayerName(playerid,pName,sizeof(pName));
  format(string,sizeof(string),"IRC: %s [%d]: %s",pName,playerid,params[0]);
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
    if(PlayerInfo[i][pAdmin] >= 1)
    {
      SendClientMessage(i,COLOR_BLUEMEDIUM,string);
    }
  }
  SendClientMessage(playerid,COLOR_BLUEMEDIUM,string);
  return 1;
}
Reply
#3

ye that worked xD thx
Reply
#4

Ur welcome.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)