[HELP] Dialog Ban Player - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Dialog Ban Player (
/showthread.php?tid=197845)
[HELP] Dialog Ban Player - Larsey123IsMe - 10.12.2010
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
Re: [HELP] Dialog Ban Player -
Kaylux - 10.12.2010
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);
Re: [HELP] Dialog Ban Player - Larsey123IsMe - 10.12.2010
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