Message to kicked player
#1

So, my GM automatcly kick a player when he doesn't have a name like 1stName_LastName.
When some join the server with a nickname like "Shellegg" ht only see:

"Server closed the information."

How to send them a message telling them that they need a name with the format descripted above.

This is my actually "script"

pawn Код:
if(RPName(PlayerName(playerid),first,last))
    {
      .........
      .........
      .........
    }
    else
    {
      KickPlayer(playerid,"«Manalgas»","Invбlid Name, Correct form: Name_Surname.");
    }
    return 1;
Reply
#2

Search the wiki for SendClientMessage and add the message before the Kickplayer line.
Reply
#3

SendClientMessage(...);
Kick(...);

SendClientMessage must go before kick.
Reply
#4

Thank you, tahat is what i need
Reply
#5

At your service
Reply
#6

pawn Код:
else
    {
      SendClientMessage(playerid, COLOR_ADMINCMD, "You have been kicked by «Manalgas» reason: you name must be Name_Surname");
      KickPlayer(playerid,"«Manalgas»","Invбlid Name");
    }
    return 1;
Still not working..
Reply
#7

Use Kick(playerid);
Reply
#8

Or just let us see the function, and maybe we can fix it
Reply
#9

Hes using my script, just replace the old functions with these.

pawn Код:
public KickPlayer(playerid,kickedby[MAX_PLAYER_NAME],reason[])
{
    new string[128];
    format(string,sizeof(string),"%s has been kicked by %s, Reason: %s ",GetPlayerNameEx(playerid),kickedby,reason);
    SendClientMessageToAllEx(COLOR_ADMINCMD,string);
    KickLog(string);
    format(string,sizeof(string),"You have been kicked from the server, Reason: %s",reason);
    SendClientMessage(playerid,COLOR_ADMINCMD,string);
    return Kick(playerid);
}
public BanPlayerAccount(playerid,bannedby[MAX_PLAYER_NAME],reason[])
{
    new string[128];
    format(string,sizeof(string),"%s has been Account-Banned by %s, Reason: %s ",GetPlayerNameEx(playerid),bannedby,reason);
    SendClientMessageToAllEx(COLOR_ADMINCMD,string);
    AccountBanLog(string);
    PlayerInfo[playerid][pBanned] = 1;
    OnPlayerDataSave(playerid);
    format(string,sizeof(string),"You have been account banned, Reason: %s",reason);
    SendClientMessage(playerid,COLOR_ADMINCMD,string);
    return Kick(playerid);
}
public BanPlayer(playerid,bannedby[MAX_PLAYER_NAME],reason[])
{
    new string[128];
    format(string,sizeof(string),"%s has been banned by %s, Reason: %s ",GetPlayerNameEx(playerid),bannedby,reason);
    SendClientMessageToAllEx(COLOR_ADMINCMD,string);
    BanLog(string);
    format(string,sizeof(string),"You have been banned from the server, Reason: %s",reason);
    SendClientMessage(playerid,COLOR_ADMINCMD,string);
    return Ban(playerid);
}
I forgot to make it send them messages.
Reply
#10

how to define
pawn Код:
undefined symbol "SendClientMessageToAllEx"
xD
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)