SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 23/06/2019, 06:47 PM   #1
Manuel78
Little Clucker
 
Join Date: Jul 2017
Posts: 8
Reputation: 0
Unhappy Slow processing, can't read files

So yesterday I upgraded my libraries to YSI 4. On login screen I have few SCMF and it takes few seconds to load those(before it was instant). After login if player is admin he gets another input dialog where he has to write admin password(after update I don't get that anymore becuase admin files don't load at all). Admin passwords are saved in different file than user info. OnGameModeInit I have function that reads through admin files but all parameters are 0 when it stores them in variables.

OnGameModeInit I have LoadAdmin();
PHP Code:
stock LoadAdmine()
{
    for(new 
1MAX_ADMINSh++)
    {
        new 
textic[64];
        
format(texticsizeof(textic), "Staff/Admini/Admin_%d.ini",h);
        if(
fexist(textic))
    {
        
INI_ParseFile(textic"LoadAdmin_%s", .bExtra true, .extra h);
    }
    }
    print(
"[UE] Ucitani Administratori.");

And this is everything else

PHP Code:
}
forward LoadAdmin_data(iname[], value[]);
public 
LoadAdmin_data(iname[], value[])
{
    
INI_String("Ime"AdminInfo[i][aIme], MAX_PLAYER_NAME);
    
INI_Int("Rank"AdminInfo[i][aRank]);
    
INI_Int("Neakt"AdminInfo[i][aNeakt]);
    
INI_String("Pas"AdminInfo[i][aPas], 60);
    return 
1;
}

stock ProvjeriAdmina(playerid)
{
    new 
name3[MAX_PLAYER_NAME];
    
GetPlayerName(playeridname3sizeof(name3));
    for(new 
1MAX_ADMINSh++)
    {
        new 
textic[64];
        
format(texticsizeof(textic), "Staff/Admini/Admin_%d.ini",h);
        if(
fexist(textic))
        {
            if(
AdminInfo[h][aRank] > 0)
            {
                if(
strcmp(AdminInfo[h][aIme],name3true) == && PI[playerid][pAdmin] == 0)
                {
                    new 
astring[512];
                    
format(astring,sizeof(astring),"{FF0000}Unesite svoju admin sifru da biste nastavili.");
                    
ShowPlayerDialog(playerid,DIALOG_ASIFRA,DIALOG_STYLE_PASSWORD,"Adminska Sifra",astring,"Ok","Odustani");
                    
admin[playerid] = h;
                    
IgracNaaReconu[playerid] = true;
                }
            }
        }
    }
    return 
1;
}

stock SaveAdmin(i)
{
    new 
textic[64];
    
format(texticsizeof(textic), "Staff/Admini/Admin_%d.ini",i);// j
    
if(fexist(textic))
    {
        new 
INI:File INI_Open(textic);
        
INI_WriteString(File"Ime"AdminInfo[i][aIme]);
        
INI_WriteInt(File"Rank"AdminInfo[i][aRank]);
        
INI_WriteInt(File"Neakt"AdminInfo[i][aNeakt]);
        
INI_WriteString(File"Pas"AdminInfo[i][aPas]);
        
INI_Close(File);
    }
    return 
1;

And this is SCMF

PHP Code:
SCMF(playeridcolourformat[], va_args<>)
{
    new 
out[384];
    
va_format(outsizeof (out), formatva_start<3>);
    
SCM(playeridcolourout);
    return 
1;

Manuel78 is offline   Reply With Quote
Old 25/06/2019, 08:21 AM   #2
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,163
Reputation: 73
Default Re: Slow processing, can't read files

problem is not in SCMF, just revert upgrade and try to re-upgrade correctly, you have missed somethings.
I'm suggesting to use mysql instead of that, or sqlite atleast.
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Old 25/06/2019, 12:42 PM   #3
Manuel78
Little Clucker
 
Join Date: Jul 2017
Posts: 8
Reputation: 0
Default Re: Slow processing, can't read files

I reverted to YSI 3.1(everything works fine) updated and again it doesn't work. I guess I'm just dumb, I'll stick with older version.
Manuel78 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't read from files. f0cus Scripting Help 4 14/03/2015 02:19 PM
[HELP] How to read from files sidney123 Server Support 0 22/01/2012 03:47 PM
How to read ini files? lukas567 Scripting Help 7 23/09/2011 11:41 PM
Read all files Dragony92 Scripting Help 4 13/09/2011 05:23 PM
Help me. read all files Xa0s Help Archive 4 19/01/2011 02:57 PM


All times are GMT. The time now is 06:27 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.