07.04.2018, 20:03
new string[MAX_PLAYERS], - would likely be too big to send.
change to
new string[ 144 ], - this is the largest string you can send with SendClientMessage.
ForCop already changed that in his code but he also removed the functionality to send the message within your virtual world and left another mistake.
You return 0 every loop iteration within vip, admin and normal chats. Move the return 0; outside of the loops like this. When you return 0; it stops everything so you only want to return after you send the correct messages to everyone you need.
change to
new string[ 144 ], - this is the largest string you can send with SendClientMessage.
ForCop already changed that in his code but he also removed the functionality to send the message within your virtual world and left another mistake.
You return 0 every loop iteration within vip, admin and normal chats. Move the return 0; outside of the loops like this. When you return 0; it stops everything so you only want to return after you send the correct messages to everyone you need.
PHP код:
if(text[0] == '@' && Account[playerid][Admin] >= 1)
{
format(string, sizeof(string), "** |Admin Chat| %s: %s **", IsPlayerName(playerid), text[1]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && Account[i][Admin] >= 1)
{
SendClientMessage(i, 0x0AFFC9FF, string);
}
}
return 0;
}