[HELP] Problem with label for Admin.
#1

im update stremaer, and change code to CreateDynamic3DTextLabel,when use cmd for admin duty, label "Administrator on duty" not showing for my friends.




Code:
 aDutyl[playerid] = CreateDynamic3DTextLabel("ADMINISTRATOR NA DUZNOSTI", COLOR_ORANGE, x, y, z, 30, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
where is problem?
Reply
#2

Attach3DTextLabelToPlayer(aDutyl[playerid], playerid, 0.0, 0.0, 0.0);
Reply
#3

Quote:
Originally Posted by GGRoleplay
View Post
Attach3DTextLabelToPlayer(aDutyl[playerid], playerid, 0.0, 0.0, 0.0);
i have this
Reply
#4

Why use INVALID_PLAYER_ID at the "attachedplayer" parameter if you can already define the administrator to attach it to right there? Otherwise the code seems fine to me. Just do what the previous poster said and if you already are, then I think the issue is somewhere else?
Reply
#5

Do you wanna attach it to somebody or just put it somewhere, You don't use "Attach3DTextLabelToPlayer", You'll have to change "INVALID_PLAYER_ID" to an id;

pawn Code:
CreateDynamic3DTextLabel("ADMINISTRATOR NA DUZNOSTI", COLOR_ORANGE, x, y, z, 30, /*adminid/playerid that you want it attached to*/,  INVALID_VEHICLE_ID, 1);
Reply
#6

Quote:
Originally Posted by xVIP3Rx
View Post
Do you wanna attach it to somebody or just put it somewhere, You don't use "Attach3DTextLabelToPlayer", You'll have to change "INVALID_PLAYER_ID" to an id;

pawn Code:
CreateDynamic3DTextLabel("ADMINISTRATOR NA DUZNOSTI", COLOR_ORANGE, x, y, z, 30, /*adminid/playerid that you want it attached to*/,  INVALID_VEHICLE_ID, 1);
this is command for all admins. i want make for all admins, not for special playerid.


cmd is:
Code:
CMD:aon(playerid)
{
    if(IsLogged[playerid] == false) return SendClientMessage(playerid, COLOR_RED, ""COL_ORANGE"HF-Protect | "COL_WHITE"Moras biti ulogiran kako bi mogao koristiti "COL_CYAN"komande"COL_RED"!");
	if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "[GRESKA]: "COL_WHITE"Nemas prava za koristenje ove komande.");
	else
    {
        if (gaDuty[playerid] == false)
        {
            new string[128];
            new Float:health, Float:armour;
            new pName[MAX_PLAYER_NAME];
            new Float:x,Float:y,Float:z;
            aDutyl[playerid] = CreateDynamic3DTextLabel("ADMINISTRATOR NA DUZNOSTI", COLOR_ORANGE, x, y, z, 30, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 30.0);
            //aDutyl[playerid] = CreateDynamic3DTextLabel("ADMINISTRATOR NA DUZNOSTI", COLOR_ORANGE, x, y, z, NAME_DRAWDISTANCE, 0, 1 );

            GetPlayerPos(playerid,x,y,z);

            GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
            format(string,sizeof(string), "[SERVER]: "COL_WHITE"Administrator %s je sada na Admin duznosti.",pName);
            SendClientMessageToAll(COLOR_ORANGE,string);
            SendClientMessage(playerid,COLOR_RED,"[SERVER]: "COL_WHITE"Sada si na Admin duznosti.");
	        GetPlayerHealth(playerid, health);
	        GetPlayerArmour(playerid, armour);
            PlayerInfo[playerid][pHealth] = health;
            PlayerInfo[playerid][pArmour] = armour;
            gaDuty[playerid] = true;
           	SetPlayerHealth(playerid, 999999);
	        SetPlayerArmour(playerid, 999999);
	        SetPlayerColor(playerid, COLOR_ORANGE);
            Attach3DTextLabelToPlayer(aDutyl[playerid],playerid,0.0, 0.0, 0.5);
        }
        else if (gaDuty[playerid] == true)
        {
            new string[128];
            new pName[MAX_PLAYER_NAME];


            GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
            format(string,sizeof(string),"[SERVER]: "COL_WHITE"Administrator %s nije vise na duznosti.",pName);
            SendClientMessageToAll(COLOR_ORANGE,string);
            SendClientMessage(playerid, COLOR_RED,"[SERVER]: "COL_WHITE"Vise nisi na Admin duznosti.");
            gaDuty[playerid] = false;
           	SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
	        SetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);
	        SetPlayerColor(playerid, COLOR_WHITE);
	        DestroyDynamic3DTextLabel(aDutyl[playerid]);

        }
    }
    return 1;
}
Reply
#7

pawn Code:
CMD:aon(playerid)
{
    if(!IsLogged[playerid]) return SendClientMessage(playerid, COLOR_RED, ""COL_ORANGE"HF-Protect | "COL_WHITE"Moras biti ulogiran kako bi mogao koristiti "COL_CYAN"komande"COL_RED"!");
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "[GRESKA]: "COL_WHITE"Nemas prava za koristenje ove komande.");

    new string[128];
    new pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    if (gaDuty[playerid] == false)
    {
        aDutyl[playerid] = CreateDynamic3DTextLabelEx("ADMINISTRATOR NA DUZNOSTI", COLOR_ORANGE, 0.0, 0.0, 0.0, 30, playerid, .testlos = 1);

        format(string,sizeof(string), "[SERVER]: "COL_WHITE"Administrator %s je sada na Admin duznosti.", pName);
        SendClientMessageToAll(COLOR_ORANGE,string);
        SendClientMessage(playerid,COLOR_RED,"[SERVER]: "COL_WHITE"Sada si na Admin duznosti.");
       
        GetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
        GetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);
        SetPlayerHealth(playerid, 999999);
        SetPlayerArmour(playerid, 999999);
        SetPlayerColor(playerid, COLOR_ORANGE);
       
        gaDuty[playerid] = true;
    }
    else if (gaDuty[playerid] == true)
    {
        format(string,sizeof(string),"[SERVER]: "COL_WHITE"Administrator %s nije vise na duznosti.",pName);
        SendClientMessageToAll(COLOR_ORANGE,string);
        SendClientMessage(playerid, COLOR_RED,"[SERVER]: "COL_WHITE"Vise nisi na Admin duznosti.");
       
        SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
        SetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);
        SetPlayerColor(playerid, COLOR_WHITE);
       
        DestroyDynamic3DTextLabel(aDutyl[playerid]);
        gaDuty[playerid] = false;
    }
    return 1;
}
//Optimized it a bit.
Look, basically when an admin type /aon, it creates a textdraw above him saying "ADMINISTRATOR NA DUZNOSTI" and showing for everybody, isn't that what you want ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)