little dini help please (solved) - 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: little dini help please (solved) (
/showthread.php?tid=146422)
little dini help please (solved) -
iggy1 - 07.05.2010
right i have this code (it executes when a player anters an area)
Код:
GetPlayerName(playerid,Fname,MAX_PLAYER_NAME);
format(Wfile,sizeof(Wfile),"%s.ini ",Fname);
if(!dini_Exists(Wfile))
{
dini_Create(Wfile);
dini_IntSet(Wfile, "kills",0);
dini_IntSet(Wfile, "deaths",0);
}
else
{
return 1;
}
I cant figure out how to increase the amount of kills written in the Wfile when a player kills somone.
I know it should go in OnPlayerDeath but can someone show me how to specify which player to increase the points. hope u know what i mean
many thanks in advance
Re: little dini help please -
Geso - 07.05.2010
under onplayerdeath:
Код:
GetPlayerName(killerid,Kname,MAX_PLAYER_NAME);
format(Wfile,sizeof(Wfile),"%s.ini ",Kname);
new oldkills = dini_Int(Wfile, "kills");
newkills = oldkills+1;
dini_IntSet(Wfile, "kills",newkills);
Something like this?, not sure this works though, dont have pawno here to try..
Re: little dini help please -
iggy1 - 07.05.2010
thanks but i mean how to make just the killerid's variable increase.
EDIT: something like
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
dini_IntSet(Wfile, "kills",+1); //but only for killerid
return 1;
}
Re: little dini help please -
Geso - 07.05.2010
this does practically the same, just a few more lines used..
Re: little dini help please -
iggy1 - 07.05.2010
thanks this helped