[Help] Stats system
#1

Ok I have this stat system, it saves Kills, Death, Cash, Score.
And I want it to show those with a cmd /stats. How to make that?

Код:
#define FILTERSCRIPT

#include <a_samp>
#include <Dini>
#include <Dutils>
#include <Dudb>

#define savefolder "/save/%s.ini"

#pragma unused ret_memcpy

new Killz[MAX_PLAYERS];
new Deathz[MAX_PLAYERS];

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnPlayerConnect(playerid)
{
    new pname[128];
	new file[128];
	GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), savefolder,pname);
    if(!dini_Exists(file)) {
        dini_Create(file);
        dini_IntSet(file, "Score", 0);
        dini_IntSet(file, "Money", 0);
        dini_IntSet(file, "Kills", Killz[playerid]);
        dini_IntSet(file, "Deaths", Deathz[playerid]);
        SetPlayerScore(playerid, dini_Int(file, "Score"));
        SetPlayerMoney(playerid, dini_Int(file, "Money"));

    }
    else
	{
        SetPlayerScore(playerid, dini_Int(file, "Score"));
        SetPlayerMoney(playerid, dini_Int(file, "Money"));
        SetPlayerSkin(playerid, dini_Int(file, "Skin"));
	}
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	new pname[128];
	new file[128];
	GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), savefolder,pname);
    if(!dini_Exists(file)) {
    }
    else {
        dini_IntSet(file, "Score", GetPlayerScore(playerid));
        dini_IntSet(file, "Money", GetPlayerMoney(playerid));
        dini_IntSet(file, "Kills", Killz[playerid]);
        dini_IntSet(file, "Deaths", Deathz[playerid]);
    }
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	Killz[killerid] ++;
	Deathz[playerid] ++;
	return 1;
}
Reply


Messages In This Thread
[Help] Stats system - by alainchaccour - 18.10.2011, 17:15
Re: [Help] Stats system - by =WoR=Varth - 18.10.2011, 17:20
Re: [Help] Stats system - by alainchaccour - 18.10.2011, 17:23
Re: [Help] Stats system - by =WoR=Varth - 18.10.2011, 17:25
Re: [Help] Stats system - by Kavinsky - 18.10.2011, 17:32
Re: [Help] Stats system - by alainchaccour - 18.10.2011, 17:32
Re: [Help] Stats system - by alainchaccour - 18.10.2011, 17:35
Re: [Help] Stats system - by Stigg - 18.10.2011, 17:36
Re: [Help] Stats system - by alainchaccour - 18.10.2011, 17:39
Re: [Help] Stats system - by Stigg - 18.10.2011, 17:49

Forum Jump:


Users browsing this thread: 5 Guest(s)