Originally Posted by DJDhan
Try returning 1 in both if(userfile) and else if.
And then there is already return 1 outside. |
if (UserFile) 783. { 784. new valtmp[128]; 785. fread(UserFile, valtmp);strmid(PlayerInfo[playerid][pPassword], valtmp, 0, strlen(valtmp)-1, 255); 786. 787. if ((strcmp(PlayerInfo[playerid][pPassword], string, true, strlen(valtmp)-1) == 0)) 788. { 789. new key[128],val[128]; 790. new Data[128]; 791. while(fread(UserFile,Data,sizeof(Data))) 792. { 793. key = ini_GetKey(Data); 794. if( strcmp( key , "Admin" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdmin] = strval( val ); } 795. if( strcmp( key , "Money" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMoney] = strval( val ); } 796. if( strcmp( key , "Team" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pTeam] = strval( val ); } 797. GivePlayerMoney(playerid,PlayerInfo[playerid][pMoney]); 798. } 799. fclose(UserFile); 800. gPlayerLogged[playerid] = 1; 801. gPlayerAccount[playerid] = 1; 802. GetPlayerName(playerid, pname3, sizeof(pname3)); 803. format(string3, sizeof(string3), "You have been successfully logged in"); 804. SendClientMessage(playerid, 0xFFFFFFFF,string3);return 1; 805. } 806. else 807. { 808. SendClientMessage(playerid, 0xC0C0C0FF, " Invalid Password"); 809. fclose(UserFile);return 1;//maybe return 0 810. } 811. } 812. return 1; 813.}