13.07.2018, 21:45
Quote:
I know that i need create, but i dont have any clue how to do it simply ;d
|
PHP код:
new tagToggle[MAX_PLAYERS]; //global variable
//code such as a command to turn the nametags on/off
if(tagToggle[playerid] == 1) //off
{
foreach(new i : Player)
{
cNametag[i] = CreateDynamic3DTextLabel("Loading nametag...", 0xFFFFFFFF, 0.0, 0.0, 0.1, NT_DISTANCE, .attachedplayer = i, .testlos = 1);
tagToggle[i] = 0;
}
}
else if(tagToggle[playerid] == 0) //on
{
foreach(new i : Player)
{
Delete3DTextLabel(cNametag[i]);
tagToggle[i] = 1;
}
}
PHP код:
forward UpdateNametag();
public UpdateNametag()
{
foreach(new i : Player)
{
if(tagToggle[i] == 1) return 1;
//rest of the code after that....
}