29.06.2014, 20:22
My Ban CMD work Fine But
Why Any budy Join Server Server Showed Him Message :
SendClientMessage(id, COLOR_LIGHTGREEN, "You Are Banned From The Server if You Think this Ban is Unfair Make Unban Appeal On Forums ");
Here is My OnPlayerConnect
WHy it making All other Ban Also?
Why Any budy Join Server Server Showed Him Message :
SendClientMessage(id, COLOR_LIGHTGREEN, "You Are Banned From The Server if You Think this Ban is Unfair Make Unban Appeal On Forums ");
PHP код:
CMD:ban(playerid, params[])
{
if(Player[playerid][pAdmin] >= 3)
{
new id,reason[50];
new string[128];
if(sscanf(params, "us[50]", id,reason))return SendClientMessage(playerid, -1, "Usage: /ban [playerid] [Reason]");
if(IsPlayerConnected(id))
{
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_KRED, "Invalid Player");
if(Player[playerid][pAdmin] < Player[id][pAdmin]) return SendClientMessage(playerid, COLOR_KRED," You cant use this on Higher Admin") ;
{
format(string,sizeof(string),"Admin :'%s' has Banned '%s' Reason:%s",GetName(playerid),GetName(id),reason);
SendClientMessageToAll(COLOR_KRED,string);
Player[id][pBan]=1;
new Hour, Minute, Second;
gettime(Hour, Minute, Second);
format(string,sizeof(string),"[%02d:%02d:%02d]%s has banned %s! Reason: %s",Hour,Minute,Second,GetName(playerid),GetName(id),reason);
SendClientMessage(id, COLOR_LIGHTGREEN, "You Are Banned From The Server if You Think this Ban is Unfair Make Unban Appeal On Forums ");
SaveIn("BanLog.txt",string);
SetTimerEx("KickPlayer",1000,false,"d", id);
}
return GameTextForPlayer(id,"~r~you Are Banned By ~r~Admin",3000,1); // Freeze the player
}
else return SendClientMessage(playerid, COLOR_KRED, "Player is not connected!");
}
else return SendPermissionError(playerid);
}
PHP код:
if(fexist(UserPath(playerid)))
{ new string[128];
format(string, sizeof(string)," Welcome Back %s To Server",GetName(playerid));
SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE" {00CED1} Welcome to Server \n {A1C2FF} If its is not your Account Please Logout\n{FFFFFF} Type your password below to login.","Login","Quit");
SetPlayerScore(playerid,Player[playerid][pScore]);
PAccount[playerid]=1;
if(Player[playerid][pBan]==1)
{
SendClientMessage(playerid, COLOR_LIGHTGREEN, "You Are Banned From The Server if You Think this Ban is Unfair Make Unban Appeal On Forums ");
SetTimerEx("KickPlayer",200,false,"d", playerid);
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTGREEN, "Welcome To Server");
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"{00CED1} Welcome to Server \n{FFFFFF} Type your password below to register a new account.","Register","Quit");
PAccount[playerid]=0;
}