Save warned times for player in file via y-ini
#1

I wanna save the warned times for each player.

I have this code:
On The Top
Код:
new WarnTimes[MAX_PLAYERS];
This is in enum:
WarnedTimes
Код:
public LoadUser_data(playerid, name[], value[])
{
	INI_Int("Warns", PlayerInfo[playerid][WarnedTimes]);
	return 1;
}
OnPlayerDisconnect:
Код:
INI_WriteInt(File, "Warns", PlayerInfo[playerid][WarnTimes[playerid]]);      <==== Tag Mismatch.
When Player Regiser his acc:
Код:
INI_WriteInt(File, "Warns", 0);
Reply
#2

nvm.
Reply
#3

Try this:

pawn Код:
INI_WriteInt(File, "Warns", WarnTimes[playerid]);
Reply
#4

This variable is for the command /warn new WarnTimes[MAX_PLAYERS]; To save for each player warn times.

I made a new variable WarnedTimes in the enum. I was trying to get the warnings from WarnedTimes[playerid] and to save them in WarnedTimes.

It doesn't work.

INI_WriteInt(File, "Warns", WarnTimes[playerid]); ===> When i restart the server warned times are 0.
Reply
#5

You are right. My bad.
Reply
#6

I get this error: error 033: array must be indexed (variable "WarnTimes")

Line: public LoadUser_data(playerid, name[], value[])
{
INI_Int("Warns", PlayerInfo[playerid][WarnTimes]); ====> Bad line.
return 1;
}
Reply
#7

Solved. Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)