How to script a money save like new SavedWantedLevel[MAX_PLAYERS]?? - 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: How to script a money save like new SavedWantedLevel[MAX_PLAYERS]?? (
/showthread.php?tid=355356)
How to script a money save like new SavedWantedLevel[MAX_PLAYERS]?? -
UserName31 - 29.06.2012
hey i need help how to scrip new Save money like = SavedWantedLevel[MAX_PLAYERS]
really simple please help
Re: How to script a money save like new SavedWantedLevel[MAX_PLAYERS]?? -
Cxnnor - 29.06.2012
At the top of your script, below defines put this.
pawn Код:
enum pInfo
{
pWanted(playerid)(pWanted);
}
new PlayerInfo[MAX_PLAYERS][pInfo];
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Wanted",PlayerInfo[playerid][pWanted]);
return 1;
}
Under OnPlayerDisconnect
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Wanted",PlayerInfo[playerid][pWanted]);
INI_Close(File);
return 1;
}
Re: How to script a money save like new SavedWantedLevel[MAX_PLAYERS]?? -
UserName31 - 29.06.2012
i mean for money not wanted
Re: How to script a money save like new SavedWantedLevel[MAX_PLAYERS]?? -
Cxnnor - 29.06.2012
Quote:
Originally Posted by UserName31
i mean for money not wanted
|
Top of your script.
pawn Код:
enum pInfo
{
pCash(playerid)(pCash);
}
new PlayerInfo[MAX_PLAYERS][pInfo];
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Cash",PlayerInfo[playerid][pCash]);
return 1;
}
Under OnPlayerDisconnect
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",PlayerInfo[playerid][pCash]);
INI_Close(File);
return 1;
}