check ingame accounts in scriptfiles - 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: check ingame accounts in scriptfiles (
/showthread.php?tid=199933)
check ingame accounts in scriptfiles -
ombre - 17.12.2010
Hello,
I would like a command to check the accounts in the scripfiles.
I have this code:
Код:
stock Check()
{
new string[126];
format(string, sizeof(string), "Test_Test.ini");
if(fexist(string))
{
new File: UserFile = fopen(string, io_read);
if ( UserFile )
{
new key[ 126 ] , val[ 126 ];
new Data[ 126 ];
while ( fread( UserFile , Data , sizeof( Data ) ) )
{
key = ini_GetKey( Data );
if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data );printf("Level %s", val);}
if( strcmp( key , "Respect" , true ) == 0 ) { val = ini_GetValue( Data ); printf("Respect %s", val);}
}
fclose(UserFile);//
}
}
return true;
}
This code work perfectly, but I would like to check everything accounts, so string = any specific name just, if in scriptfiles there are "_" in a .ini, this account is checked.
Thanks you for to help me.
Re: check ingame accounts in scriptfiles -
Steven82 - 17.12.2010
pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s.ini", name);
Add the top two, and replace your format code with mine and test it, it should work.
Re : check ingame accounts in scriptfiles -
ombre - 17.12.2010
no, it work just for my name.
If I /check , it check some accounts. For not to exploit all the resource of the server. If i /check everything the accounts which begins by A will be checked. A..._...ini
Example in scriptfiles there are:
A1_B1.ini
A2_B6.ini
B2_B3.ini
Here, just A1_B1 A2_B6 are checked
My question, how to make that?
Код:
if(strcmp(cmd, "/check", true) == 0)
{
if(IsPlayerConnected(playerid))
{
Check();
}
return 1;
}
Re : check ingame accounts in scriptfiles -
ombre - 18.12.2010
up tx.