Help with the command /aod
#1

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

Код:
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;
}
please help me
Reply
#2

anyone?
Reply
#3

Don't bump your topics in under 24 hours.
Reply
#4

Quote:
Originally Posted by zT KiNgKoNg
Посмотреть сообщение
Don't bump your topics in under 24 hours.
then how about I get some help? don't be a post whore worried about posting 'Don't bump your topics in under 24 hours.'.
Reply
#5

:/ anyone? I really need help
Reply
#6

This should work.

PHP код:
for(new 0MAX_PLAYERSi++) { ShowPlayerNameTagForPlayer(iplayeridtrue); } 
Reply
#7

Quote:
Originally Posted by zT KiNgKoNg
Посмотреть сообщение
Don't bump your topics in under 24 hours.
Quote:
Originally Posted by ikbenremco
Посмотреть сообщение
This should work.

PHP код:
for(new 0MAX_PLAYERSi++) { ShowPlayerNameTagForPlayer(iplayeridtrue); } 
would I put that for were both of mine are currently?
Reply
#8

Код:
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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)