15.07.2012, 14:43
pawn Код:
CMD:aduty(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first before using that command.");
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not authorized to use this command.");
if(!aDuty[playerid])
{
format(string, sizeof(string), "%s is now on duty as an Administrator. /report for any major problems.", RPN(playerid));
SendClientMessageToAll(COLOR_LIME, string);
aDuty[playerid] = 1;
GetPlayerIp(playerid, PlayerInfo[playerid][pIP], 16);
SetPlayerColor(playerid,COLOR_LIME);
aDutyText[playerid] = CreateDynamic3DTextLabel("Admin Duty", COLOR_LIME, 0, 0, -20, 25, playerid);
Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL,aDutyText[playerid] , E_STREAMER_ATTACH_OFFSET_Z, 0.35);
}
else
{
if(Spec[playerid]) return SendClientMessage(playerid, COLOR_LIGHTRED, "You can not go off admin duty while spectating someone.");
aDuty[playerid] = 0;
format(string, sizeof(string), "%s is now off duty as an Administrator.", RPN(playerid));
SendClientMessageToAll(COLOR_LIME, string);
SetPlayerColor(playerid, COLOR_WHITE);
DestroyDynamic3DTextLabel(aDutyText[playerid]);
}
return 1;
}


