Not registered save problem
#1

Hello guys, I use YSI register/login system. I wanted to make with application (recourse) to the recording section. But, The player login and quit He records his notebook.
Sorry, I little speak English.
https://sampforum.blast.hk/showthread.php?tid=273088
Reply
#2

check this in includes
PHP код:
#include <YSI\y_ini>  //If you have installed YSI, then you shouldn't have any problem 
Add this to your defines
PHP код:
#define                     UserPath                        "changeme0/%s.ini"
#define                   COLOR_GREEN                 0x33CC33C8 
Add changeme0 to your Scriptefiles

PHP код:
stock SavePlayerData(playerid)
{
        new 
INI:file INI_Open(Path(playerid));
        
INI_SetTag(file,"Player's Data");
        
INI_WriteInt(file,"chnageme1",pInfo[playerid][chnageme1]);
        
INI_WriteInt(file,"chnageme2",pInfo[playerid][chnageme2]);
        
INI_WriteInt(file,"chnageme3",pInfo[playerid][chnageme3]);
        
INI_WriteInt(file,"chnageme4",pInfo[playerid][chnageme4]);
        
INI_WriteInt(file,"chnageme5",pInfo[playerid][chnageme5]);
        
INI_Close(file);
        return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
        
SavePlayerData(playerid);
        return 
1;

you can Add this command allow to a player to save his datas
PHP код:
CMD:ss(playeridparams[])
{
    new    
string[130] ;
    
format(stringsizeof string"* Your stats saved to your database"pName(playerid));
    
SendClientMessage(playeridCOLOR_GREENstring);
    
    if(
User[playerid][accountLogged] == true)
    {
        
SavePlayerData(playerid);
    }
    return 
1;

Reply
#3

Not working...
Still it continues.
Reply
#4

Send EROOR logs
Reply
#5

The player login and quit He records his notebook.
Reply
#6

yes
SO we have to write his data when he leave
*So we have to use
1- Check this in the defines
Plase don't Forget this in the Top
PHP код:
#define                     UserPath                        "Data/%s.ini" 
2-Add this to ur OnPlayerDisconnect
PHP код:
public OnPlayerDisconnect(playeridreason
//if(User[playerid][accountLogged] == true) *if u want don't add this
    //{ *if u want don't add this
        
new INI:file INI_Open(Path(playerid));
        
INI_SetTag(file,"Player's Data");
        
INI_WriteInt(File,"Password",udb_hash(inputtext));
        
INI_WriteInt(File,"Cash",pInfo[playerid][Cash]);
        
INI_WriteInt(File,"Admin",pInfo[playerid][Admin]);
        
INI_WriteInt(File,"Kills",pInfo[playerid][Kills]);
        
INI_WriteInt(File,"Deaths",pInfo[playerid][Deaths]);
        
INI_Close(File);
    
//} *if u want don't add this
    
return 1;

3-complie

4- Create A file named Data in ur Scriptefiles , in the DAta file u can found the %s.ini (%s=playername) datas
Reply
#7

Quote:
Originally Posted by AlexandreAymanito
Посмотреть сообщение
yes
SO we have to write his data when he leave
*So we have to use
1- Check this in the defines
Plase don't Forget this in the Top
PHP код:
#define                     UserPath                        "Data/%s.ini" 
2-Add this to ur OnPlayerDisconnect
PHP код:
public OnPlayerDisconnect(playeridreason
//if(User[playerid][accountLogged] == true) *if u want don't add this
    //{ *if u want don't add this
        
new INI:file INI_Open(Path(playerid));
        
INI_SetTag(file,"Player's Data");
        
INI_WriteInt(File,"Password",udb_hash(inputtext));
        
INI_WriteInt(File,"Cash",pInfo[playerid][Cash]);
        
INI_WriteInt(File,"Admin",pInfo[playerid][Admin]);
        
INI_WriteInt(File,"Kills",pInfo[playerid][Kills]);
        
INI_WriteInt(File,"Deaths",pInfo[playerid][Deaths]);
        
INI_Close(File);
    
//} *if u want don't add this
    
return 1;

3-complie

4- Create A file named Data in ur Scriptefiles , in the DAta file u can found the %s.ini (%s=playername) datas
//if(User[playerid][accountLogged] == true) *if u want don't add this
//{ *if u want don't add this
You better dam use it, if someone goes to your account, logs off with no variables set it will reset everything.
Reply
#8

Bro i mean maybe he don't use
if(User[playerid][accountLogged] == true)
maybe he use anther formule mean if the player logged in
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)