/removeacc
#1

I want to create a /removeacc Or /deleteacc for admins that delete the account from it's data base, the game mode is Larp god father edit admin system.
Reply
#2

pawn Код:
if(!strcmp(cmd, "/deletefile", true))
    {
        if(PlayerInfo[playerid][pAdmin] >= 5)
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /deletefile [file] File = Path + File + File end(ex - .txt)");
            if(!fexist(tmp)) return SendClientMessage(playerid, COLOR_RED, "This file doesn't exist!");
            new stringgg[256];
            new File:file = fopen(tmp, io_read);
            format(str, sizeof str, "%s_backup.back", tmp);
            new File:backup = fopen(str, io_write);
            while(fread(file, stringgg))
            {
                format(stringgg, sizeof stringgg, "%s\n", string);
                fwrite(backup, stringgg);
            }
            fclose(file);
            fremove(tmp);
            fclose(backup);
            new stringg[100];
            format(stringg, sizeof stringg, "%s was deleted! The file %s was created as a backup in the same folder.", tmp, str);
            SendClientMessage(playerid, COLOR_YELLOW, stringg);
        }
    }
Try it, i didn't test it yet.
Reply
#3

Are you using a mysql plugin? An ini system? The default file system? Give more info.
Reply
#4

Quote:
Originally Posted by Dripac
Посмотреть сообщение
pawn Код:
if(!strcmp(cmd, "/deletefile", true))
    {
        if(PlayerInfo[playerid][pAdmin] >= 5)
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /deletefile [file] File = Path + File + File end(ex - .txt)");
            if(!fexist(tmp)) return SendClientMessage(playerid, COLOR_RED, "This file doesn't exist!");
            new stringgg[256];
            new File:file = fopen(tmp, io_read);
            format(str, sizeof str, "%s_backup.back", tmp);
            new File:backup = fopen(str, io_write);
            while(fread(file, stringgg))
            {
                format(stringgg, sizeof stringgg, "%s\n", string);
                fwrite(backup, stringgg);
            }
            fclose(file);
            fremove(tmp);
            fclose(backup);
            new stringg[100];
            format(stringg, sizeof stringg, "%s was deleted! The file %s was created as a backup in the same folder.", tmp, str);
            SendClientMessage(playerid, COLOR_YELLOW, stringg);
        }
    }
Try it, i didn't test it yet.
Код:
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(25874) : error 017: undefined symbol "str"
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(25874) : error 017: undefined symbol "str"
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(25875) : error 017: undefined symbol "str"
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(25885) : error 017: undefined symbol "str"
EDIT: nvm i fixed it but i really dont understand how it fully works, If i want to delete the account i need to type the full path of where the player's file is located ? I wanted to make it more like /deleteacc [Player_Name] And it locates this name from the script files and removes it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)