15.09.2013, 15:38
pawn Код:
CMD:ban(playerid, params[])
{
new ID, string[128], reason[24];
if(!(PlayerInfo[playerid][pAdmin] >= 3)) return SendClientMessage(playerid, -1, ""COL_RED"[ERROR]"COL_LIGHTBLUE" - You are not high enough to use this command.");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, ""COL_RED"[ERROR]"COL_LIGHTBLUE" - The player you're trying to ban isn't connected to the server.");
if(sscanf(params, "us[24]", ID, reason)) return SendClientMessage(playerid, -1, "[USAGE] - /ban ( ID ) ( Reason )");
format(string, sizeof(string), "** %s(%d) Has been banned by Administrator %s(%d) - Reason: %s",PlayerName(ID), ID, PlayerName(playerid), playerid, reason);
SendClientMessageToAll(COLOR_LIGHTRED, string);
Log("Log/ban.log", string);
PlayerInfo[ID][pBanned] =1;
Kick(ID);
return 1;
}
CMD:kick(playerid, params[])
{
new ID, string[90], reason[24];
if(!(PlayerInfo[playerid][pAdmin] >= 3)) return SendClientMessage(playerid, -1, ""COL_RED"[ERROR]"COL_LIGHTBLUE" - You are not high enough to use this command.");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, ""COL_RED"[ERROR]"COL_LIGHTBLUE" - The player you're trying to kick isn't connected to the server.");
if(sscanf(params, "us[24]", ID, reason)) return SendClientMessage(playerid, -1, "[USAGE] - /kick ( ID ) ( Reason )");
format(string, sizeof(string), "** %s(%d) Has been kicked by Administrator %s(%d) - Reason: %s",PlayerName(ID), ID, PlayerName(playerid), playerid, reason);
SendClientMessageToAll(COLOR_LIGHTRED, string);
Log("Log/kick.log", string);
Kick(playerid);
return 1;
}
PS: I also tried it with Crash Detect plugin and it doesn't give me any debug or and text about it on server.log, and I find it weird, I left scripting 7 months ago and I just came back like 4 days ago, so yeah if you think I'm noob