Help needed with a Premium filterscript
#1

Hello! I have made a Premium filterscript that allow some people to have more in-game benefits.

HERE IS MY FULL CODE: CODE

Well i think that in my code he checks if in the USERNAME.ini file into the Admins and Premium folder there is a 1 or 0 written in it and when a player connect he automatically understand if is a Premium, an Admin or a normal user.

Well, I think also that in No way he automatically save the USERNAME.ini file in any way when someone connect and automatically set the variable to 0 (normal user) and then save the ini file with like "Jim.ini --> 0"


I've also made a custom txt system where Premium, Admins and Normal users have different colors to avoid to misunderstood what a person is or not, so I'll to keep it like this.


The problem is as right now the filterscript make the whole server crash (and i think is cause the matter up above)

Any help?


I would appreciate also if there is a way (OBV while admin) to set a premium user and admin like /makepremium and /makeadmin so in each cases it change the variable to 1 when the RCON Admin command that strings.


(If it possible) It's great if they use /buypremium to open a browser page where there is the payment form


A big hug to who can help me out on this
Reply
#2

Код:
stock GetPremium(playerid)
{
    new name[64];
    GetPlayerName(playerid, name, sizeof name);
    format(name, sizeof name, "%d.ini", name);

    new File:file = fopen("Premium/users/%d.ini", io_read), line[128];
    while(fread(file, line))
    {
        new first = strfind(line, "=", true);
        if(strcmp(line, "admin_level", true, first) == 0) //this line same as get admin level, It should be premium_level ?
        {
            new value[32];
            strmid(value, line, first + 1, strlen(line));
            return strval(value);
        }
    }
    return 0;
}
Maybe this?

pawn Код:
stock GetPremium(playerid)
{
    new name[64];
    GetPlayerName(playerid, name, sizeof name);
    format(name, sizeof name, "%d.ini", name);

    new File:file = fopen("Premium/users/%d.ini", io_read), line[128];
    while(fread(file, line))
    {
        new first = strfind(line, "=", true);
        if(strcmp(line, "premium_level", true, first) == 0)
        {
            new value[32];
            strmid(value, line, first + 1, strlen(line));
            return strval(value);
        }
    }
    return 0;
}
Reply
#3

Quote:
Originally Posted by MasonSFW
Посмотреть сообщение
pawn Код:
stock GetPremium(playerid)
{
    new name[64];
    GetPlayerName(playerid, name, sizeof name);
    format(name, sizeof name, "%d.ini", name);

    new File:file = fopen("Premium/users/%d.ini", io_read), line[128];
    while(fread(file, line))
    {
        new first = strfind(line, "=", true);
        if(strcmp(line, "admin_level", true, first) == 0) //this line same as get admin level, It should be premium_level ?
        {
            new value[32];
            strmid(value, line, first + 1, strlen(line));
            return strval(value);
        }
    }
    return 0;
}
Yep sry missed to edit that

But still the problems persist. Also when a user log his .ini will not be cretaed..
Reply
#4

Did you have login/register system ? You should save player account to Premium -> users -> player account file .ini
Reply
#5

Quote:
Originally Posted by MasonSFW
Посмотреть сообщение
Did you have login/register system ? You should save player account to Premium -> users -> player account file .ini
Yes i have it but i havent the code
Reply
#6

Uuuuup
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)