SA-MP Forums Archive
[Ajuda] TextDraw - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] TextDraw (/showthread.php?tid=513543)



TextDraw - LKING - 16.05.2014

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]


Re: TextDraw - MultiKill - 16.05.2014

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


Re: TextDraw - LKING - 16.05.2014

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.


Re: TextDraw - MultiKill - 16.05.2014

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.


Re: TextDraw - LKING - 16.05.2014

Код:
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



Re: TextDraw - MultiKill - 16.05.2014

Envia a linha do erro 164.


Re: TextDraw - LKING - 16.05.2014

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


Re: TextDraw - MultiKill - 16.05.2014

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

Vocк usou () invйs de []

Agora envia a linha 155.


Re: TextDraw - LKING - 16.05.2014

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


Re: TextDraw - MultiKill - 16.05.2014

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