06.09.2015, 19:38
you add } else { for SSCANF not admin permission also if you wanna add it, its should be } else return your message ....
try:
dude you kiding xD?
it will not let any admin that higher than or level 1 to use the command instead of it you can use:
try:
PHP код:
CMD:kick(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
new target,reason[64],str[128],logstring[200],month,day,year;
new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
GetPlayerName(playerid, Adminname, sizeof(Adminname));
GetPlayerName(target, Playername, sizeof(Playername));
getdate(year, month, day);
if(sscanf(params, "us[64]", target,reason)) return SCM(playerid, bojaz, "[INFO]: /kick [playerid] [reason]");
if(!IsPlayerConnected(target))
return SCM(playerid, bojaz, "Player is not connected!");
format(str, sizeof(str), "[Adm] %s has been kicked by '%s'. Reason: %s (%d-%d-%d) ", Playername, Adminname, reason,year,month,day);
printf(str);
format(logstring, sizeof(logstring), "Info: %s was kicked by %s, reason: %s (%d-%d-%d).",sendername(target),sendername(playerid),reason,year,month,day);
KickLog(logstring);
SetTimerEx("kicktimer", 1000, false, "d", target);
} else return SCM(playerid,bojaz,"You re not admin");
return 1;
}
CMD:ban(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
new target;
new reason[64];
new str[128];
new day,month,year;
getdate(year, month, day);
new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
GetPlayerName(playerid, Adminname, sizeof(Adminname));
GetPlayerName(target, Playername, sizeof(Playername));
if(sscanf(params, "us[64]", target,reason)) return SCM(playerid, -1,"[INFO]: /ban [playerid] [reason]");
if(!IsPlayerConnected(target)) return SCM(playerid,bojaz, "** Player not found.");
format(str, sizeof(str), "[Adm] %s has been banned by %s. Reason: %s (%d-%d-%d) ", Playername, Adminname, reason,year,month,day);
SendClientMessageToAll(bojaz, str);
printf(str);
BanLog(str);
PlayerInfo[target][pBanned] = 1;
SetTimerEx("bantimer", 1000, false, "d", target);
} else return SCM(playerid,bojaz,"Your not admin");
return 1;
}
PHP код:
if (PlayerInfo[playerid][pAdmin] >= 1) return SCM(playerid,bojaz,"Your not admin");
PHP код:
if (PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid,bojaz,"Your not admin");