SA-MP Forums Archive
V-Admin Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: V-Admin Problem (/showthread.php?tid=86206)



V-Admin Problem - Smokes - 12.07.2009

im using V-Admin in my script but theres one problem if i register for example as "Smokes" it will say account created...buh i can register again and again and again with the same name, i want it to say something like this account has been registered already do /login buh where do i write this, i think its callback buh im really not sure as i dont normally make admin scripts and i dont wanna change ma admin script cause i like this one...reply plz...i know this is easy i just dont know how.


Re: V-Admin Problem - MenaceX^ - 12.07.2009

Does it check the account existant?


Re: V-Admin Problem - Smokes - 12.07.2009

its supposed to check users/(the players)inc in scriptfiles, i checked if it was in the script to do that and it is


Re: V-Admin Problem - [GF]sIdEkIcK - 12.07.2009

lol ye this exact thing happened to me... i cudnt fix it either


Re: V-Admin Problem - MenaceX^ - 12.07.2009

Show the code where it should check if the player is registered or not.


Re: V-Admin Problem - Smokes - 12.07.2009

Quote:

fclose(UserFile);//close the file after everything has been read in the while
gPlayerLogged[playerid] = 1;
}
}
}
else
{
gPlayerAccount[playerid] = 1;
format(string, sizeof(string), "Welcome back %s ! Please use /login [password]", playrname);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
gPlayerLogged[playerid] = 0;
return 1;
}
}
else
{
gPlayerAccount[playerid] = 0;
format(string, sizeof(string),"Account %s may not exsits. Please use /register [password]", playrname);
SendClientMessage(playerid, COLOR_LIGHTBLUE,string);
gPlayerLogged[playerid] = 0;
return 1;
}
#endif
return 1;
}

Even if im registered, it comes up with the Account may not exist.Please use /register <password>



Re: V-Admin Problem - MenaceX^ - 12.07.2009

Give the code above it. Where it checks the character existant. (fopen, fread etc)


Re: V-Admin Problem - Smokes - 12.07.2009

Quote:

#if AUTO_LOGIN_ENABLED
new tmp[50],tmp2[256]; GetPlayerIp(playerid,tmp,50); tmp2 = dini_Get(connect,"IP");
if(!strcmp(tmp,tmp2,true))
{
format(string, sizeof(string), "Welcome back %s ! You have been automatically logged in by your IP. ", playrname);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
gPlayerLogged[playerid] = 1;
new playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername2, sizeof(playername2));
format(string2, sizeof(string2), "V-Admin/Users/%s.ini", playername2);
new File: UserFile = fopen(string2, io_read);
if ( UserFile )
{
new PassData[256];
new keytmp[256], valtmp[256];
fread( UserFile , PassData , sizeof( PassData ) );
keytmp = ini_GetKey( PassData );
if( strcmp( keytmp , "Password" , true ) == 0 )
{
valtmp = ini_GetValue( PassData );
strmid(PlayerInfo[playerid][pPassword], valtmp, 0, strlen(valtmp)-1, 255);
new key[ 256 ] , val[ 256 ];
new Data[ 256 ];
while ( fread( UserFile , Data , sizeof( Data ) ) )
{
key = ini_GetKey( Data );
if( strcmp( key , "AdminLevel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdmin] = strval( val ); }
if( strcmp( key , "Warnings" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pWarns] = strval( val ); }
if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevel] = strval( val ); }
if( strcmp( key , "Kills" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKills] = strval( val ); }
if( strcmp( key , "Deaths" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDeaths] = strval( val ); }
if( strcmp( key , "Money" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCash] = strval( val ); }
if( strcmp( key , "Bank" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBank] = strval( val ); }
if( strcmp( key , "Skin" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSkin] = strval( val ); }
if( strcmp( key , "TimesConnected" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pTimes] = strval( val ); }
if( strcmp( key , "PlayingHours" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pHours] = strval( val ); }
if( strcmp( key , "PlayingMinutes" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMins] = strval( val ); }
if( strcmp( key , "DayRegistered" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDate1] = strval( val ); }
if( strcmp( key , "MonthRegistered" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDate2] = strval( val ); }
if( strcmp( key , "YearRegistered" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDate3] = strval( val ); }

The code above it is a Auto login feature which i am going to Disable buh here it is, even if its enabled or disabled the problem is still there


Re: V-Admin Problem - MenaceX^ - 12.07.2009

All this code will be working only if auto login is enabled, you should make a different code that checks if the auto login is disabled, to get the information etc.


Re: V-Admin Problem - Smokes - 12.07.2009

im gonna try it and see if i do auto_login what will happen, buh ive tried it before and there was no difference...same problem buh if i try it and i still get the sam problem how can i script what ur talking about