Problem with showing name - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with showing name (
/showthread.php?tid=437598)
Problem with showing name -
NathNathii - 16.05.2013
Fixed.
Re: Problem with showing name -
Vince - 16.05.2013
Is this in OnPlayerDisconnect? GetPlayerName and GetPlayerIP don't work well in OnPlayerDisconnect. Otherwise, show how you define the Name variable.
Re: Problem with showing name -
NathNathii - 16.05.2013
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);
Re: Problem with showing name -
Threshold - 16.05.2013
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.
Re: Problem with showing name -
YoYo123 - 16.05.2013
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.
Re: Problem with showing name -
NathNathii - 07.06.2013
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.