05.11.2013, 01:35
so i have this command /aod, it means admin on duty... anyways I want it to take the players name away with the health/armor, example when it says Michael_Wharton above the players name. Now I kinda have it working but I think I am missing something. Now when someones does /aod I can see the 3dtag I have created but it bugs sometimes and you will be able to see the players name, or everyones name will disappear above thier name, when I only want the person using the /aod command's name to go away. Sorry if I did not explain this very well...
my code
please help me
my code
Код:
CMD:aod(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(!aDuty[playerid])
{
format(string, sizeof(string), "AdmWarn: %s has went on admin duty.", RPN(playerid));
SendAdminMessage(COLOR_DARKRED, 1, string);
aDuty[playerid] = 1;
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, false);
format(string, sizeof(string), "{FF6347}ARP Administartor\n{FFFFFF}%s\n{2641FE}%s", RPN(playerid), RPALN(playerid));
if(IsValidDynamic3DTextLabel(aDutyText[playerid])) DestroyDynamic3DTextLabel(aDutyText[playerid]);
if(PlayerInfo[playerid][pAdmin] == 1) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_LIGHTGREEN, 0, 0, -20, 25, playerid);
if(PlayerInfo[playerid][pAdmin] == 2) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_LIME, 0, 0, -20, 25, playerid);
if(PlayerInfo[playerid][pAdmin] == 3) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_YELLOW, 0, 0, -20, 25, playerid);
if(PlayerInfo[playerid][pAdmin] == 4) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_ORANGE, 0, 0, -20, 25, playerid);
if(PlayerInfo[playerid][pAdmin] == 1337) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_RED, 0, 0, -20, 25, playerid);
if(PlayerInfo[playerid][pAdmin] == 1338) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_DARKRED, 0, 0, -20, 25, playerid);
Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL, aDutyText[playerid] , E_STREAMER_ATTACH_OFFSET_Z, 0.25);
PlayerInfo[playerid][pModel] = GetPlayerSkin(playerid);
GiveDodWeapon(playerid, 38, 11999);
SetPlayerArmour(playerid, 1000000000.0);
SetPlayerHealth(playerid, 1000000000.0);
//SetPlayerSkin(playerid, 294);
}
else
{
if(Spec[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You can't go off admin duty while spectating someone.");
aDuty[playerid] = 0;
for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, true);
format(string, sizeof(string), "AdmWarn: %s has went off admin duty.", RPN(playerid));
SendAdminMessage(COLOR_DARKRED, 1, string);
DestroyDynamic3DTextLabel(aDutyText[playerid]);
//new oldskinsss;
//oldskinsss = PlayerInfo[playerid][pModel];
//SetPlayerSkin(playerid, oldskinsss);
SetPlayerArmour(playerid, 100.0);
SetPlayerHealth(playerid, 100.0);
ResetPlayerWeapons(playerid);
ResetDodWeapons(playerid);
}
return 1;
}


