08.04.2018, 03:50
Quote:
thanks but .. players can use admin chat and vip chat . the only problem is the main chat is not working, maybe i return 0; at the wrong bracket or what?
|
by the way, you can prevent player with this code if(Account[playerid][Admin] < 1) return SendClientMessage(playerid,-1,"You aren't an admin.");
PHP код:
if(strcmp(text[0],"@",false,1) == 0)
{
if(Account[playerid][Admin] < 1) return SendClientMessage(playerid,-1,"You aren't an admin");// prevent normal player from typing in admin chat.
text[0] = 25; //removes '@' from text. (replaces with space)
format(text,256, "** |Admin Chat| %s:%s **", IsPlayerName(playerid),text);
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
{
if(Account[i][Admin] >= 1 && IsPlayerConnected(i))
{
SendClientMessage(i, 0x0AFFC9FF, text);
}
}
format(text,256,""); // clears formatting of 'text' (it's importat for later callback, otherwise players texts will be messed-up)
return 0; // to prevent default text from sending.
}