Editing ALL registered users at once.

How do i do that?

Can someone give me an example?

Here's an exmaple of my code.

For example, I want to set all players level to 0.

pawn Код:
new x = 0;
            while(x != MAX_PLAYERS)
            format(string, sizeof(string), "%s.ini",x);
                result[idx - offset] = EOS;
                dini_IntSet(string, "Level", 0);
How do I do it?
+rep for help.

You cant really set every players level to 0 without them being online unless you had a list of all registered players in a file then you could edit all the different files. I would probably just set the players level to 0 when they connect, and have a variable set if they have had their level reset already. If the variable isn't set, then just make it so the players level is set to 0.

I can't do that.

But yeah, all userfiles are saved as %s.cfg in one file ( scriptfiles ofc )

How would i do it mate?

I can't edit 6,500 accounts without cutting my **** off lol

Just make a PHP / C# script / plugin that loops through the files and sets all the levels to 0. You cant really do this in PAWN though.

all i want is to create a strcmp cmd that does this cleanup of all users to lvl 0 when i use it..

If you want to be able to do that, either create a plugin or switch your file system to MySQL / SQLite.

can you give me some examples of what i should put in the plugin itself?

when player connects, if he hasnt updated yet then set level to 0
no need to update them all right away, just as long as they join they get auto fixed

heres a nice idea, I used this 2 years ago.

Get a list of your admins, and use a strcmp check in OnPlayerConnect.

if there an admin, continue, else set there level to 0.

This will save you the pain of this, but bring more code to your script.

Just do this...
pawn Код:
public OnPlayerConnect(playerid)
    new string[32], name[24];
    GetPlayerName(playerid, name, 24);
    format(string,sizeof(string), "%s.ini", name); // You will need to change this to your accounts
    if(dini_Exists(string) && dini_Int(string, "Updated") != 1)
        dini_IntSet(string, "Level", 0);
        dini_IntSet(string, "Updated", 1);
    return 1;
Now, the first time everyone connects, their level will be reset to 0.

Forum Jump:

Users browsing this thread: 1 Guest(s)