07.04.2018, 18:56
I cant see my chat and others chat in my server, other player experienced the same situation aswell, I think the problem is from OnPlayerText, but I dont have any clue what is the error
Help please
PHP код:
public OnPlayerText(playerid, text[])
{
new string[MAX_PLAYERS], var = GetPlayerVirtualWorld(playerid);
//
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;
}
}
}
if(text[0] == '!' && Account[playerid][Vip] >= 1)
{
format(string, sizeof(string), "~> |Vip Chat| %s: %s <~", IsPlayerName(playerid), text[1]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && Account[i][Vip] >= 1)
{
SendClientMessage(i, 0xFF0099AA, string);
return 0;
}
}
}
else
{
format(string, sizeof(string), "%s (%d): {FFFFFF}%s", IsPlayerName(playerid), playerid, text);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerVirtualWorld(i) == var)
{
SendClientMessage(i, GetPlayerColor(playerid), string);
return 0;
}
}
}
}
return 1;
}