stock AdminLevelToName(playerid)
{
new admin[128];
switch(playerVariables[playerid][pAdminLevel])
{
case 1:
{
admin = "Junior Administrator";
}
case 2:
{
admin = "Senior Administrator";
}
case 3:
{
admin = "Head Administrator";
}
case 4:
{
admin = "Community Advisor";
}
case 5:
{
admin = "Elite Administrators";
}
case 1337:
{
admin = "Server Co-Owner";
}
case 1338:
{
admin = "Server Owner";
}
}
return admin;
}
format(string, sizeof(string), "%s %s \n "EMBED_WHITE" ..-rp Administrator.", AdminLevelToName(playerid), szPlayerName);
label[playerid] = Create3DTextLabel(string, COLOR_RED, 30.0, 40.0, 50.0, 40.0, 0, 0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
new Text3D:label[MAX_PLAYERS];
pawn Код:
pawn Код:
pawn Код:
|
COMMAND:kick(playerid,params[])
{
if(PlayerInfo[playerid][AdminLevel] >= LEVEL_kick)
{
new player, reason[128];
if(sscanf(params, "rs[128]", player, reason))
{
SendClientMessage(playerid, WHITE,"{FFFF00}Usage: /kick [PlayerID/PartOfName] [Reason]");
return 1;
}
if(PlayerInfo[player][AdminLevel] == MAX_ADMIN_LEVEL)
{
SendClientMessage(playerid, WHITE,"{FF0000}>> You cannot use this command on this admin");
return 1;
}
if(player == playerid)
{
SendClientMessage(playerid, WHITE, "{FF0000}>> You cannot kick yourself");
return 1;
}
if(IsPlayerConnected(player) && player != INVALID_PLAYER_ID && player != playerid && PlayerInfo[player][AdminLevel] != MAX_ADMIN_LEVEL)
{
new string[128];
format(string,sizeof(string),"** %s has been kicked from the server [Reason: %s]",GetName(player),reason);
SendClientMessageToAll(GREY,string);
print(string);
PlayerInfo[player][KickCount]++;
#if PRINT_BYKICK == true
printf("[KICK]: %s has been kicked", GetName(playerid));
#endif
Kick(player);
}
else
{
SendClientMessage(playerid, WHITE, "{FF0000}>> Player is not connected or is yourself or is the highest level admin");
}
}
else
{
SendClientMessage(playerid, WHITE, NO_PERM);
}
return 1;
}
new Text3D:label[MAX_PLAYERS];
stock AdminLevelToName(playerid)
{
new admin[128];
switch(playerInfo[playerid][pAdminLevel])
{
case 1:
{
admin = "Junior Administrator";
}
case 2:
{
admin = "Senior Administrator";
}
case 3:
{
admin = "Head Administrator";
}
case 4:
{
admin = "Community Advisor";
}
case 5:
{
admin = "Elite Administrators";
}
case 1337:
{
admin = "Server Co-Owner";
}
case 1338:
{
admin = "Server Owner";
}
}
return admin;
}
COMMAND:admintag(playerid,params[])
{
format(string, sizeof(string), "%s %s \n "EMBED_WHITE" ..-rp Administrator.", AdminLevelToName(playerid), szPlayerName);
label[playerid] = Create3DTextLabel(string, COLOR_RED, 30.0, 40.0, 50.0, 40.0, 0, 0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
return 1;
}