[Ajuda] Conflito
#1

Fiz um textdraw assim

SetTimer("att",1000,true);
pawn Код:
score = TextDrawCreate(20.000000, 171.000000, "_");
    TextDrawBackgroundColor(score, 255);
    TextDrawFont(score, 2);
    TextDrawLetterSize(score, 0.280000, 1.300000);
    TextDrawColor(score, -1);
    TextDrawSetOutline(score, 0);
    TextDrawSetProportional(score, 1);
    TextDrawSetShadow(score, 1);


pawn Код:
forward att(playerid)
public att(playerid)
    {
    new str[12];
    format(str, 12, "score: %d" ,GetPlayerScore(playerid));
    TextDrawSetString(score, str);
    }
o negocio e que de vez enquando aparece o score do outro player

desde ja vlws
Reply
#2

pawn Код:
forward att();
public att()
{
    new str[12];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        format(str, 12, "score: %d" ,GetPlayerScore(i));
        TextDrawSetString(score, str);
    }
}
Reply
#3

Quote:
Originally Posted by THE_FALLEN
Посмотреть сообщение
pawn Код:
forward att();
public att()
{
    new str[12];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        format(str, 12, "score: %d" ,GetPlayerScore(i));
        TextDrawSetString(score, str);
    }
}
hm fico a mesma coisa, mas vlw pela intenзгo
Reply
#4

vou arrumar isso calma jaja dou edit.

@arrumado
pawn Код:
//topo do gm - delete o antigo que voce criou e coloque assim:
new Text:score[MAX_PLAYERS];


//OnGameModeInt
SetTimer("att", 1000, true);
for(new t = 0; t < MAX_PLAYERS; t++)
{
    score[t] = TextDrawCreate(20.000000, 171.000000, "_");
    TextDrawBackgroundColor(score[t], 255);
    TextDrawFont(score[t], 2);
    TextDrawLetterSize(score[t], 0.280000, 1.300000);
    TextDrawColor(score[t], -1);
    TextDrawSetOutline(score[t], 0);
    TextDrawSetProportional(score[t], 1);
    TextDrawSetShadow(score[t], 1);
}

// no fim do gm
forward att();
public att()
{
    new str[12];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        format(str, 12, "score: %d" ,GetPlayerScore(i));
        TextDrawSetString(score[i], str);
    }
}

//adicionar o textdrawshow.. em onplayerspawn
public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid, score[playerid]);
    return 1;
}
Reply
#5

Melhorado

pawn Код:
//topo do gm - delete o antigo que voce criou e coloque assim:
new Text:score[MAX_PLAYERS];


//OnGameModeInt
SetTimer("att", 1000, true);
for(new x = 0; x < MAX_PLAYERS; x++)
{
    score[x] = TextDrawCreate(20.000000, 171.000000, "score: 1000000");
    TextDrawBackgroundColor(score[x], 255);
    TextDrawFont(score[x], 2);
    TextDrawLetterSize(score[x], 0.280000, 1.300000);
    TextDrawColor(score[x], -1);
    TextDrawSetOutline(score[x], 0);
    TextDrawSetProportional(score[x], 1);
    TextDrawSetShadow(score[x], 1);
}

// no fim do gm
forward att();
public att()
{
    new str[12];
    for(new x = 0, y = GetMaxPlayers(); x != y; x++)
    {
        if(!IsPlayerConnected(x)) continue;
        format(str, 12, "score: %d" ,GetPlayerScore(x));
        TextDrawShowForPlayer(x, score[x]);
        TextDrawSetString(score[x], str);
   }
    return true;
}
Reply
#6

Quote:
Originally Posted by THE_FALLEN
Посмотреть сообщение
vou arrumar isso calma jaja dou edit.

@arrumado
pawn Код:
//topo do gm - delete o antigo que voce criou e coloque assim:
new Text:score[MAX_PLAYERS];


//OnGameModeInt
SetTimer("att", 1000, true);
for(new t = 0; t < MAX_PLAYERS; t++)
{
    score[t] = TextDrawCreate(20.000000, 171.000000, "_");
    TextDrawBackgroundColor(score[t], 255);
    TextDrawFont(score[t], 2);
    TextDrawLetterSize(score[t], 0.280000, 1.300000);
    TextDrawColor(score[t], -1);
    TextDrawSetOutline(score[t], 0);
    TextDrawSetProportional(score[t], 1);
    TextDrawSetShadow(score[t], 1);
}

// no fim do gm
forward att();
public att()
{
    new str[12];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        format(str, 12, "score: %d" ,GetPlayerScore(i));
        TextDrawSetString(score[i], str);
    }
}

//adicionar o textdrawshow.. em onplayerspawn
public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid, score[playerid]);
    return 1;
}
vlws +rep
Reply
#7

Quote:
Originally Posted by sanalex
Посмотреть сообщение
Melhorado

pawn Код:
//topo do gm - delete o antigo que voce criou e coloque assim:
new Text:score[MAX_PLAYERS];


//OnGameModeInt
SetTimer("att", 1000, true);
for(new x = 0; x < MAX_PLAYERS; x++)
{
    score[x] = TextDrawCreate(20.000000, 171.000000, "score: 1000000");
    TextDrawBackgroundColor(score[x], 255);
    TextDrawFont(score[x], 2);
    TextDrawLetterSize(score[x], 0.280000, 1.300000);
    TextDrawColor(score[x], -1);
    TextDrawSetOutline(score[x], 0);
    TextDrawSetProportional(score[x], 1);
    TextDrawSetShadow(score[x], 1);
}

// no fim do gm
forward att();
public att()
{
    new str[12];
    for(new x = 0, y = GetMaxPlayers(); x != y; x++)
    {
        if(!IsPlayerConnected(x)) continue;
        format(str, 12, "score: %d" ,GetPlayerScore(x));
        TextDrawShowForPlayer(x, score[x]);
        TextDrawSetString(score[x], str);
   }
    return true;
}
acada um segundo vai mandar abrir, mesmo ela estando aberta "o Draw"...
Reply
#8

Use o meu e nгo terб problemas .
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)