[AJUDA] Como faзo isso ?
#2

os pontos nгo sгo retirados. eh somente feito um calculo de subtraзгo! q no fim sai uma media.

Assinatos - Mortes

@edit

Nгo sei se eh isso q vc qr. oq eu mudei apenas ele vai mostrar os assassinatos e nгo vai tirar a media.
pawn Код:
/*******************************************************************************
********************************************************************************
**************************   Feito por Josma_CMD  ******************************
********************************************************************************
********************************************************************************
*/

#include <a_samp>
#include <SII>
 
const Branco = 0xFFFFFFFF;
 
enum PInfo { Matou, Morreu, Pontos, Text:TPontos, bool:Connectado, };
 
new ProgressaoInfo[MAX_PLAYERS][PInfo];
new arquivo[50];
 
forward SalvarInformacoes(playerid);
forward CarregarInformacoes(playerid);
 
public OnFilterScriptInit()
{
        print("\n--------------------------------------");
        print(" Sistema de Pontos feito por Josma_CMD");
        print("--------------------------------------\n");
        return true;
}
 
public OnFilterScriptExit()
{
        for(new i = 0, PP = GetMaxPlayers(); i <= PP; i++)
        {
            if(!IsPlayerConnected(i)) continue;
                TextDrawDestroy(ProgressaoInfo[i][TPontos]);
        }
        return true;
}
 
public OnPlayerConnect(playerid)
{
        CarregarInformacoes(playerid);
    //********************************* Pontos *********************************
    ProgressaoInfo[playerid][TPontos] = TextDrawCreate(496.000000, 105.000000, "~l~Pontos: ~b~953");
    TextDrawBackgroundColor(ProgressaoInfo[playerid][TPontos], 16777215);
    TextDrawFont(ProgressaoInfo[playerid][TPontos], 2);
    TextDrawLetterSize(ProgressaoInfo[playerid][TPontos], 0.420000, 1.400000);
    TextDrawColor(ProgressaoInfo[playerid][TPontos], -1);
    TextDrawSetOutline(ProgressaoInfo[playerid][TPontos], 1);
    TextDrawSetProportional(ProgressaoInfo[playerid][TPontos], 1);
        return true;
}
 
public OnPlayerDisconnect(playerid, reason)
{
        SalvarInformacoes(playerid);
        TextDrawDestroy(ProgressaoInfo[playerid][TPontos]);
        return true;
}
 
public OnPlayerSpawn(playerid)
{
        if(ProgressaoInfo[playerid][Connectado] == false)
        {
                new string[20];
                ProgressaoInfo[playerid][Pontos] = ProgressaoInfo[playerid][Matou];
        format(string, sizeof(string), "~l~Pontos: ~b~%d", ProgressaoInfo[playerid][Pontos]);
                TextDrawSetString(ProgressaoInfo[playerid][TPontos], string);
                TextDrawShowForPlayer(playerid, ProgressaoInfo[playerid][TPontos]);
        }
        return true;
}
 
public OnPlayerDeath(playerid, killerid, reason)
{
        new Texto[30], Texto1[30];
        ProgressaoInfo[killerid][Matou] ++;
        ProgressaoInfo[playerid][Morreu] ++;
        ProgressaoInfo[killerid][Pontos] = ProgressaoInfo[killerid][Matou];
        ProgressaoInfo[playerid][Pontos] = ProgressaoInfo[playerid][Matou];
        format(Texto, sizeof(Texto), "~l~Pontos: ~b~%d", ProgressaoInfo[killerid][Pontos]);
        TextDrawSetString(ProgressaoInfo[killerid][TPontos], Texto);
        TextDrawShowForPlayer(killerid, ProgressaoInfo[killerid][TPontos]);
        format(Texto1, sizeof(Texto1), "~l~Pontos: ~b~%d", ProgressaoInfo[playerid][Pontos]);
        TextDrawSetString(ProgressaoInfo[playerid][TPontos], Texto1);
        TextDrawShowForPlayer(playerid, ProgressaoInfo[playerid][TPontos]);
        SetPlayerScore(playerid, ProgressaoInfo[playerid][Pontos]);
        SetPlayerScore(killerid, ProgressaoInfo[killerid][Pontos]);
        return true;
}
 
public SalvarInformacoes(playerid)
{
        format(arquivo, sizeof(arquivo), "/PontosInfo/%s.ini",pNome(playerid));
        INI_Open(arquivo);
        INI_WriteInt("Matou", ProgressaoInfo[playerid][Matou]);
        INI_WriteInt("Morreu", ProgressaoInfo[playerid][Morreu]);
        INI_Save();
        INI_Close();
        return true;
}
 
public CarregarInformacoes(playerid)
{
        format(arquivo, sizeof(arquivo), "/PontosInfo/%s.ini",pNome(playerid));
        if(fexist(arquivo))
        {
            INI_Open(arquivo);
                ProgressaoInfo[playerid][Matou] = INI_ReadInt("Matou");
                ProgressaoInfo[playerid][Morreu] = INI_ReadInt("Morreu");
                INI_Close();
        }
        else SalvarInformacoes(playerid);
        return true;
}
 
stock pNome(playerid)
{
        new nome[MAX_PLAYER_NAME];
        GetPlayerName(playerid, nome, sizeof(nome));
        return nome;
}
Reply


Messages In This Thread
[AJUDA] Como faзo isso ? - by aleex995 - 18.02.2012, 22:28
Re: [AJUDA] Como faзo isso ? - by paulor - 18.02.2012, 22:50
Re: [AJUDA] Como faзo isso ? - by aleex995 - 18.02.2012, 22:56
Re: [AJUDA] Como faзo isso ? - by paulor - 18.02.2012, 23:05
Re: [AJUDA] Como faзo isso ? - by aleex995 - 18.02.2012, 23:13
Re: [AJUDA] Como faзo isso ? - by paulor - 18.02.2012, 23:22
Re: [AJUDA] Como faзo isso ? - by aleex995 - 18.02.2012, 23:25
Re: [AJUDA] Como faзo isso ? - by paulor - 18.02.2012, 23:36
Re: [AJUDA] Como faзo isso ? - by aleex995 - 18.02.2012, 23:40
Re: [AJUDA] Como faзo isso ? - by aleex995 - 19.02.2012, 00:07

Forum Jump:


Users browsing this thread: 1 Guest(s)