Problem with showing name
#1

Fixed.
Reply
#2

Is this in OnPlayerDisconnect? GetPlayerName and GetPlayerIP don't work well in OnPlayerDisconnect. Otherwise, show how you define the Name variable.
Reply
#3

No it is in OnPlayerText.

This is the only thing I got that has "name"

pawn Код:
new Name[30], Msg[128];
                APlayerData[playerid][BanTime] = 2147483640;
                SendClientMessage(playerid, 0x808080FF, "You have been banned! - Reason: Attempted to advertise!");
                Kick(playerid);
                GetPlayerName(playerid, Name, sizeof(Name));
                format(Msg, 128, "{FF0000}%s {FF0000}has been banned from the server - Reason: Attempted to advertise", Name);
                SendClientMessageToAll(0xFF0000FF, Msg);
Reply
#4

You are kicking the player before the server can store his name...
pawn Код:
new Name[30], Msg[128];
                APlayerData[playerid][BanTime] = 2147483640;
                SendClientMessage(playerid, 0x808080FF, "You have been banned! - Reason: Attempted to advertise!");
                GetPlayerName(playerid, Name, sizeof(Name));
                format(Msg, 128, "{FF0000}%s {FF0000}has been banned from the server - Reason: Attempted to advertise", Name);
                SendClientMessageToAll(0xFF0000FF, Msg);
                Kick(playerid);
Alternatively, I think you should set the Kick(playerid) to a 500ms timer, just to make sure that he receives the "You have been banned" message.
Reply
#5

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
Alternatively, I think you should set the Kick(playerid) to a 500ms timer, just to make sure that he receives the "You have been banned" message.
Yup, in 0.3x the kick packet seems to be sent faster than the message one.
Reply
#6

Sorry for bumping.

I only want the banned player's name to show up when he says a IP.
I don't care about to give him that message that he has been banned.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)