little dini help please (solved)
#1

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

Reply
#2

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..
Reply
#3

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;
}
Reply
#4

this does practically the same, just a few more lines used..
Reply
#5

thanks this helped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)