[Ajuda] TextDraw
#1

forward UpdateText(playerid);
public UpdateText(playerid)
{
new pScore[16], pPing[16], pSkin[16], pCash[16];
format(pPing, sizeof(pPing), "%d ms", GetPlayerPing(playerid));
TextDrawSetString(Textdraw3, pPing);
format(pScore, sizeof(pScore), "%d", GetPlayerScore(playerid));
TextDrawSetString(Textdraw4, pScore);
format(pSkin, sizeof(pSkin), "%d", GetPlayerSkin(playerid));
TextDrawSetString(Textdraw8, pSkin);
format(pCash, sizeof(pCash), "%d", GetPlayerMoney(playerid));
TextDrawSetString(Textdraw6, pCash);
SetTimerEx("UpdateText2", 1000, true, "i", playerid);
return 1;
}

forward UpdateText2(playerid);
public UpdateText2(playerid)
{
new pScore[16], pPing[16], pSkin[16], pCash[16];
format(pPing, sizeof(pPing), "%d ms", GetPlayerPing(playerid));
TextDrawSetString(Textdraw3, pPing);
format(pScore, sizeof(pScore), "%d", GetPlayerScore(playerid));
TextDrawSetString(Textdraw4, pScore);
format(pSkin, sizeof(pSkin), "%d", GetPlayerSkin(playerid));
TextDrawSetString(Textdraw8, pSkin);
format(pCash, sizeof(pCash), "%d $", GetPlayerMoney(playerid));
TextDrawSetString(Textdraw6, pCash);
return 1;
}[/CODE]
Reply
#2

Nгo entendi no que vocк quer ajuda, explique melhor.
Reply
#3

Eu quero que em vez de dizer cash e ping diga kills e deaths, tipo a cada mortes e mortos que os jogadores matarem/morrerem aquilo aumentava tambem.
Reply
#4

No topo do gm:
pawn Код:
new Matou[MAX_PLAYERS]; // a variбvel que verifica quantos o player matou e seta quantos players ele matou
new Morreu[MAX_PLAYERS]; // seta quantas vezes ele morreu e verifica quantas vezes ele morreu
Em OnPlayerDeath
pawn Код:
Morreu[playerid] ++; // seta que o player morreu
Matou[killerid] ++; // seta que o player matou
pawn Код:
forward UpdateText2(playerid);
public UpdateText2(playerid)
{
    new pScore[16], pPing[16], pSkin[16], pCash[16];
    format(pPing, sizeof(pPing), "%d", Morreu[playerid]);
    TextDrawSetString(Textdraw3, pPing);
    format(pScore, sizeof(pScore), "%d", GetPlayerScore(playerid));
    TextDrawSetString(Textdraw4, pScore);
    format(pSkin, sizeof(pSkin), "%d", GetPlayerSkin(playerid));
    TextDrawSetString(Textdraw8, pSkin);
    format(pCash, sizeof(pCash), "%d", Matou[playerid]);
    TextDrawSetString(Textdraw6, pCash);
    return 1;
}
Sу vocк arrumar direito. Te aconselho a aprender a usar variбveis.
Reply
#5

Код:
C:\Users\Utilizador\Desktop\programas\geh\filterscripts\TD-s.pwn(29) : error 017: undefined symbol "TextDrawSetSelectable"
C:\Users\Utilizador\Desktop\programas\geh\filterscripts\TD-s.pwn(39) : error 017: undefined symbol "TextDrawSetSelectable"
C:\Users\Utilizador\Desktop\programas\geh\filterscripts\TD-s.pwn(49) : error 017: undefined symbol "TextDrawSetSelectable"
C:\Users\Utilizador\Desktop\programas\geh\filterscripts\TD-s.pwn(59) : error 017: undefined symbol "TextDrawSetSelectable"
C:\Users\Utilizador\Desktop\programas\geh\filterscripts\TD-s.pwn(69) : error 017: undefined symbol "TextDrawSetSelectable"
C:\Users\Utilizador\Desktop\programas\geh\filterscripts\TD-s.pwn(79) : error 017: undefined symbol "TextDrawSetSelectable"
C:\Users\Utilizador\Desktop\programas\geh\filterscripts\TD-s.pwn(89) : error 017: undefined symbol "TextDrawSetSelectable"
C:\Users\Utilizador\Desktop\programas\geh\filterscripts\TD-s.pwn(99) : error 017: undefined symbol "TextDrawSetSelectable"
C:\Users\Utilizador\Desktop\programas\geh\filterscripts\TD-s.pwn(109) : error 017: undefined symbol "TextDrawSetSelectable"
C:\Users\Utilizador\Desktop\programas\geh\filterscripts\TD-s.pwn(155) : error 017: undefined symbol "killerid"
C:\Users\Utilizador\Desktop\programas\geh\filterscripts\TD-s.pwn(164) : error 012: invalid function call, not a valid address
C:\Users\Utilizador\Desktop\programas\geh\filterscripts\TD-s.pwn(164) : warning 215: expression has no effect
C:\Users\Utilizador\Desktop\programas\geh\filterscripts\TD-s.pwn(164) : error 001: expected token: ";", but found ")"
C:\Users\Utilizador\Desktop\programas\geh\filterscripts\TD-s.pwn(164) : error 029: invalid expression, assumed zero
C:\Users\Utilizador\Desktop\programas\geh\filterscripts\TD-s.pwn(164) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Reply
#6

Envia a linha do erro 164.
Reply
#7

format(pPing, sizeof(pPing), "%d ms", Morreu(playerid));
Reply
#8

164: format(pPing, sizeof(pPing), "%d ms", Morreu[playerid]);

Vocк usou () invйs de []

Agora envia a linha 155.
Reply
#9

Matou[killerid] ++; // seta que o player matou
Reply
#10

Quote:
Originally Posted by LKING
Посмотреть сообщение
Matou[killerid] ++; // seta que o player matou
Vocк colocou na public OnPlayerDeath(playerid, killerid, reason) ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)