Ban(playerid);
enum pInfo
{
pAdminLevel,
pCash,
pScore,
pVip,
pBanned,
}
if(PlayerInfo[playerid][pBanned] == 1)return ShowPlayerDialog(playerid,12341,DIALOG_STYLE_MSGBOX,"Banned","You are banned from playing in this server","quit","");
CMD:ban(playerid, params[])
{
new id, reason[28];
if(PlayerInfo[playerid][pAdminLevel] <= 2)return SendClientMessage(playerid,-1,"{FF0000}[ERROR]:{FAF5F5}You are not{FF0000} Administrator {FAF5F5}level 2 to use this command");
else if(sscanf(params, "us", id, reason))SendClientMessage(playerid,-1,"{FF0000}[System Usage]:{FAF5F5}/ban [playerid] [reason]");
else if (id==INVALID_PLAYER_ID)SendClientMessage(playerid,-1,"{FF0000}[ERROR]:{FAF5F5}Player is not connected!");
else {
new Name[MAX_PLAYER_NAME], BanMessage[128];
new Name2[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
GetPlayerName(id, Name2, sizeof(Name2));
format(BanMessage, sizeof(BanMessage),"{FF0000}[Ban]:{FAF5F5}Adminstrator %s banned %s from server | reason: {FF0000}%s",Name,Name2,reason);
SendClientMessageToAll(-1,BanMessage);
PlayerInfo[id][pBanned] = 1;
Kick(id);
}
return 1;
}
// this line goes OnDialogResponse for the login dialog
if(PlayerInfo[playerid][pBanned] == 1)
{
ShowPlayerDialog(playerid,12341,DIALOG_STYLE_MSGBOX,"Banned","You are banned from playing in this server","quit","");
return 1;
}
Put this line at the OnDialogResponse for dialog login, once he logs in, he will be kicked, because the actual PlayerInfo[playerid][variable] files load once he's logged in.
pawn Код:
|
First thank you for reply , i already try to add it in dialog of login but when i join server it show me only the login dialog not this while i am on User's.ini
Banned =1 ![]() |
once he logs in, he will be kicked because the actual PlayerInfo[playerid][variable] files load once he's logged in.
CMD:ac(playerid, params[])
{
if(PlayerInfo[playerid][pAdminLevel] == 0)return SendClientMessage(playerid,-1,"{FF0000}[ERROR]:{FAF5F5}You are not{FF0000} Administrator {FAF5F5}to use admin chat");
new name[MAX_PALYER_NAME]/*why was this over 1k? a name isn't over 1k characters*/,i , text[126], string[200];
if(sscanf(params, "s[126]", text))return SendClientMessage(playerid,-1,"{FF0000}[System Usage]:{FAF5F5}/ac [text]");
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "{FFD700}[%s] %s: %s", GetPlayerAdminRank(i),name ,text);
SendMessageToAdmins(string);
return 1;
}