Save warned times for player in file via y-ini - 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)
+--- Thread: Save warned times for player in file via y-ini (
/showthread.php?tid=553682)
Save warned times for player in file via y-ini -
dan40o - 30.12.2014
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);
Re: Save warned times for player in file via y-ini -
Facerafter - 30.12.2014
nvm.
Re: Save warned times for player in file via y-ini -
Cameltoe - 31.12.2014
Try this:
pawn Код:
INI_WriteInt(File, "Warns", WarnTimes[playerid]);
Re: Save warned times for player in file via y-ini -
dan40o - 31.12.2014
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.
Re: Save warned times for player in file via y-ini -
dan40o - 31.12.2014
You are right. My bad.
Re: Save warned times for player in file via y-ini -
dan40o - 31.12.2014
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;
}
Re: Save warned times for player in file via y-ini -
dan40o - 01.01.2015
Solved. Thanks.