Changing value in a file
#1

Hello everybody. I need help because i have no idea how to do that. I have registration and login system for players. I know how to read and write to the file, but i don't know how to change value of something. For example when player die to change fatals=0 to fatals=1. I am talking about number of deaths of player and my file is like ..sc/NICK.cfg
Can anybody help me with that ? Thanks
Reply
#2

Could you show us the enum,please?
Reply
#3

Do you use Y_INI?
if so
PHP код:
//I Rather use those.
PlayerInfo[playerid][pDeath] = PlayerInfo[playerid][pDeath]+1;
PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills]+1;
//OR, as in default.
PlayerInfo[killerid][pKills]++;
PlayerInfo[playerid][pDeaths]++; 
EDIT: You know, changing values in general..
PHP код:
PlayerInfo[playerid][pDeaths] =0//SETS IT TO 0.
PlayerInfo[playerid][pDeath] = PlayerInfo[playerid][pDeath]-1//Minus 1. If 10, it's gonna be 9 
Like that
Reply
#4

Enum:
Код:
enum INFO_NAME
{
	Fatals
}
Reply
#5

just copy paste the stuff I posted, and instead of pDeaths and pKills, do Fatals.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)