new Text3D:LevelPlayer;
for(new i=0; i<MAX_PLAYERS; ++i)
{
format(str,sizeof(str),"Level: %d",Player[playerid][pLevel]);
LevelPlayer = Create3DTextLabel(str, COR_BRANCO, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(LevelPlayer,i,0.0, 0.0, 0.7);
SetTimer("update",1000,1);
}
forward update();
public update()
{
new str[256], playerid;
format(str,sizeof(str),"Level: %d",Player[playerid][pLevel]);
Update3DTextLabelText(LevelPlayer, COR_BRANCO,str);
}
for(new i=0; i<MAX_PLAYERS; ++i)
{
format(str,sizeof(str),"Level: %d",Player[playerid][pLevel]);
LevelPlayer = CreatePlayer3DTextLabel(i, str, COR_BRANCO, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(LevelPlayer,i,0.0, 0.0, 0.7);
UpdatePlayer3DTextLabelText(i, LevelPlayer, COR_BRANCO,str);
}
for(new i = 0; i<MAX_PLAYERS; ++i)
{
if(!IsPlayerNPC(i)) {
format(str,sizeof(str),"Level: %d",Player[playerid][pLevel]);
LevelPlayer = Create3DTextLabel(str, COR_BRANCO, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(LevelPlayer,i,0.0, 0.0, 0.7);
SetTimer("update",1000,1);
}
}
new Text3D:LevelPlayer[MAX_PLAYERS];
public OnGameModeInit()
{
SetTimer("UpdateLabel", 20000, true);
return 1;
}
public OnPlayerSpawn(playerid)
{
new str[256];
if(!IsPlayerNPC(playerid)) {
format(str,sizeof(str),"Level: %d", Player[playerid][pLevel]);
LevelPlayer[playerid] = Create3DTextLabel(str, -1, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(LevelPlayer[playerid], playerid ,0.0, 0.0, 0.7);
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
Delete3DTextLabel(LevelPlayer[playerid]);
return 1;
}
stock UpdateLabel() {
new str[256];
for(new i = 0; i < MAX_PLAYERS; ++i) {
if(!IsPlayerNPC(i)) {
format(str,sizeof(str),"Level: %d",Player[i][pLevel]);
Update3DTextLabelText(LevelPlayer[i], COR_BRANCO,str);
}
}
}
PHP код:
|