[Ajuda] Contador em TextDraw
#1

Seguinte galera, tem uma Textdraw que eu botei na tela com contadores, e queria saber como arruma-los:
. Zumbis
. Humanos
. Infectados
E jб tenho as variбveis, queria saber como boto o contador para funcionar, pois ele estб bugado..

/imageshack/img35/7668/akic.png
Reply
#2

isso contaria quantos Zombis e humanos estгo conectados?
Reply
#3

sim, e humanos infectados
Reply
#4

@Edit


pawn Код:
//onplayerupdate

new str[20];
format(str, sizeof(str), "Humanos: %d      Zumbis: %d", variavel que conta humanos, variavel que conta Zumbis);
        TextDrawSetString(textdraw, str);
Reply
#5

Nгo entendi muito bem, essas aqui sгo as texts:
pawn Код:
Textdraw3 = TextDrawCreate(46.000000, 282.000000, "Zumbis: ~y~03");
    TextDrawBackgroundColor(Textdraw3, 255);
    TextDrawFont(Textdraw3, 1);
    TextDrawLetterSize(Textdraw3, 0.170000, 0.799999);
    TextDrawColor(Textdraw3, -16776961);
    TextDrawSetOutline(Textdraw3, 1);
    TextDrawSetProportional(Textdraw3, 1);

    Textdraw4 = TextDrawCreate(88.000000, 282.000000, "Humanos: ~y~20");
    TextDrawBackgroundColor(Textdraw4, 255);
    TextDrawFont(Textdraw4, 1);
    TextDrawLetterSize(Textdraw4, 0.170000, 0.799999);
    TextDrawColor(Textdraw4, -1);
    TextDrawSetOutline(Textdraw4, 1);
    TextDrawSetProportional(Textdraw4, 1);

    Textdraw5 = TextDrawCreate(46.000000, 290.000000, "Infectados: ~w~223");
    TextDrawBackgroundColor(Textdraw5, 255);
    TextDrawFont(Textdraw5, 1);
    TextDrawLetterSize(Textdraw5, 0.260000, 1.000000);
    TextDrawColor(Textdraw5, 16711935);
    TextDrawSetOutline(Textdraw5, 1);
    TextDrawSetProportional(Textdraw5, 1);
Variбveis..
pawn Код:
Team[playerid]=Zumbi;   ou ZClass
Team[playerid]=Humano; ou HClass
Infectado[i]
Nгo precisa montar o cуdigo, sу ajude plz
Reply
#6

Crie uma string para os zumbis e formate-a:
Код:
new zumbis[100];
format(zumbis, sizeof(zumbis), "Infectados: %d", VARIБVEL);
O %d vai ser substituido pela variбvel que conta o nъmero de infectados, se a variбvel que conta os zumbis se chama zumbies ali em VARIБVEL vocк coloca zumbies

Agora й sу colocar essa string no TextDraw
Код:
Textdraw3 = TextDrawCreate(46.000000, 282.000000, zumbis);
Caso nгo entenda: https://sampwiki.blast.hk/wiki/Format

EDIT: o %d sу pode ser substituido por NЪMEROS, caso ali em %d for um texto coloque %s
Reply
#7

pawn Код:
new HumansTime,
Zumbistime;

//onde escolhe as equipes n sei

se escolher ser humano
HumansTime++;

//se escolher ser Zumbi
ZumbisTime++;


caso haja uma contradiзгo saia da equipe ou do servidor!
se for do time dos humanos

HumansTime--;

se for do time dos zumbis
ZumbisTime--;

//onplayerupdate

new str[20];
format(str, sizeof(str), "Humanos: %d", HumansTime);
        TextDrawSetString(Textdraw4, str);
format(str, sizeof(str), "Zumbis: %d", ZumbisTime);
        TextDrawSetString(Textdraw3, str);

explicaзгo melhor que essa nossa vamos ler o topico do garfild basico!
Reply
#8

Textdraw3 = TextDrawCreate(46.000000, 282.000000, Zumbi, "Zumbis: ~y~%d");
error 035: argument type mismatch (argument 3)
Reply
#9

error 021: symbol already defined: "str"
Reply
#10

Vocк criou a string e a formatou, correto?
Entгo o valor dela agora й "Zumbis: NЪMERO DE ZUMBIS"
Entгo coloque ela assim:
Textdraw3 = TextDrawCreate(46.000000, 282.000000, Zumbi, STRING);
Essa string vocк substitui pela que foi formatada.

Str jб existe, use outro nome.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)