Delete Account INGAME. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Delete Account INGAME. (
/showthread.php?tid=408172)
Delete Account INGAME. -
SaiB0T - 17.01.2013
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.
Re: Delete Account INGAME. -
denNorske - 17.01.2013
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
Re: Delete Account INGAME. -
Diorturato - 17.01.2013
I would not delete accounts, just in case, move it to another folder to be able to restore.
Re: Delete Account INGAME. -
denNorske - 17.01.2013
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!