Need help wanted level save
#1

I need a code there save players wanted level so if they relog so there wanted level are the same
Reply
#2

Which system you use for saving player stats? MySQL or SQLite or ini ?
Reply
#3

Im use ini...
Reply
#4

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
    
WantedMAX_PLAYERS ]
;
public 
OnPlayerConnect(playerid)
{
    
Wanted[playerid] = 0;
     
INI_ParseFileuser_ini_fileplayerid ), "load_wanted_%s", .bExtra true, .extra playerid );
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    new 
INI:File INI_Openuser_ini_fileplayerid ) );
        
INI_SetTagFile"Player Wanted Level" );
        
INI_WriteIntFile"WantedLevel"GetPlayerWantedLevel(playerid));
        
INI_CloseFile );
    return 
1;
}
stock user_ini_file(playerid)
{
    new
        
string128 ],
        
user_nameMAX_PLAYER_NAME ]
    ;
    
GetPlayerNameplayeriduser_nameMAX_PLAYER_NAME );
    
formatstringsizeof ( string ), "%s.ini"user_name );
    
/* scriptfiles directory */
    
return
        
string;
}
public 
OnPlayerSpawn(playerid)
{
SetPlayerWantedLevel(playeridWanted[playerid]);
    return 
1;
}
forward @load_wanted_levelplayeridname[], value[] );
@
load_wanted_levelplayeridname[], value[] )
{
    
INI_Int"WantedLevel"Wantedplayerid ] );
    return ( 
);

Reply
#5

Where can i download ini.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)