SA-MP Forums Archive
Banned? - 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: Banned? (/showthread.php?tid=416833)



Banned? - bebothekillar - 18.02.2013

Hello, i wanna to know how can i make a dialog box when player get banned the box show say

You has been banned from this server....
Reason
Admin
Ban data
Please go www.............. and make an request

my script like this

Quote:

dcmd_ban(playerid,params[]) {
if(IsPlayerCommandLevel(playerid,"ban")) {
if(!strlen(params)) return SendClientMessage(playerid,red,"Syntax Error: \"/ban ( Name or Id ) ( Reason )\".");
new tmp[256],Index; tmp = strtok(params,Index);
new id; if(!IsNumeric(tmp)) id = ReturnPlayerID(tmp); else id = strval(tmp);
if(IsPlayerConnected(id) && id != INVALID_PLAYER_ID && id != playerid) {
SendCommandMessageToAdmins(playerid,"BAN");
new string[256],name[24],ActionName[24]; GetPlayerName(playerid,name,24); GetPlayerName(id,ActionName,24);
if(!strlen(params[strlen(tmp)+1])) format(string,256,"\"%s\" has been Banned by Administrator \"%s\".",ActionName,name);
else format(string,256,"\"%s\" has been Banned by Administrator \"%s\". (Reason: %s)",ActionName,name,params[strlen(tmp)+1]);
SendClientMessageToAll(yellow,string); return Ban(id);
} else return SendClientMessage(playerid,red,"ERROR: You can not ban yourself or a disconnected player.");
} else return SendLevelErrorMessage(playerid,"ban");
}




Re: Banned? - Alternative112 - 18.02.2013

Instead of this:

Код:
SendClientMessageToAll(yellow,string);
Use this:

Код:
ShowPlayerDialog(playerid, 20000, DIALOG_STYLE_MSGBOX, "{FFF8DC}BANNED!", string, "BYE!", "");
the dialog ID can be anything, I just made it really high to make it more likely that it won't conflict with other dialog responses.