Y-Ini copying players data
#1

Hello i have this issue with y-ini

when i register a new player account it will automaticly copys the data from a registered account

i am using this script:\
https://sampforum.blast.hk/showthread.php?tid=273088
Reply
#2

you must reset some variable = 0; well read again the tutoriel
Reply
#3

Quote:
Originally Posted by Azula
Посмотреть сообщение
you must reset some variable = 0; well read again the tutoriel
resetting scores, play time and money?

that will set everything to 0
Reply
#4

Quote:
Originally Posted by SalmaN97
Посмотреть сообщение
resetting scores, play time and money?

that will set everything to 0
No, write the data to the file as normal, then reset the variables, e.g. PlayerInfo[playerid][pAdmin] = 0; - under OnPlayerDisconnect.

Make sure the variable clearance is after the saving code.
Reply
#5

you can just see the topic
Quote:
Originally Posted by JuanStone
Посмотреть сообщение
I see nothing about reset variables, that might be the problem, do it and perhaps already don't have more problems with this.
PHP код:
public OnPlayerConnect(playerid)
{
    new 
name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnamesizeof(name));
    
//..
    
if(fexist(Path(playerid)))
    {
        
INI_ParseFile(Path(playerid),"loadaccount_user", .bExtra true, .extra playerid)
        
//..
        
if(pInfo[playerid][Banned] == || pInfo[playerid][oBanned] == 1)
        {
            
SendClientMessage(playerid,COLOR_RED,"[INFO] Your account is currently suspended from this server");
            
SetTimerEx("DelayedKick"500false"d"playerid);
        }
        else 
ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT"Mickey's: Simply TDM""This account is registered,\nplease insert your password below""Login""Exit");
    }
    else if(!
fexist(Path(playerid)))
    {
        
pInfo[playerid][Adminlevel] = 0;
        
pInfo[playerid][VIPlevel] = 0;
        
// restart all variables per player..
        
ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_INPUT,"Mickey's: Simply TDM","Welcome, this username is available!\nEnter a password below to register it","Register""Exit");
    }
    return 
true;

//by JuanStone
Reply
#6

Quote:
Originally Posted by Azula
Посмотреть сообщение
you can just see the topic


PHP код:
public OnPlayerConnect(playerid)
{
    new 
name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnamesizeof(name));
    
//..
    
if(fexist(Path(playerid)))
    {
        
INI_ParseFile(Path(playerid),"loadaccount_user", .bExtra true, .extra playerid)
        
//..
        
if(pInfo[playerid][Banned] == || pInfo[playerid][oBanned] == 1)
        {
            
SendClientMessage(playerid,COLOR_RED,"[INFO] Your account is currently suspended from this server");
            
SetTimerEx("DelayedKick"500false"d"playerid);
        }
        else 
ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT"Mickey's: Simply TDM""This account is registered,\nplease insert your password below""Login""Exit");
    }
    else if(!
fexist(Path(playerid)))
    {
        
pInfo[playerid][Adminlevel] = 0;
        
pInfo[playerid][VIPlevel] = 0;
        
// restart all variables per player..
        
ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_INPUT,"Mickey's: Simply TDM","Welcome, this username is available!\nEnter a password below to register it","Register""Exit");
    }
    return 
true;

//by JuanStone
thank you man
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)