Help with superid command
#1

well it disables nametag but it don't shows labels..

Код:
CMD:superid(playerid,params[])
{
	new string[128],PlayerText3D:Label[MAX_PLAYERS],Float:Pos[4],pName[24];
	if(PInfo[playerid][Level] < 4)
    return SendClientMessage(playerid,STEALTH_BLUE,"You need to be level 4 to use this command.");
    CMDMessageToAdmins(playerid,"SUPERID");
	if(PInfo[playerid][Nametag] == 0 && PInfo[playerid][Superid] == 0)
	{
        PInfo[playerid][Nametag] = 1;
        PInfo[playerid][Superid] = 1;
		for(new i = 0; i < MAX_PLAYERS; i++)
    	ShowPlayerNameTagForPlayer(playerid, i, false);
    	SendClientMessage(playerid,COLOR_LIMEGREEN,"SUPERID ON");
    	for(new i = 0; i < MAX_PLAYERS; i++)
	    {
	        GetPlayerPos(i, Pos[1], Pos[2], Pos[3]);
	        GetPlayerName(i,pName,sizeof pName);
			format(string,sizeof(string),"%s(%i)",pName,i);
			CreatePlayer3DTextLabel(i,string,COLOR_INDIANRED, Pos[0], Pos[1], Pos[2], 200.0, -1, 1);
		}
	}
	else
    {
        PInfo[playerid][Nametag] = 0;
        PInfo[playerid][Superid] = 0;
		for(new i = 0; i < MAX_PLAYERS; i++)
    	ShowPlayerNameTagForPlayer(playerid, i, true);
    	SendClientMessage(playerid,COLOR_INDIANRED,"SUPERID OFF");
    	for(new i = 0; i < MAX_PLAYERS; i++)
		{
			DeletePlayer3DTextLabel(i,PlayerText3D:Label[i]);
		}
	}
	return 1;
}
Reply
#2

bumpy
Reply
#3

Please help,i really want to fix this
Reply
#4

It only disables the name tags for the player, so I guess it should only show the 3d text for the player
Also I think it would be better if you attach these labels instead of placing them at a fixed position
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
    GetPlayerName(i, pName,sizeof pName);
    format(string,sizeof(string),"%s(%i)",pName, i);
    Label[i] = CreatePlayer3DTextLabel(playerid, string, COLOR_INDIANRED, 0.0, 0.0, 0.0, 200.0, i, 1);
}
The variable Label isn't indexed with a playerid parameter, if two people use that at the same time it gets buggy
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)