12.06.2013, 09:35
use it like this :-
pawn Код:
CMD:aduty(playerid, params[])
{
new label;
label= CreateDynamic3DTextLabel("Admin On Duty!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
if(IsPlayerConnected(playerid))
{
new string[120];
if(PlayerInfo[playerid][pAdmin] > 1 && PlayerInfo[playerid][pAdminDuty] == 0)
{
SendClientMessage(playerid, COLOR_GREEN, " You are now on admin duty.");
//SetPlayerName(playerid, PlayerInfo[playerid][pAdminName]);
format(string, sizeof(string), "** Administrator %s is now on admin duty. (/report for assistance) **", GetPlayerNameEx(playerid));
SendClientMessageToAllEx(COLOR_YELLOW, string);
PlayerInfo[playerid][pAdminDuty] = 1;
SetPlayerHealth(playerid, 9999);
SetPlayerArmour(playerid, 9999);
Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
}
else if(PlayerInfo[playerid][pAdmin] > 1 && PlayerInfo[playerid][pAdminDuty] != 0)
{
SendClientMessageEx(playerid, COLOR_GREEN, " You are now off admin duty.");
format(string, sizeof(string), "** Administrator %s is now off admin duty. **", GetPlayerNameEx(playerid));
SendClientMessageToAllEx(COLOR_YELLOW, string);
//SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
PlayerInfo[playerid][pAdminDuty] = 0;
Delete3DTextLabel(Text3D:label)
}
}
return 1;
}