check ingame accounts in scriptfiles
#1

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.
Reply
#2

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.
Reply
#3

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;
    }
Reply
#4

up tx.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)