07.06.2011, 03:24
any idea for how can i make 3d txt label for all the players ( "Zombie" for the zombie team and "Human" for the human team)
if (TeamZombie[playerid] == 1)
{
Create3DTextLabel(...)
} else if (TeamHuman[playerid] == 2) {
Create3dTextLabel(..)
}
|
You can do a loop, or excepctions :B
example pawn Код:
|
for (new i = 0; i < MAX_PLAYERS; i++)
|
ooo caus i was thinking that i must use something like that
Код:
for (new i = 0; i < MAX_PLAYERS; i++) |
new Text3D:label[MAX_PLAYERS];
public OnPlayerDisconnect(playerid, reason)
{
Delete3DTextLabel(label[playerid]);
return 1;
}
public OnPlayerSpawn(playerid)
{
Delete3DTextLabel(label[playerid]);
if(team[playerid] == 1)
{
label[playerid] = Create3DTextLabel("Human",0xAA3333AA, 0, 0, 0, 40, 0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
return 1;
}
if(team[playerid] == 2)
{
label[playerid] = Create3DTextLabel("Zombie",0xAA3333AA, 0, 0, 0, 40, 0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
return 1;
}
if(team[playerid] == 3)
{
label[playerid] = Create3DTextLabel("Zombie",0xAA3333AA, 0, 0, 0, 40, 0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
return 1;
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
Delete3DTextLabel(label[playerid]);
}