SA-MP Forums Archive
[AJUDA] Como faзo isso ? - 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] Como faзo isso ? (/showthread.php?tid=319387)



[AJUDA] Como faзo isso ? - aleex995 - 18.02.2012

Alguйm pode me ajudar com esse [FS]Sistema de Pontos, como faz pra deixar quando o player morrer pra nгo retirar seus pontos, ou seja apenas que vб somando pontos ?

http://pastebin.com/N1jSSmCq


Re: [AJUDA] Como faзo isso ? - paulor - 18.02.2012

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;
}



Re: [AJUDA] Como faзo isso ? - aleex995 - 18.02.2012

Quote:
Originally Posted by paulor
Посмотреть сообщение
os pontos nгo sгo retirados. eh somente feito um calculo de subtraзгo! q no fim sai uma media.

Assinatos - Mortes
Como nгo sгo retirados cara, eu jб testei, acho q vc nгo entendeu, tipo vc mata alguйm GANHA 1 PONTO aparece na textdraw, e quando morre PERDE 1 PONTO, aparece na textdraw.


Re: [AJUDA] Como faзo isso ? - paulor - 18.02.2012

eu li o COD e vi ele nгo retira ele faz um calculo de subtraзгo mas veja se aquilo q vc qr !


Re: [AJUDA] Como faзo isso ? - aleex995 - 18.02.2012

Quote:
Originally Posted by paulor
Посмотреть сообщение
eu li o COD e vi ele nгo retira ele faz um calculo de subtraзгo mas veja se aquilo q vc qr !
Se puder entrar ai pra testarmos 5.64.119.218:7777


Re: [AJUDA] Como faзo isso ? - paulor - 18.02.2012

Retrieving info...


Re: [AJUDA] Como faзo isso ? - aleex995 - 18.02.2012

Quote:
Originally Posted by paulor
Посмотреть сообщение
Retrieving info...
Estranho tф com o Hamachi ligado, oq pode ser, tenta adicionar sу o ip.


Re: [AJUDA] Como faзo isso ? - paulor - 18.02.2012

passa o nome e senha do hamachi se nгo, nгo entra


Re: [AJUDA] Como faзo isso ? - aleex995 - 18.02.2012

Quote:
Originally Posted by paulor
Посмотреть сообщение
passa o nome e senha do hamachi se nгo, nгo entra
nome/id: aleex995
senha: tecnologia

!!


Re: [AJUDA] Como faзo isso ? - aleex995 - 19.02.2012

Quote:
Originally Posted by paulor
Посмотреть сообщение
passa o nome e senha do hamachi se nгo, nгo entra
Poiser como disse lб no TAB tб aparecendo o dinheiro, como faзo pra mostrar o score de mortes e salvar isso quando o player sair, pode ajudar.