Need help wanted level save - 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: Need help wanted level save (
/showthread.php?tid=403807)
Need help wanted level save -
Lynet - 31.12.2012
I need a code there save players wanted level so if they relog so there wanted level are the same
Re: Need help wanted level save -
RedCrossER - 31.12.2012
Which system you use for saving player stats? MySQL or SQLite or ini ?
Re: Need help wanted level save -
Lynet - 31.12.2012
Im use ini...
Re: Need help wanted level save -
ThePhenix - 31.12.2012
PHP код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <YSI\y_ini>
new
Wanted[ MAX_PLAYERS ]
;
public OnPlayerConnect(playerid)
{
Wanted[playerid] = 0;
INI_ParseFile( user_ini_file( playerid ), "load_wanted_%s", .bExtra = true, .extra = playerid );
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open( user_ini_file( playerid ) );
INI_SetTag( File, "Player Wanted Level" );
INI_WriteInt( File, "WantedLevel", GetPlayerWantedLevel(playerid));
INI_Close( File );
return 1;
}
stock user_ini_file(playerid)
{
new
string[ 128 ],
user_name[ MAX_PLAYER_NAME ]
;
GetPlayerName( playerid, user_name, MAX_PLAYER_NAME );
format( string, sizeof ( string ), "%s.ini", user_name );
/* scriptfiles directory */
return
string;
}
public OnPlayerSpawn(playerid)
{
SetPlayerWantedLevel(playerid, Wanted[playerid]);
return 1;
}
forward @load_wanted_level( playerid, name[], value[] );
@load_wanted_level( playerid, name[], value[] )
{
INI_Int( "WantedLevel", Wanted[ playerid ] );
return ( 1 );
}
Re: Need help wanted level save -
Lynet - 01.01.2013
Where can i download ini.