• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] how to load every user.ini in scriptfiles using YINI
#4
Save gang members to a file.
Then load them all name through fread and set them level...

If you do not understand, see this:
Code:
new File: handle = fopen("gang_members.txt", io_read), string[28], nick[24], INI: file;

if(handle)
{
while(fread(handle, nick)) {
? ? ? ? ? ? format(string, 28, "Users/%s.ini", nick);
? ? ? ? ? ? file = INI_Open(string);
? ? ? ? ? ? INI_WriteInt(file, "p_level", 100);
? ? ? ? ? ? INI_Close(file);
? ? ? ? }
fclose(handle);
} else {
print("The file \"gang_members.txt\" does not exists, or can't be opened.");
}

// Notice : The names of the members you have saved in the file 'gang_members.txt' should be the name of each one in a new line

If you use MySQL, you can do this easily with just one query.
Code:
UPDATE `users` SET `level` = `level`  100 WHERE `gangid` = 1
  Reply


Messages In This Thread
RE: how to load every user.ini in scriptfiles using YINI - by Radical - 2021-02-12, 08:57 PM

Forum Jump: