Admin Chat problem - 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)
+--- Thread: Admin Chat problem (
/showthread.php?tid=581497)
Admin Chat problem -
ea7gign - 13.07.2015
Hello guys,
I have a problem with my script, i have created an admin chat but the message is send to all players,
In OnPlayerText callback
pawn Код:
if(AccInfo[playerid][Admin] >= 1)
{
if(text[0] == '!')
{
new string[128];
GetPlayerName(playerid, string, sizeof(string));
format(string, sizeof(string), "[Admin Chat]: %s: %s", string, text[1]);
SendClientMessage(playerid, red, string);
}
}
else
{
return 0;
}
+ 1 rep for helping
(PS: sorry for my bad english
)
Re: Admin Chat problem -
MBilal - 13.07.2015
PHP код:
if(AccInfo[playerid][Admin] >= 1)
{
if(text[0] == '!')
{
new string[128];
GetPlayerName(playerid, string, sizeof(string));
format(string, sizeof(string), "[Admin Chat]: %s: %s", string, text[1]);
foreach(Player, i) if(AccInfo[i][Admin] >= 1) SendClientMessage(i,red,string);
}
}
else
{
return 0;
}
Re: Admin Chat problem -
ea7gign - 13.07.2015
Thanks that work