[FilterScript] Barra Informacional
#1

Barra Informacional
Uma barra que mostra quantos vocк matou, quantas vezes morreu, o score e o nъmero de players online.

Observaзхes
Nгo foi testado, fiz rapidamente pois estava sem nada pra fazer e o sistema de salvamento й por conta do usuбrio.

Imagem


Download
pawn Код:
#include <a_samp>

new Text:Textdraw0;
new Text:Textdraw1;
new Text:Textdraw2;
new Text:Textdraw3[MAX_PLAYERS];
new Text:Textdraw6[MAX_PLAYERS];
new Text:Textdraw8[MAX_PLAYERS];
new PlayersOnline;
new Matou[MAX_PLAYERS];
new Morreu[MAX_PLAYERS];

public OnFilterScriptInit()
{
    print("-----------------------------------");
    print("------ Barra Informacional -------");
    print("---- Feita por Jumper(Totola) -----");
    print("-----------------------------------");
   
    PlayersOnline = 0;
   
    Textdraw0 = TextDrawCreate(660.000000, 436.000000, "box");
    TextDrawBackgroundColor(Textdraw0, 255);
    TextDrawFont(Textdraw0, 2);
    TextDrawLetterSize(Textdraw0, 0.290000, 1.000000);
    TextDrawColor(Textdraw0, -1);
    TextDrawSetOutline(Textdraw0, 1);
    TextDrawSetProportional(Textdraw0, 1);
    TextDrawUseBox(Textdraw0, 1);
    TextDrawBoxColor(Textdraw0, 128);
    TextDrawTextSize(Textdraw0, 0.000000, 0.000000);

    Textdraw1 = TextDrawCreate(465.000000, 435.000000, "0/100"); //playersonline
    TextDrawAlignment(Textdraw1, 2);
    TextDrawBackgroundColor(Textdraw1, 255);
    TextDrawFont(Textdraw1, 1);
    TextDrawLetterSize(Textdraw1, 0.300000, 1.100000);
    TextDrawColor(Textdraw1, -1);
    TextDrawSetOutline(Textdraw1, 1);
    TextDrawSetProportional(Textdraw1, 1);

    Textdraw2 = TextDrawCreate(7.000000, 435.000000, "matou:      morreu:      score:      players online:");
    TextDrawBackgroundColor(Textdraw2, 255);
    TextDrawFont(Textdraw2, 2);
    TextDrawLetterSize(Textdraw2, 0.400000, 1.000000);
    TextDrawColor(Textdraw2, 478605055);
    TextDrawSetOutline(Textdraw2, 1);
    TextDrawSetProportional(Textdraw2, 1);
    return 1;
}

public OnFilterScriptExit()
{
    TextDrawHideForAll(Textdraw0);
    TextDrawDestroy(Textdraw0);
    TextDrawHideForAll(Textdraw1);
    TextDrawDestroy(Textdraw1);
    TextDrawHideForAll(Textdraw2);
    TextDrawDestroy(Textdraw2);
    return 1;
}

public OnPlayerConnect(playerid)
{
    PlayersOnline ++;
   
    new Str[10];
    format(Str,sizeof(Str),"%d/100", PlayersOnline);
    TextDrawSetString(Textdraw1, Str);
   
    Textdraw3[playerid] = TextDrawCreate(84.000000, 435.000000, "0"); // matou
    TextDrawAlignment(Textdraw3[playerid], 2);
    TextDrawBackgroundColor(Textdraw3[playerid], 255);
    TextDrawFont(Textdraw3[playerid], 1);
    TextDrawLetterSize(Textdraw3[playerid], 0.300000, 1.100000);
    TextDrawColor(Textdraw3[playerid], -1);
    TextDrawSetOutline(Textdraw3[playerid], 1);
    TextDrawSetProportional(Textdraw3[playerid], 1);

    Textdraw6[playerid] = TextDrawCreate(188.000000, 435.000000, "0"); // morreu
    TextDrawAlignment(Textdraw6[playerid], 2);
    TextDrawBackgroundColor(Textdraw6[playerid], 255);
    TextDrawFont(Textdraw6[playerid], 1);
    TextDrawLetterSize(Textdraw6[playerid], 0.300000, 1.100000);
    TextDrawColor(Textdraw6[playerid], -1);
    TextDrawSetOutline(Textdraw6[playerid], 1);
    TextDrawSetProportional(Textdraw6[playerid], 1);

    Textdraw8[playerid] = TextDrawCreate(279.000000, 435.000000, "0"); // score
    TextDrawAlignment(Textdraw8[playerid], 2);
    TextDrawBackgroundColor(Textdraw8[playerid], 255);
    TextDrawFont(Textdraw8[playerid], 1);
    TextDrawLetterSize(Textdraw8[playerid], 0.300000, 1.100000);
    TextDrawColor(Textdraw8[playerid], -1);
    TextDrawSetOutline(Textdraw8[playerid], 1);
    TextDrawSetProportional(Textdraw8[playerid], 1);
   
    Matou[playerid] = 0; // SISTEMA DE SALVAMENTO FICA POR CONTA DO USUБRIO DO FS !!!!!!!!
    Morreu[playerid] = 0; // SISTEMA DE SALVAMENTO FICA POR CONTA DO USUБRIO DO FS!!!!!!!!
   
    TextDrawShowForPlayer(playerid, Textdraw0);
    TextDrawShowForPlayer(playerid, Textdraw1);
    TextDrawShowForPlayer(playerid, Textdraw2);
    TextDrawShowForPlayer(playerid, Textdraw3[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw6[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw8[playerid]);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    new Str[10];
    format(Str,sizeof(Str),"%d", GetPlayerScore(playerid));
    TextDrawSetString(Textdraw8[playerid], Str);

    new Strr[10];
    format(Strr,sizeof(Strr),"%d", Morreu[playerid]);
    TextDrawSetString(Textdraw3[playerid], Strr);
   
    new Strrr[10];
    format(Strrr,sizeof(Strrr),"%d", Morreu[playerid]);
    TextDrawSetString(Textdraw6[playerid], Strrr);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    PlayersOnline --;
   
    new Str[10];
    format(Str,sizeof(Str),"%d/100", PlayersOnline);
    TextDrawSetString(Textdraw1, Str);
   
    TextDrawDestroy(Textdraw3[playerid]);
    TextDrawDestroy(Textdraw6[playerid]);
    TextDrawDestroy(Textdraw8[playerid]);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    Matou[killerid] ++;
    Morreu[playerid] ++;

    new Strr[10];
    format(Strr,sizeof(Strr),"%d", Matou[killerid]);
    TextDrawSetString(Textdraw3[killerid], Strr);

    new Strrr[10];
    format(Strrr,sizeof(Strrr),"%d", Morreu[playerid]);
    TextDrawSetString(Textdraw6[playerid], Strrr);
    return 1;
}
Se alguйm for testar, o que eu duvido, e encontrar algum erro me avise que tento corrigir.
Reply
#2

boa totolaaaaaaa
Reply
#3

Tipo de textdraw errado, deveria ser player textdraw, e poderia usar sу uma ate. Assim nгo desperdiзa textdraw
Reply
#4

Quote:
Originally Posted by bielzera[:
Посмотреть сообщение
boa totolaaaaaaa
valeu viadin kkkkk

Quote:
Originally Posted by PT
Посмотреть сообщение
Tipo de textdraw errado, deveria ser player textdraw, e poderia usar sу uma ate. Assim nгo desperdiзa textdraw
porreta em
Reply
#5

pawn Код:
public OnPlayerSpawn(playerid)
{
    new Str[10];
    format(Str,sizeof(Str),"%d", GetPlayerScore(playerid));
    TextDrawSetString(Textdraw8[playerid], Str);

    new Strr[10];
    format(Strr,sizeof(Strr),"%d", Morreu[playerid]);
    TextDrawSetString(Textdraw3[playerid], Strr);
   
    new Strrr[10];
    format(Strrr,sizeof(Strrr),"%d", Morreu[playerid]);
    TextDrawSetString(Textdraw6[playerid], Strrr);
    return 1;
}
"GangsTa" e postando projetos deste nнvel?


Assim nгo dб..
Reply
#6

Quote:
Originally Posted by zSuYaNw
Посмотреть сообщение
pawn Код:
public OnPlayerSpawn(playerid)
{
    new Str[10];
    format(Str,sizeof(Str),"%d", GetPlayerScore(playerid));
    TextDrawSetString(Textdraw8[playerid], Str);

    new Strr[10];
    format(Strr,sizeof(Strr),"%d", Morreu[playerid]);
    TextDrawSetString(Textdraw3[playerid], Strr);
   
    new Strrr[10];
    format(Strrr,sizeof(Strrr),"%d", Morreu[playerid]);
    TextDrawSetString(Textdraw6[playerid], Strrr);
    return 1;
}
"GangsTa" e postando projetos deste nнvel?

Assim nгo dб..
Godfada e sendo ignorante nesse nнvel?

Й daн? Desde quando o ranking no fуrum diz alguma coisa sobre o quanto vc sabe?
Reply
#7

Quote:
Originally Posted by Jumper.
Посмотреть сообщение
Godfada e sendo ignorante nesse nнvel?

Й daн? Desde quando o ranking no fуrum diz alguma coisa sobre o quanto vc sabe?
O seu rank й ligado as suas reputaзхes, +rep geralmente й dado quando apresenta um bom projeto ou ajuda alguma pessoa.

Logo o seu rank se refere ao seu nнvel de conhecimento sim.

A nгo ser que vocк use algum tipo de bot para conseguir +rep e-e

Veja meu exemplo, sei nada e sу tenho 1 rep. kkkk
Reply
#8

Quote:
Originally Posted by CharCoast
Посмотреть сообщение
O seu rank й ligado as suas reputaзхes, +rep geralmente й dado quando apresenta um bom projeto ou ajuda alguma pessoa.

Logo o seu rank se refere ao seu nнvel de conhecimento sim.

A nгo ser que vocк use algum tipo de bot para conseguir +rep e-e

Veja meu exemplo, sei nada e sу tenho 1 rep. kkkk
Nгo. O ranking й dado pelo nъmero de postagem. Sou membro desde 2011 e acho que 500 postagens em mais de 3 anos й uma mйdia boa. Isso nгo significa que sei alguma coisa.
Reply
#9

Quote:
Originally Posted by Jumper.
Посмотреть сообщение
Godfada e sendo ignorante nesse nнvel?

Й daн? Desde quando o ranking no fуrum diz alguma coisa sobre o quanto vc sabe?
Rank nгo mostra sabedoria, mas realmente este nгo estб funcional veja:
pawn Код:
public OnPlayerSpawn(playerid)
{
    new Str[10];
    format(Str,sizeof(Str),"%d", GetPlayerScore(playerid));
    TextDrawSetString(Textdraw8[playerid], Str);

    new Strr[10];
    format(Strr,sizeof(Strr),"%d", Morreu[playerid]);
    TextDrawSetString(Textdraw3[playerid], Strr);
   
    new Strrr[10];
    format(Strrr,sizeof(Strrr),"%d", Morreu[playerid]);
    TextDrawSetString(Textdraw6[playerid], Strrr);
    return 1;
}
Vocк estб inserindo na textdraw "Matou" e "Morreu" o total de mortes, o certo seria apenas em "Mortes" o valor da variбvel "Morreu" e em "Matou" o valor da variбvel referente ao nъmero de assassinatos. E poderias ter melhorado o cуdigo...
Reply
#10

Quote:
Originally Posted by Jumper.
Посмотреть сообщение
Nгo. O ranking й dado pelo nъmero de postagem. Sou membro desde 2011 e acho que 500 postagens em mais de 3 anos й uma mйdia boa. Isso nгo significa que sei alguma coisa.
Membro desde 2011 e mal aprendeu a utilizar a linguagem kkkkkk
Vai entender esse pessoal... Deixe de ignorвncia e aprenda com seu erro, mude suas atitudes e seja humilde.
Ficar se estressando por besteira rapaz...
Enfim, fora dos erros do seu script, a visualizaзгo do "produto" que vocк mostrou, estб boa.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)