SA-MP Forums Archive
Help with superid command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with superid command (/showthread.php?tid=565517)



Help with superid command - Nabster - 28.02.2015

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;
}



Re: Help with superid command - Nabster - 01.03.2015

bumpy


Re: Help with superid command - Nabster - 02.03.2015

Please help,i really want to fix this


AW: Help with superid command - Nero_3D - 02.03.2015

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