[PEDIDO]Sistema de Pontos DM
#1

Olб galera, preciso de um sistema de pontos com TextDraw tipo Mata-Mata, tipo: quando o player mata ganha 1 ponto, e quando morre nгo perde pontos.
Reply
#2

Seta isso em SCORE ou numa VAR

Em OnPlayerDeath
pawn Код:
SetPlayerScore(killerid,GetPlayerScore(killerid) + 1);
E usa um textdraw pra retornar isso '-'
Reply
#3

Quote:
Originally Posted by arakuta
Посмотреть сообщение
Seta isso em SCORE ou numa VAR

Em OnPlayerDeath
pawn Код:
SetPlayerScore(killerid,GetPlayerScore(killerid) + 1);
E usa um textdraw pra retornar isso '-'
No FS em OnPlayerDeath tб assim:

public OnPlayerDeath(playerid, killerid, reason)
{
new Texto[30], Texto1[30];
ProgressaoInfo[killerid][Matou] ++;
ProgressaoInfo[playerid][Morreu] ++;
ProgressaoInfo[killerid][Pontos] = (ProgressaoInfo[killerid][Matou] - ProgressaoInfo[killerid][Morreu]);
ProgressaoInfo[playerid][Pontos] = (ProgressaoInfo[playerid][Matou] - ProgressaoInfo[playerid][Morreu]);
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;
}

Esse FS quando a pessoa й morta, perde um ponto, quero tirar isso, entendeu ?
Reply
#4

Tб ai o link com o cуdigo completo do [FS]

http://pastebin.com/nh5vg4G0
Reply
#5

So tira o fato de setar o score de quem morre, poem para nгo setar. Refiz seu code:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new Texto[30], Texto1[30];
    ProgressaoInfo[killerid][Matou] ++;
    ProgressaoInfo[killerid][Pontos] = (ProgressaoInfo[killerid][Matou] - ProgressaoInfo[killerid][Morreu]);
    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(killerid, ProgressaoInfo[killerid][Pontos]);
    return true;
}
DEVE FUNFAR
Reply
#6

Quote:
Originally Posted by arakuta
Посмотреть сообщение
So tira o fato de setar o score de quem morre, poem para nгo setar. Refiz seu code:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new Texto[30], Texto1[30];
    ProgressaoInfo[killerid][Matou] ++;
    ProgressaoInfo[killerid][Pontos] = (ProgressaoInfo[killerid][Matou] - ProgressaoInfo[killerid][Morreu]);
    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(killerid, ProgressaoInfo[killerid][Pontos]);
    return true;
}
DEVE FUNFAR
Pode entrar ai pra testar: 46.4.225.7:7779
Reply
#7

Quote:
Originally Posted by arakuta
Посмотреть сообщение
So tira o fato de setar o score de quem morre, poem para nгo setar. Refiz seu code:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new Texto[30], Texto1[30];
    ProgressaoInfo[killerid][Matou] ++;
    ProgressaoInfo[killerid][Pontos] = (ProgressaoInfo[killerid][Matou] - ProgressaoInfo[killerid][Morreu]);
    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(killerid, ProgressaoInfo[killerid][Pontos]);
    return true;
}
DEVE FUNFAR
NГO FUNCIONOU, QUANDO O PLAYER MORRE AINDA PERDE PONTO, segue o cуdigo completo:

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] - ProgressaoInfo[playerid][Morreu]);
        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[killerid][Morreu]);
    ProgressaoInfo[playerid][Pontos] = (ProgressaoInfo[playerid][Matou] - ProgressaoInfo[playerid][Morreu]);
    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;
}
E tipo depois como faзo para mostrar estes pontos por mortes, porque no TAB e no SAMP mostra os pontos de dinheiro.

Reply
#8

Este [FS] de Pontos, quando o player й assassinado й retirado 1 ponto seu, gostaria de retirar isso e deixar como Mata-Mata mesmo somente somando e que esses pontos sejam o score real, oq irб aparecer no TAB e no SA:MP!!!

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] - ProgressaoInfo[playerid][Morreu]);
        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[killerid][Morreu]);
    ProgressaoInfo[playerid][Pontos] = (ProgressaoInfo[playerid][Matou] - ProgressaoInfo[playerid][Morreu]);
    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


Forum Jump:


Users browsing this thread: 1 Guest(s)