PlayerName in text does not work properly
#1

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));

    switch(reason)
    {
        case 0: format(string, sizeof(string), "%s (ID %d) has lost the connection with the server.", PlayerName, playerid);
        case 1: format(string, sizeof(string), "%s (ID %d) has left the server.", PlayerName, playerid);
        case 2: format(string, sizeof(string), "%s (ID %d) has been kicked/banned form this server.", PlayerName, playerid);
    }
    SendClientMessageToAll(GREY, string);
    return 1;
}
I use that code, and it did work for a long time. But now, if someone disconnects, the PlayerName won't be showed. But, i use this same code in OnPlayerConnect, only without the cases, and that DOES work. So, what van be the problem?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)