Why isnt it saving my kills/deaths - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Why isnt it saving my kills/deaths (
/showthread.php?tid=171094)
Why isnt it saving my kills/deaths -
mrcoolballs - 25.08.2010
when i check the file it says 0 in both of them
Код:
new playerfile[256];
new killerfile[256];
new playername[MAX_PLAYER_NAME];
new killername[MAX_PLAYER_NAME];
PlayerInfo[killerid][Kills]++;
PlayerInfo[playerid][Deaths]++;
GetPlayerName(playerid,playername,sizeof(playername));
GetPlayerName(killerid,killername,sizeof(killername));
format(playerfile,sizeof(playerfile),"NewAdmin/Users/%s.txt",playername);
format(killerfile,sizeof(killerfile),"NewAdmin/Users/%s.txt",killername);
if(dini_Exists(playerfile))
{
dini_IntSet(playerfile,"Deaths",PlayerInfo[playerid][Deaths]);
}
if(dini_Exists(killerfile))
{
dini_IntSet(killerfile,"Kills",PlayerInfo[playerid][Kills]);
}
Re: Why isnt it saving my kills/deaths -
Wrath2k10 - 25.08.2010
Do you have that code under OnPlayerDeath?
I think it doesn't know what PlayerID/KIllerID is
Re: Why isnt it saving my kills/deaths -
mrcoolballs - 25.08.2010
yes it is under onplayerdeath otherwise i would get error messages
Re: Why isnt it saving my kills/deaths -
mrcoolballs - 25.08.2010
bumpidy bump
Re: Why isnt it saving my kills/deaths -
LarzI - 25.08.2010
OS = Windows or Linux?
If it's windows, use this:
pawn Код:
new playerfile[128];
new killerfile[128];
new playername[MAX_PLAYER_NAME];
new killername[MAX_PLAYER_NAME];
PlayerInfo[killerid][Kills]++;
PlayerInfo[playerid][Deaths]++;
GetPlayerName(playerid,playername,sizeof(playername));
GetPlayerName(killerid,killername,sizeof(killername));
format(playerfile,sizeof(playerfile),"\\NewAdmin\\Users\\%s.txt",playername);
format(killerfile,sizeof(killerfile),"\\NewAdmin\\Users\\%s.txt",killername);
if(dini_Exists(playerfile))
{
dini_IntSet(playerfile,"Deaths",PlayerInfo[playerid][Deaths]);
}
if(dini_Exists(killerfile))
{
dini_IntSet(killerfile,"Kills",PlayerInfo[playerid][Kills]);
}
Linux:
pawn Код:
new playerfile[128];
new killerfile[128];
new playername[MAX_PLAYER_NAME];
new killername[MAX_PLAYER_NAME];
PlayerInfo[killerid][Kills]++;
PlayerInfo[playerid][Deaths]++;
GetPlayerName(playerid,playername,sizeof(playername));
GetPlayerName(killerid,killername,sizeof(killername));
format(playerfile,sizeof(playerfile),"/NewAdmin/Users/%s.txt",playername);
format(killerfile,sizeof(killerfile),"/NewAdmin/Users/%s.txt",killername);
if(dini_Exists(playerfile))
{
dini_IntSet(playerfile,"Deaths",PlayerInfo[playerid][Deaths]);
}
if(dini_Exists(killerfile))
{
dini_IntSet(killerfile,"Kills",PlayerInfo[playerid][Kills]);
}
Re: Why isnt it saving my kills/deaths -
mrcoolballs - 25.08.2010
that still didnt work
Re: Why isnt it saving my kills/deaths -
Nekrus2 - 25.08.2010
is killerfile asigned to killerid ?
well i cant see that