Can anyone find/make me... ahem.. a /n(ewbie) channel? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Can anyone find/make me... ahem.. a /n(ewbie) channel? (
/showthread.php?tid=233711)
Can anyone find/make me... ahem.. a /n(ewbie) channel? -
anant - 02.03.2011
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..!
Re: Can anyone find/make me... ahem.. a /n(ewbie) channel? -
HyperZ - 02.03.2011
You want "/n [Message]"?
Edit: correct me if im wrong
Re: Can anyone find/make me... ahem.. a /n(ewbie) channel? -
Medal Of Honor team - 02.03.2011
Try this
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