Delete Account INGAME.
#1

Well, I made a command to delete accounts INGAME
pawn Код:
CMD:borrarcuenta(playerid, params[]){
if(PlayerInfo[playerid][Level] >= 8 || IsPlayerAdmin(playerid)) {
      new tmp[256], Index;        tmp = strtok(params,Index);
      if(!strlen(params)) return SendClientMessage(playerid,red,"* Use: /borrarcuenta <Name>");
      new nombre[MAX_PLAYER_NAME],nickname[256];
      nickname = tmp;
      if(udb_Exists(nickname)){
      format(file,sizeof(file),"/ladmin/users/%s.sav",nombre);
      format(string2,sizeof(string2),"* You have deleted the account: %s.",nickname);
      SendClientMessage(playerid,yellow,string2);
      udb_Remove(file);
      return 1;
     } else return SendClientMessage(playerid,red,"* The nick place, Our Partner is not among users.");
    } else return Erroneo(playerid);
}
But nesesito ladmin function to delete the example put udb_Remove But no use xd.
Reply
#2

pawn Код:
new pName[MAX_PLAYER_NAME], str[50];
GetPlayerName(playerid, pName, sizeof pName);
format(str, sizeof str, "%s.ini", pName);
fremove(str);
Above is an example of Y_INI

and :

pawn Код:
if(strcmp(cmd, "/delete", true) == 0)
{
new file;
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), "/vehicles/%s.ini", udb_encode(name));
if(dini_Exists(file))
{
dini_Remove(file);
}
return 1;
}
These are just examples, so try this ones :P
Reply
#3

I would not delete accounts, just in case, move it to another folder to be able to restore.
Reply
#4

Quote:
Originally Posted by Diorturato
Посмотреть сообщение
I would not delete accounts, just in case, move it to another folder to be able to restore.
Sorry, i dont think that function is available in any INI processor yet. Unless Y_INI maybe got it. I haven't heard of a such feature. Sorry.

But you can rename the file to [BACKUP]%s incase you need it for later use. (where %s should be the Getplayername)

So, then make a command like /recover "username"

and then read and find the file with strcmp with "bla/bla/[BACKUP]%s"

Good luck!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)