HELP CRASH
#1

hi
when i try to register a new account it doesn't work need help


PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    new 
LoginText[600],year,month,day,h,m,s,RegDate[40];
    new 
file[255],str2[200],str[200];
    new 
rrand =random(100);
    new 
string[128];
    
    if(
dialogid == INTRO)
    {    
        if(
response)
        {
            
format(LoginText,sizeof(LoginText),"{FFFFFF}Welcome %s\n\nPlease Register Your Account",GetName(playerid));
            
ShowPlayerDialog(playerid,RegisterPlayer,DIALOG_STYLE_INPUT,"Register",LoginText,"{00FF00}Register","{FF0000}Exit");
        }
    }
//REGISTER DIALOG
    
if(dialogid == RegisterPlayer)
    {
        if(!
response)
        {    
            
            
format(str,200,"[SERVER] Player %s Has Been Kicked [Reason: Register Fail]",GetName(playerid));
            
Anounce(str);
            
LogTo("KickLog",str);
            
SetTimerEx("KickPlayer",1000,false,"d",playerid);
        }
        if(
response)
        {
            if(
fexist(file))
                {
                    
SendClientMessage(playerid,COLOR_ERROR,"This account already exists, please choose a different player name.");
                return 
1;
                }
            if(
strlen(inputtext) < 4)
            {
                return 
ShowPlayerDialog(playerid,RegisterPlayer,DIALOG_STYLE_INPUT,"Register","{BF2A41}Your Password Must Be More Than 4 Caracters\n{BF2A41}Please Register Your Account \n","{00FF00}Register","{FF0000}Exit");
            }
                
                if(!
fexist(file))
                {
                    
format(file,sizeof(file),AccFilesGetName(playerid));
                    
dini_Create(file);
                    
getdate(yearmonthday);
                    
gettime(h,m,s);
                    
format(RegDatesizeof(RegDate), "%d/%d/%d [%dh:%d:%d]",day,month,year,h,m,s);
                    
format(pInfo[playerid][IP], 500PlayerIp(playerid));
                    
                    
dini_Set(file,"Name",GetName(playerid));
                    
dini_IntSet(file"Password"udb_hash(inputtext));
                    
dini_Set(file"Ppass"inputtext);
                    
dini_Set(file,"RegisterDate"RegDate);
                    
dini_Set(file"IP"pInfo[playerid][IP]);
                    
dini_IntSet(file"Banned"0);
                    
dini_IntSet(file"Warnings"0);
                    
dini_IntSet(file"Score"0);
                    
dini_IntSet(file"Money"2500);
                    
dini_IntSet(file"Bank"5000);
                    
dini_IntSet(file"AdminLevel"0);
                    
dini_IntSet(file"VipLevel"0);
                    
dini_IntSet(file"RobSkill"0);
                    
dini_IntSet(file"TerSkill"0);
                    
dini_IntSet(file"RapeSkill"0);
                    
dini_IntSet(file"WantedLevel"0);
                    
dini_IntSet(file"Jail"0);
                    
dini_IntSet(file"JailTime"0);
                    
dini_IntSet(file"OwnCar"0);
                    
dini_IntSet(file"Bomb"pInfo[playerid][Bomb]);
                    
dini_IntSet(file"Rank"0);
                    
dini_IntSet(file"Gang-Z"0);
                    
dini_IntSet(file"Muted"pInfo[playerid][Muted]);
                    
dini_IntSet(file"HasHit"pInfo[playerid][HasHit]);
                    
dini_IntSet(file"HitMoney"pInfo[playerid][HitMoney]);
                    
dini_Set(file"LastON""NEVER");
                    
                    
pInfo[playerid][Registered] = 1;
                    
                    
format(LoginText,sizeof(LoginText),"[SERVER]{EA302E}You Are Now Registered %s.\n\n{452AC9}Please Login To Your Account",GetName(playerid));
                    
SendClientMessage(playeridSERVER_COLORLoginText);
                    
ShowPlayerDialog(playeridLoginPlayerDIALOG_STYLE_PASSWORD"LOGIN:"LoginText"{00FF00}Login""{FF0000}Exit");/**/
                    
GameTextForPlayer(playerid"~r~Registered!"30001);
                    
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
                    
printf(" ");
                    
printf("\nNew Account pNAME : %s // pPASS : %s // IP : %s\n",GetName(playerid),inputtext,pInfo[playerid][IP]);
                    
printf(" ");
                }
                
        }
    
    }    
//LOGIN DIALOG
    
if(dialogid == LoginPlayer)
    {
        if(!
response)
        {    
            
            
format(str2,200,"[SERVER] Player %s Has Been Kicked [Reason: Login Fail]",GetName(playerid));
            
Anounce(str2);
            
LogTo("KickLog",str2);
            
nosave[playerid] = 1;
            
SetTimerEx("KickPlayer",1000,false,"d",playerid);
        }
        
        if(
strlen(inputtext) == 0
        return 
ShowPlayerDialog(playeridLoginPlayerDIALOG_STYLE_PASSWORD"LOGIN:""{FF0000}ERROR\n\n{452AC9}Please Enter Your Password To Login""{00FF00}Login""{FF0000}Exit");
        
        
format(file,sizeof(file),AccFilesGetName(playerid));
          if(
udb_hash(inputtext) != dini_Int(file"Password")) return ShowPlayerDialog(playeridLoginPlayerDIALOG_STYLE_PASSWORD"LOGIN:""{FF0000}ERROR\nInvalid Password\n{452AC9}Please Enter Your Password To Login""{00FF00}Login""{FF0000}Exit");
        if(
response)
        {
        
            
pInfo[playerid][Registered] = 1;
            
pInfo[playerid][Spawned] = 0;
            
pInfo[playerid][Logged] = 1;
        
//DATA GET START
            
format(pInfo[playerid][IP], 500PlayerIp(playerid));
            
dini_Set(file"IP"pInfo[playerid][IP]);
            
pInfo[playerid][Banned] = dini_Int(file"Banned"); 
            
pInfo[playerid][Warnings] = dini_Int(file"Warnings");
            
pInfo[playerid][Score] = dini_Int(file"Score");
            
pInfo[playerid][Money] = dini_Int(file"Money");
            
pInfo[playerid][Bank] = dini_Int(file"Bank"); 
            
pInfo[playerid][AdminLevel] = dini_Int(file"AdminLevel");
            
pInfo[playerid][VipLevel] = dini_Int(file"VipLevel");
            
pInfo[playerid][RobSkill] = dini_Int(file"RobSkill");
            
pInfo[playerid][TerSkill] = dini_Int(file"TerSkill");
            
pInfo[playerid][RapeSkill] = dini_Int(file"RapeSkill");
            
pInfo[playerid][Wanted] = dini_Int(file"WantedLevel");
            
pInfo[playerid][Jailed] = dini_Int(file"Jail");
            
pInfo[playerid][JailTime] = dini_Int(file"JailTime");
            
pInfo[playerid][OwnCar] = dini_Int(file"OwnCar");
            
//bomb>>allready define
            
pInfo[playerid][Rank] = dini_Int(file"Rank");
            
pInfo[playerid][GangZ] = dini_Int(file,"Gang-Z");
            
pInfo[playerid][Muted] = dini_Int(file"Muted");
            
pInfo[playerid][LastON] = dini_Int(file"LastON");
            
pInfo[playerid][HitMoney] = dini_Int(file"HitMoney");
            
pInfo[playerid][HasHit] = dini_Int(file"HasHit");
        
//DATA GET END
            
            
            
SetPlayerMoney(playerid,pInfo[playerid][Money]);
            
SetPlayerScore(playeridpInfo[playerid][Score]);
            
SetPlayerWantedLevel(playeridpInfo[playerid][Wanted]);
            
            
GameTextForPlayer(playerid"~g~Logged In!"30001);
            
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
        }
    }
    return 
1;

Reply
#2

Use this and show logs again
https://github.com/Zeex/samp-plugin-...ith-debug-info
Reply
#3



Reply
#4

Show line 3579
Reply
#5

Reply
#6

2000 is MAX_VEHICLES and 999 is for MAX_PLAYERS so you are using some array wrong its not this format
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)