If player is 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: If player is banned (
/showthread.php?tid=536311)
If player is banned -
HerBan - 08.09.2014
Hi!
I want send a dialog when the player is joined and he is banned.
Код:
CMD:ban(playerid, params[])
{
format( iString, 258, "===============================================\r\n\
Admin: %s\r\n\
Level: %d\r\n\
Player: %s\r\n\
Date: %d/%d/%d at %d:%d\r\n\
Reason: %s\r\n\
===============================================\r\n\r\n\r\n",
PlayerName2( playerid ),
P_DATA[ playerid ][ P_Level ],
PlayerName2( params[ 0 ] ),
D,
M,
Y,
H,
Mi,
params[ 1 ] );
FILE = fopen(SlogBan, io_append);
if (FILE)
{
fwrite(FILE, iString);
fclose(FILE);
}
Код:
Public OnPlayerConnect(playerid)
{
new UID = BUD::GetNameUID( PlayerName2( playerid ) );
if ( UID != BUD::INVALID_UID )
{ new File:FILE;
SetPVarInt( playerid, "BANNED", BUD::GetIntEntry( UID, "Banned" ) );
if ( GetPVarInt( playerid, "BANNED" ) == 1 )
{
FormMessage( playerid, COLOR_WHITE, "Your name is banned from this server! Go away!",0 );
FormMessageForAll( COLOR_WHITE, "[ \"%s\"] with ID [ \"%i\" ] has been kicked from the server! [Reason: Banned Account]",PlayerName2( playerid ), playerid );
SetTimerEx( "KickPlayer", 5000, false, "i", playerid );
ShowDialog(playerid, BD, DIALOG_STYLE_MSGBOX,"You have been kicked!, SlogBan,"Quit",""); // Its bad
}
}
Re: If player is banned -
HerBan - 08.09.2014
Help !