15.10.2017, 15:23
I Created a cmd, for admins who remain on-duty, to force them off-duty, But it coming up with this error!
Need help, +rep for help!
Код:
COMMAND:forceaod(playerid, params[])
{
if(playerData[playerid][playerLoggedIn])
{
if(playerData[playerid][playerLevel] >= 4)
{
new otherID, reason[300];
if(sscanf(params, "us[300]", otherID, reason))
{
SendClientMessage(playerid, COLOR_ORANGE, "Usage: \"forceaod <playername/id> <reason>\"");
}
{
// Admin is already on duty, so we'll now put them off duty
SendClientMessage(otherID, COLOR_WHITE, "{FE9A2E}[ADMIN] {FFFFFF}You Have Been Forced Off-Duty by %s! Reason:- %s", playerData[playerid][tempAdminName], reason);
new admnotification[128];
format(admnotification, sizeof(admnotification), "[SERVER] Administrator %s(%i) is now Off-Duty!", playerData[playerid][tempAdminName], playerid);
SendClientMessageToAll(COLOR_LIGHTBLUE, admnotification);
playerData[otherID][playerAdminDuty] = false;
Delete3DTextLabel(playerData[otherID][playerAdminLabel]);
// Give them default health
SetPlayerHealth(otherID, 100);
SetPlayerArmour(otherID, 0);
newPlayerColour(otherID);
TextDrawHideForPlayer(otherID, Text:AdminDuty);
}
}
else
{
return 0;
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}You must be logged in to use commands.");
}
return 1;
}


