Can anyone find/make me... ahem.. a /n(ewbie) channel?
#1

So well I have a roleplay server with a nice GM, but it needs some optimization.. first is the newbie chat channel (/n)
please help me with it.
PS : I'm a begginer so be easy on me..!
Reply
#2

You want "/n [Message]"?

Edit: correct me if im wrong
Reply
#3

Try this

pawn Код:
new bool:NewbieChat;
pawn Код:
public OnGameModeInit()
{
    NewbieChat = true;
    return 1;
}
Toggle for /n [chat]

pawn Код:
if(!strcmp(cmdtext, "/togglenc", true, 9))
{
    if(NewbieChat == true)
    {
        SendClientMessage(playerid, COLOR, "Newbie chat disabled");
        NewbieChat = false;
    }
    else
    {
        SendClientMessage(playerid, COLOR, "Newbie chat enabled");
        NewbieChat = true;
    }
    return 1;
}
chat cmd

pawn Код:
if(!strcmp(cmdtext,"/n",true,2))
{
  if(PlayerInfo[playerid][Newbie] ==0) return SendClientMessage(playerid,0xffffffaa,"You are not a newbie"); //checking if a player is not a noob, change it to your variable if any
  if(NewbieChat == false) return SendClientMessaeg(playerid, COLOR, "Newbie chat is disabled!");
  new name[MAX_PLAYER_NAME];
  new string[256];
  GetPlayerName(playerid,name,sizeof(name));

  for(new i=0; i< MAX_PLAYERS;i++)
  {
    if(PlayerInfo[i][Newbie] ==1)
    {
      format(string,sizeof(string),"[NewbieChat] %s: %s",name,cmdtext[3]);
      SendClientMessage(i,0xffffffaa,string);
    }
  }
  return 1;
}
Not tested
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)