Nem teszteltem, de tessék:
#include <a_samp>
#include <Dini>
#include <zcmd>
new pLevel[MAX_PLAYERS],
pXP[MAX_PLAYERS],
pKills[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
if(dini_Exists(pFile(playerid))){
pLevel[playerid] = dini_Int(pFile(playerid), \"Level\");
pXP[playerid] = dini_Int(pFile(playerid), \"XP\");
pKills[playerid] = dini_Int(pFile(playerid), \"Kills\");
}
pLevel[playerid] = 1;
pXP[playerid] = 0;
pKills[playerid] = 0;
}
public OnPlayerDisconnect(playerid, reason)
{
if(!dini_Exists(pFile(playerid))){
dini_Create(pFile(playerid));
}
dini_IntSet(pFile(playerid), \"Level\", pLevel[playerid]);
dini_IntSet(pFile(playerid), \"XP\", pXP[playerid]);
dini_IntSet(pFile(playerid), \"Kills\", pKills[playerid]);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid != INVALID_PLAYER_ID){
pKills[playerid]++;
if(pKills[playerid] == 5){
pXP[playerid]++;
if(pXP[playerid] == 10){
if(pLevel[playerid] < 20){
pLevel[playerid]++;
}
pXP[playerid] = 0;
pKills[playerid] = 0;
}
}
}
return 1;
}
CMD:stats(playerid)
{
new str[128];
format(str, 128, \"Szint: %d | Ölések: %d | XP: %d\", pLevel[playerid],pKills[playerid],pXP[playerid]);
SendClientMessage(playerid, -1, str);
return 1;
}
stock pFile(playerid)
{
new f[64], n[MAX_PLAYER_NAME];
GetPlayerName(playerid, n, MAX_PLAYER_NAME);
format(f, 64, \"%s.ini\", n);
return f;
}
A pawn tag kicsit eltolt néhány sort, azt majd javítsd, és valószínûleg menni fog.
/stats paranccsal ellenõrizheted a jelenlegi szinted, ölésed, és XP-d.