[Pedido] TextDraw
#1

oi pessoal tudo belezinha?

bom queria saber como eu faзo isso para mostrar quantasa mortes o player tem

aqui o text

pawn Код:
matou = TextDrawCreate(20.000000, 186.000000, "Matou:");
    TextDrawBackgroundColor(matou, 255);
    TextDrawFont(matou, 2);
    TextDrawLetterSize(matou, 0.260000, 1.200000);
    TextDrawColor(matou, -1);
    TextDrawSetOutline(matou, 0);
    TextDrawSetProportional(matou, 1);
    TextDrawSetShadow(matou, 1);
vlws
Reply
#2

acho que й isso ae man '-'
pawn Код:
matou = TextDrawCreate(20.000000, 186.000000, "Matou: %d");
    TextDrawBackgroundColor(matou, 255);
    TextDrawFont(matou, 2);
    TextDrawLetterSize(matou, 0.260000, 1.200000);
    TextDrawColor(matou, -1);
    TextDrawSetOutline(matou, 0);
    TextDrawSetProportional(matou, 1);
    TextDrawSetShadow(matou, 1);
   
   
   
public OnPlayerDeath(playerid, killerid, reason)
{
    format(Str, sizeof(Str), "Matou: %s", PlayerInfo[killerid][pKills]); ///No lugar de PlayerInfo[killerid][pKills] troque pela var de kills do seu gm
    TextDrawSetString(matou, Str);
    TextDrawShowForPlayer(killerid, matou);
    return 1;
}
Reply
#3

pawn Код:
// Topo do GM
enum pInfo
{
    pKills
};

PlayerInfo[MAX_PLAYERS][pInfo];

forward Kills(playerid);

public Kills(playerid)
{
     new String[50];      
     format(String, sizeof(String), "Matou: %d", PlayerInfo[playerid][pKills]);
     TextDrawSetString(matou, String);
     return 1;
}

//OnPlayerDeath

PlayerInfo[killerid][pKills]++;
E Mantenha essa sua Textdraw Assim ^^
Reply
#4

Quote:
Originally Posted by EditPawn
Посмотреть сообщение
acho que й isso ae man '-'
pawn Код:
matou = TextDrawCreate(20.000000, 186.000000, "Matou: %d");
    TextDrawBackgroundColor(matou, 255);
    TextDrawFont(matou, 2);
    TextDrawLetterSize(matou, 0.260000, 1.200000);
    TextDrawColor(matou, -1);
    TextDrawSetOutline(matou, 0);
    TextDrawSetProportional(matou, 1);
    TextDrawSetShadow(matou, 1);
   
   
   
public OnPlayerDeath(playerid, killerid, reason)
{
    format(Str, sizeof(Str), "Matou: %s", PlayerInfo[killerid][pKills]); ///No lugar de PlayerInfo[killerid][Kills] troque pela var de kills do seu gm
    TextDrawSetString(matou, Str);
    TextDrawShowForPlayer(killerid, matou);
    return 1;
}
Corrigindo o Format
pawn Код:
format(Str, sizeof(Str), "Matou: %d", PlayerInfo[killerid][pKills]); ///No lugar de PlayerInfo[killerid][Kills]
Reply
#5

Quote:
Originally Posted by blacktrindade
Посмотреть сообщение
Corrigindo o Format
pawn Код:
format(Str, sizeof(Str), "Matou: %d", PlayerInfo[killerid][pKills]); ///No lugar de PlayerInfo[killerid][Kills]
Para setar a string, tem que ser igual o meu black, pois ele seta a string do "playerid" e quando ele mata , conta pro "killerid", ou seja, o "killerid" torna a ser "playerid", quando nгo hб mais aзгo.
Reply
#6

pawn Код:
static
    Text:Matou[MAX_PLAYERS],
    Deaths[MAX_PLAYERS],
    text[20]
;

public OnGameModeInit()
{
    for(new x = 0; x < MAX_PLAYERS; x++) {
        Matou[x] = TextDrawCreate(20.000000, 186.000000, " ");
        TextDrawBackgroundColor(Matou[x], 255);
        TextDrawFont(Matou[x], 2);
        TextDrawLetterSize(Matou[x], 0.260000, 1.200000);
        TextDrawColor(Matou[x], -1);
        TextDrawSetOutline(Matou[x], 0);
        TextDrawSetProportional(Matou[x], 1);
        TextDrawSetShadow(Matou[x], 1);
    }
    return true;
}

public OnPlayerUpdate(playerid)
{
    format(text, sizeof(text), "Matou: %d", Deaths[playerid]);
    TextDrawShowForPlayer(playerid, Matou[playerid]);
    TextDrawSetString(Matou[playerid], text);
    return true;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    Deaths[killerid] ++;
    return true;
}
Reply
#7

@EDIT

dxa qto --'
Reply
#8

Quote:
Originally Posted by EditPawn
Посмотреть сообщение
acho que й isso ae man '-'
pawn Код:
matou = TextDrawCreate(20.000000, 186.000000, "Matou: %d");
    TextDrawBackgroundColor(matou, 255);
    TextDrawFont(matou, 2);
    TextDrawLetterSize(matou, 0.260000, 1.200000);
    TextDrawColor(matou, -1);
    TextDrawSetOutline(matou, 0);
    TextDrawSetProportional(matou, 1);
    TextDrawSetShadow(matou, 1);
   
   
   
public OnPlayerDeath(playerid, killerid, reason)
{
    format(Str, sizeof(Str), "Matou: %s", PlayerInfo[killerid][pKills]); ///No lugar de PlayerInfo[killerid][pKills] troque pela var de kills do seu gm
    TextDrawSetString(matou, Str);
    TextDrawShowForPlayer(killerid, matou);
    return 1;
}
Vlw viu ,mas nгo era isso
Quote:
Originally Posted by .FuneraL.
Посмотреть сообщение
pawn Код:
// Topo do GM
enum pInfo
{
    pKills
};

PlayerInfo[MAX_PLAYERS][pInfo];

forward Kills(playerid);

public Kills(playerid)
{
     new String[50];      
     format(String, sizeof(String), "Matou: %d", PlayerInfo[playerid][pKills]);
     TextDrawSetString(matou, String);
     return 1;
}

//OnPlayerDeath

PlayerInfo[killerid][pKills]++;
E Mantenha essa sua Textdraw Assim ^^
VLW
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)