30.09.2016, 15:26
the code provided by oMa should work as per my analysis you might doing something wrong somewhere just do a debug
like this add some debugging in that code
post what is displaying on server log now.
like this add some debugging in that code
PHP код:
CMD:ban(playerid, params[])
{
if(pInfo[playerid][AL] < 2) return SCM(playerid, red, "[ERROR] No allow!");
{
new PID;
new reason[64];
new str[128];
new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
if(sscanf(params, "us[64]", PID,reason)) return SCM(playerid, red, "[U]: /ban playerid) reason)");
if(!IsPlayerConnected(PID)) return SCM(playerid, -1, "[ERROR]: no player!");
printf("all condition passed");
GetPlayerName(playerid, Adminname, sizeof(Adminname));
GetPlayerName(PID, Playername, sizeof(Playername));
printf("user =%s target=%s",Adminname,Playername);
format(str, sizeof(str), "%s has been banned by Administrator %s Reason: %s", Playername, Adminname, reason);
SCMToAll(-1, str);
printf("message = %s",str);
Ban(PID);
}
printf("out of if");
return 1;
}