[Ajuda] Mostra Kill Deaths na tela
#6

Fiz um aqui para vocк bem simples...
Imagem de como ficou:

http://i.imgur.com/XFOiNVW.png

Cуdigo:
pawn Код:
enum e_PlayerStats
{
    pMatou,
    pMorreu
};

new pStats[MAX_PLAYERS][e_PlayerStats];

//Texts
new PlayerText:StatusBox[MAX_SLOTS];
new PlayerText:StatusInfo[MAX_SLOTS];
new PlayerText:StatusMatou[MAX_SLOTS];
new PlayerText:StatusMorreu[MAX_SLOTS];

new Updater;

//Ongamemodeinit
Updater = SetTimer("UpdateText",1000,true);

//Ongamemodeexit
KillTimer(Updater);

//OnPlayerConnect
    StatusBox[playerid] = CreatePlayerTextDraw(playerid, 621.199951, 288.220001, "usebox");
    PlayerTextDrawLetterSize(playerid, StatusBox[playerid], 0.000000, 7.564816);
    PlayerTextDrawTextSize(playerid, StatusBox[playerid], 493.200012, 0.000000);
    PlayerTextDrawAlignment(playerid, StatusBox[playerid], 1);
    PlayerTextDrawColor(playerid, StatusBox[playerid], 0);
    PlayerTextDrawUseBox(playerid, StatusBox[playerid], true);
    PlayerTextDrawBoxColor(playerid, StatusBox[playerid], 102);
    PlayerTextDrawSetShadow(playerid, StatusBox[playerid], 0);
    PlayerTextDrawSetOutline(playerid, StatusBox[playerid], 0);
    PlayerTextDrawFont(playerid, StatusBox[playerid], 0);

    StatusInfo[playerid] = CreatePlayerTextDraw(playerid, 517.599975, 289.706604, "~h~~y~Status:");
    PlayerTextDrawLetterSize(playerid, StatusInfo[playerid], 0.449999, 1.600000);
    PlayerTextDrawAlignment(playerid, StatusInfo[playerid], 1);
    PlayerTextDrawColor(playerid, StatusInfo[playerid], -1);
    PlayerTextDrawSetShadow(playerid, StatusInfo[playerid], 0);
    PlayerTextDrawSetOutline(playerid, StatusInfo[playerid], 1);
    PlayerTextDrawBackgroundColor(playerid, StatusInfo[playerid], 51);
    PlayerTextDrawFont(playerid, StatusInfo[playerid], 2);
    PlayerTextDrawSetProportional(playerid, StatusInfo[playerid], 1);

    StatusMatou[playerid] = CreatePlayerTextDraw(playerid, 508.799987, 310.613281, "Matou:");
    PlayerTextDrawLetterSize(playerid, StatusMatou[playerid], 0.449999, 1.600000);
    PlayerTextDrawAlignment(playerid, StatusMatou[playerid], 1);
    PlayerTextDrawColor(playerid, StatusMatou[playerid], -1);
    PlayerTextDrawSetShadow(playerid, StatusMatou[playerid], 0);
    PlayerTextDrawSetOutline(playerid, StatusMatou[playerid], 1);
    PlayerTextDrawBackgroundColor(playerid, StatusMatou[playerid], 51);
    PlayerTextDrawFont(playerid, StatusMatou[playerid], 3);
    PlayerTextDrawSetProportional(playerid, StatusMatou[playerid], 1);

    StatusMorreu[playerid] = CreatePlayerTextDraw(playerid, 508.000000, 330.026519, "Morreu:");
    PlayerTextDrawLetterSize(playerid, StatusMorreu[playerid], 0.449999, 1.600000);
    PlayerTextDrawAlignment(playerid, StatusMorreu[playerid], 1);
    PlayerTextDrawColor(playerid, StatusMorreu[playerid], -1);
    PlayerTextDrawSetShadow(playerid, StatusMorreu[playerid], 0);
    PlayerTextDrawSetOutline(playerid, StatusMorreu[playerid], 1);
    PlayerTextDrawBackgroundColor(playerid, StatusMorreu[playerid], 51);
    PlayerTextDrawFont(playerid, StatusMorreu[playerid], 3);
    PlayerTextDrawSetProportional(playerid, StatusMorreu[playerid], 1);

    pStats[playerid][pMatou] = 0;
    pStats[playerid][pMorreu] = 0;

//Onplayerdisconnect
PlayerTextDrawDestroy(playerid, PlayerText:StatusBox[playerid]);
PlayerTextDrawDestroy(playerid, PlayerText:StatusInfo[playerid]);
PlayerTextDrawDestroy(playerid, PlayerText:StatusMatou[playerid]);
PlayerTextDrawDestroy(playerid, PlayerText:StatusMorreu[playerid]);

//OnPlayerSpawn
PlayerTextDrawShow(playerid, PlayerText:StatusBox[playerid]);
PlayerTextDrawShow(playerid, PlayerText:StatusInfo[playerid]);
PlayerTextDrawShow(playerid, PlayerText:StatusMatou[playerid]);
PlayerTextDrawShow(playerid, PlayerText:StatusMorreu[playerid]);

//Onplayerdeath
    pStats[playerid][pMorreu]++;
    if(killerid != 0xFFFF)
    {
        pStats[killerid][pMatou]++;
    }

public UpdateText(playerid)
{
    new
        str[128];

    format(str, sizeof(str), "Matou: ~h~~g~%d", pStats[playerid][pMatou]);
    PlayerTextDrawSetString(playerid, StatusMatou[playerid], str);
    format(str, sizeof(str), "Morreu: ~h~~r~%d", pStats[playerid][pMorreu]);
    PlayerTextDrawSetString(playerid, StatusMorreu[playerid], str);
    return 1;
}
Reply


Messages In This Thread
Mostra Kill Deaths na tela - by joaobgnc - 22.10.2014, 20:37
Re: Mostra Kill Deaths na tela - by ipsLuan - 22.10.2014, 21:33
Re: Mostra Kill Deaths na tela - by K1w0 - 22.10.2014, 21:50
Re: Mostra Kill Deaths na tela - by MultiKill - 22.10.2014, 21:57
Re: Mostra Kill Deaths na tela - by ArthurxD - 22.10.2014, 22:01
Re: Mostra Kill Deaths na tela - by SalvatoreBR - 22.10.2014, 22:39
Re: Mostra Kill Deaths na tela - by K1w0 - 22.10.2014, 22:43
Re: Mostra Kill Deaths na tela - by MultiKill - 22.10.2014, 22:43
Re: Mostra Kill Deaths na tela - by SalvatoreBR - 22.10.2014, 22:48
Re: Mostra Kill Deaths na tela - by DarkBr - 06.03.2017, 19:25

Forum Jump:


Users browsing this thread: 1 Guest(s)