if(text[0] == '@' && pInfo[playerid][Admin] < 1) { foreach(new i : Player) { new str[128]; format(str, sizeof(str), "{F781F3}(ADMIN CHAT) %s(%d): %s", PlayerName[playerid],playerid, str); SendMessageToAdmins(str); if(pInfo[playerid][Admin] > 0) { SendClientMessage(i, 0x66CC66FF, str); } } } return 0; }
stock SendMessageToAdmins(color, const msg[])
{
for (new i=0; i<MAX_PLAYERS; i++)
{
if (pInfo[i][Admin] >= 1)
{
SendClientMessage(i, color, msg);
}
}
}
public OnPlayerText(playerid, text[])
{
if(text[0] == '@' && pInfo[i][Admin] >= 1)
{
new string[128];
format(pname, sizeof(string), "{47476B}(ADMIN CHAT) {FFFFFF}%s: %s", PlayerName[playerid], text[1]);
SendMessageToAdmins(-1, string);
return 0;
}
return 0;
}
stock SendMessageToAdmins(color, const msg[])
{
for (new i=0; i<MAX_PLAYERS; i++)
{
if (pInfo[i][Admin] >= 1)
{
SendClientMessage(i, color, msg);
}
}
}
public OnPlayerText(playerid, text[])
{
if(text[0] == '@' && pInfo[i][Admin] >= 1)
{
new pname[128], string[120];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "{47476B}(ADMIN CHAT) {FFFFFF}%s: %s", pname, text[1]);
SendMessageToAdmins(-1, string);
return 0;
}
return 0;
}
if(text[0] == '@' && pInfo[playerid][Admin] < 1)
{
new str[128];
format(str, sizeof(str), "{F781F3}(ADMIN CHAT) %s(%d): %s", PlayerName[playerid],playerid, text);
foreach(new i : Player)
{
if(pInfo[playerid][Admin] > 0)
{
SendClientMessage(i, -1, str);
}
}
return 1;
}
PHP код:
|
Now he can't send messages normally at all. so use return 1 at the end of callback.
|
public OnPlayerText(playerid, text[])
{
new pText[144];
format(pText, sizeof (pText), "(%d) %s", playerid, text);
SendPlayerMessageToAll(playerid, pText);
return 0; // ignore the default text and send the custom one
}
PHP код:
|
SendMessageToAdmins(color, const msg[]) foreach(new i : Player) if(pInfo[i][Admin] >= 1) SendClientMessage(i, color, msg);
public OnPlayerText(playerid, text[])
{
if(text[0] == '@' && pInfo[i][Admin] >= 1)
{
string[124];
GetPlayerName(string, string, MAX_PLAYER_NAME);
format(string, sizeof(string), "(ADMIN CHAT) {FFFFFF}%s: %s", string, text[1]);
SendMessageToAdmins(0x47476BFF, string);
return 0;
}
return 1;
}