[Ajuda] Level pegando no NPC.
#1

Bom esse pequeno sistema ele nгo esta pegando acima do nick dos jogadores, apenas nos NPC, jб tentei de algumas formas resolver este problemas mas nгo conseguir por acima do nick dos jogadores!

Inicio
PHP код:
new Text3D:LevelPlayer
OnPlayerSpawn
PHP код:
for(new i=0i<MAX_PLAYERS; ++i)
{
format(str,sizeof(str),"Level: %d",Player[playerid][pLevel]);
LevelPlayer Create3DTextLabel(strCOR_BRANCO30.040.050.040.00);
Attach3DTextLabelToPlayer(LevelPlayer,i,0.00.00.7);
SetTimer("update",1000,1);

Final
PHP код:
forward update();
public 
update()
{
new 
str[256], playerid;
format(str,sizeof(str),"Level: %d",Player[playerid][pLevel]);
Update3DTextLabelText(LevelPlayerCOR_BRANCO,str);

Reply
#2

PHP код:
for(new i=0i<MAX_PLAYERS; ++i)
{
format(str,sizeof(str),"Level: %d",Player[playerid][pLevel]);
LevelPlayer CreatePlayer3DTextLabel(istrCOR_BRANCO30.040.050.040.00);
Attach3DTextLabelToPlayer(LevelPlayer,i,0.00.00.7);
UpdatePlayer3DTextLabelText(iLevelPlayerCOR_BRANCO,str);

Reply
#3

PHP код:
for(new 0i<MAX_PLAYERS; ++i)
{
    if(!
IsPlayerNPC(i)) {
        
format(str,sizeof(str),"Level: %d",Player[playerid][pLevel]);
        
LevelPlayer Create3DTextLabel(strCOR_BRANCO30.040.050.040.00);
        
Attach3DTextLabelToPlayer(LevelPlayer,i,0.00.00.7);
        
SetTimer("update",1000,1);
    }

Reply
#4

PHP код:


new Text3D:LevelPlayer[MAX_PLAYERS];


public 
OnGameModeInit()
{
    
SetTimer("UpdateLabel"20000true);
    return 
1;
}

public 
OnPlayerSpawn(playerid)
{
    new 
str[256];
    if(!
IsPlayerNPC(playerid)) {
        
format(str,sizeof(str),"Level: %d"Player[playerid][pLevel]);
        
LevelPlayer[playerid] = Create3DTextLabel(str, -130.040.050.040.00);
        
Attach3DTextLabelToPlayer(LevelPlayer[playerid], playerid ,0.00.00.7);
    }
    return 
1;
}

public 
OnPlayerDisconnect(playeridreason)
{
    
Delete3DTextLabel(LevelPlayer[playerid]);
    return 
1;
}

stock UpdateLabel() {
    new 
str[256];
    for(new 
0MAX_PLAYERS; ++i) {
        if(!
IsPlayerNPC(i)) {
            
format(str,sizeof(str),"Level: %d",Player[i][pLevel]);
            
Update3DTextLabelText(LevelPlayer[i], COR_BRANCO,str);
        }
    }

Reply
#5

Quote:
Originally Posted by [BOPE]Seu._.Madruga
Посмотреть сообщение
PHP код:

new Text3D:LevelPlayer[MAX_PLAYERS];
public 
OnGameModeInit()
{
    
SetTimer("UpdateLabel"20000true);
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    new 
str[256];
    if(!
IsPlayerNPC(playerid)) {
        
format(str,sizeof(str),"Level: %d"Player[playerid][pLevel]);
        
LevelPlayer[playerid] = Create3DTextLabel(str, -130.040.050.040.00);
        
Attach3DTextLabelToPlayer(LevelPlayer[playerid], playerid ,0.00.00.7);
    }
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    
Delete3DTextLabel(LevelPlayer[playerid]);
    return 
1;
}
stock UpdateLabel() {
    new 
str[256];
    for(new 
0MAX_PLAYERS; ++i) {
        if(!
IsPlayerNPC(i)) {
            
format(str,sizeof(str),"Level: %d",Player[i][pLevel]);
            
Update3DTextLabelText(LevelPlayer[i], COR_BRANCO,str);
        }
    }

funfou quase perfeitamente, apenas o level do player que nгo estб atualizando, apenas quando ele reloga ae aparece lv 15, e como se estivesse duas Create3DTextLabel uma por cima da outra.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)