[HELP] Dialog Ban Player
#1

I want to log the ban to here: scriptfiles/Lbans/PLAYERNAME.LBAN

and.. after i banned the player, and he try to reconnect i want it to say
You are banned from this server
Reason: REASON

Like it is now it just say: You are banned from this server.

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
    {
    switch(dialogid)
        {
        case 1:
            {
            switch(listitem)
                {
                    case 0: ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Text for Ban", "Enter the reason to ban", "Submit", "Cancel");
                }
            }
            case 2:
            {
                if(strlen(inputtext) > 50)
                    return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: Your message was too long. Max: 50 characters");

                new string[128], pName[MAX_PLAYER_NAME];
                GetPlayerName(aPlayer[playerid], pName, sizeof(pName));
                SendClientMessage(aPlayer[playerid], 0x776655,"You have been banned from this server");
                SendClientMessage(aPlayer[playerid], 0x776655,inputtext);
                BanEx(aPlayer[playerid],inputtext);
                format(string,128,"**(ADMIN BAN)** %s(%d) %s", pName, playerid, inputtext);
                SendClientMessageToAll(0x556677,string);
                aPlayer[playerid] = 0;
            }
       }
   }
return 1;
}
Like it is now:
1. Click at plyer you want to ban
2. Type message (reason to ban)
3. Player get banned and this text show for him: You have been banned from this server
-------------------------------------------------THE REASON I TYPED COMES HERE
4. This text shows for evryone: **(ADMIN BAN)** PLAYERNAME(ID) REASON FOR WHY HE GOT BANNED
Reply
#2

You're having trouble showing the reason?
You have to do it like this:

pawn Код:
format(string, 125, "Reason: %s",  inputtext);
SendClientMessage(aPlayer[playerid], 0x776655,string);
Reply
#3

Quote:
Originally Posted by Kaylux
Посмотреть сообщение
You're having trouble showing the reason?
You have to do it like this:

pawn Код:
format(string, 125, "Reason: %s",  inputtext);
SendClientMessage(aPlayer[playerid], 0x776655,string);
The srason show When he get banned, but it wont show when he try to reconnect after he got banned
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)