pawn Код:
CMD:kick(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1) {
new targetid, reason;
new VBName[MAX_PLAYER_NAME];
new VBName1[MAX_PLAYER_NAME];
GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
GetPlayerName(targetid, VBName1, MAX_PLAYER_NAME);
if(sscanf(params, "ri", targetid, reason)) return SendClientMessage(playerid, COLOR_PURPLE,"Usage: /kick [playerid] [reason]");
if(targetid == playerid) return SendClientMessage(playerid, COLOR_DRED, "You Can't Kick Yourself!");
if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_DRED, "You Can't Kick Higher Administrators!");
else {
new str[128];
format(str, sizeof(str), "Administrator %s Has Kicked %s Reason: %d!", VBName, VBName1, reason);
SendClientMessageToAll(COLOR_DRED,str);
Kick(targetid);
}
}
else return SendClientMessage(playerid, COLOR_DRED, "You Need To Be A Administrator!");
return 1;
}
CMD:warn(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid) || PlayerInfo[playerid][pVip] >= 3)
{
new reason[32];
new targetid;
if(sscanf(params, "rs[32]", targetid, reason))
return SendClientMessage(playerid, COLOR_PURPLE,"Usage: /warn [playerid] [reason]");
if(targetid == playerid) return SendClientMessage(playerid, COLOR_DRED, "You Can't Warn Yourself!");
new str[128],Name[MAX_PLAYER_NAME],Name1[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
GetPlayerName(targetid, Name1, MAX_PLAYER_NAME);
format(str, sizeof(str), "Administrator %s Has Warned %s Reason: %s!", Name, Name1, reason);
SendClientMessageToAll(COLOR_DRED,str);
Warns[targetid] ++;
}
return true;
}
CMD:setlevel(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 4 || IsPlayerAdmin(playerid)) {
new VBName[MAX_PLAYER_NAME];
new VBName1[MAX_PLAYER_NAME];
new targetid;
GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
GetPlayerName(targetid, VBName1, MAX_PLAYER_NAME);
new
iAdminValue,
iTargetID;
if(sscanf(params, "di", iTargetID, iAdminValue)) {
SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /setlevel [playerid] [level]");
}
else if(IsPlayerConnected(iTargetID)) {
new
szMessage[47 + (MAX_PLAYER_NAME * 2)];
if(iAdminValue < 0 || iAdminValue > 5) return SendClientMessage(playerid, COLOR_PURPLE, "Valid range is 0 - 5.");
PlayerInfo[iTargetID][pAdmin] = iAdminValue;
format(szMessage, sizeof(szMessage), "Administrator %s has promoted %s to a level %d admin.", VBName, VBName1, iAdminValue);
SendStaffMessage(COLOR_PURPLE,szMessage);
format(szMessage, sizeof(szMessage), "You have been promoted to a level %d admin by %s.", iAdminValue, VBName);
SendClientMessage(iTargetID, COLOR_PURPLE, szMessage);
format(szMessage, sizeof(szMessage), "You have promoted %s to a level %d admin.", VBName1,iAdminValue);
SendClientMessage(playerid, COLOR_PURPLE, szMessage);
}
else SendClientMessage(playerid, COLOR_PURPLE, "Invalid player specified.");
}
return 1;
}