Little help
#8

i use this for the saving

pawn Код:
#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 OnFilterScriptExit()
{
return 1;
}


public OnPlayerRequestClass(playerid, classid)
{
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, "Kills", Killz[playerid]);
dini_IntSet(file, "Deaths", Deathz[playerid]);
SetPlayerScore(playerid, dini_Int(file, "Score"));

}
else {
SetPlayerScore(playerid, dini_Int(file, "Score"));
       
}
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, "Kills", Killz[playerid]);
dini_IntSet(file, "Deaths", Deathz[playerid]);
}
return 1;
}



public OnPlayerDeath(playerid, killerid, reason)
{
Killz[killerid] ++;
Deathz[playerid] ++;
return 1;
}
its a TDM server skin does not save
Reply


Messages In This Thread
Little help - by ZBits - 18.08.2012, 03:48
Re: Little help - by Avi57 - 18.08.2012, 03:49
Re: Little help - by BigAl - 18.08.2012, 03:49
Re: Little help - by Ballu Miaa - 18.08.2012, 03:51
Re: Little help - by BigAl - 18.08.2012, 03:51
Re: Little help - by ZBits - 18.08.2012, 03:52
Re: Little help - by Ballu Miaa - 18.08.2012, 03:54
Re: Little help - by ZBits - 18.08.2012, 03:56
Respuesta: Little help - by ThePhenix - 18.08.2012, 03:59
Re: Little help - by ZBits - 18.08.2012, 04:00

Forum Jump:


Users browsing this thread: 1 Guest(s)