Resetaccount command
#1

I've been posted a few threads lately, but that's because I'm very tired and need help. Help after all is how people extend their knowledge. I would like to know how I can make this /resetaccount command reset a targets account and not my own, thanks.

Plus, when I type it, it's not saving for some reason, I can just log back in with the same information as before.
pawn Код:
CMD:resetaccount(playerid, params[])
{
    if(PlayerInfo[playerid][pAdminLevel] >=5)
    {
            new string[200];
            if(isnull(params)) return SendClientMessage(playerid, COLOR_USAGE, "USAGE: /resetaccount [playername]");
            SendClientMessage(playerid, COLOR_INFO, string);
            new INI:File = INI_Open(UserPath(playerid));
            INI_WriteInt(File,"Skin",0);
            INI_WriteInt(File,"Password",0);
            INI_WriteInt(File,"Money",0);
            INI_WriteInt(File,"AdminLevel",0);
            INI_WriteInt(File,"Developer",0);
            INI_WriteInt(File,"Banned",0);
            INI_Close(File);
            Kick(playerid);
            return 1;
            }
            else return SendClientMessage(playerid, COLOR_ERROR, "ERROR: You are unauthorized to use this command.");
}
Reply
#2

Eh, try this:

pawn Код:
CMD:resetaccount(playerid, params[])
{
    if(PlayerInfo[playerid][pAdminLevel] >=5)
    {
            new string[200], targetid;
            if (sscanf(params, "us[128]", targetid)) return SendClientMessage(playerid, COLOR_USAGE, "USAGE: /resetaccount [playername]");
            else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "ERROR: That player is not connected!");
            {
            SendClientMessage(playerid, COLOR_INFO, string);
            new INI:File = INI_Open(UserPath(targetid));
            INI_WriteInt(File,"Skin",0);
            INI_WriteInt(File,"Password",0);
            INI_WriteInt(File,"Money",0);
            INI_WriteInt(File,"AdminLevel",0);
            INI_WriteInt(File,"Developer",0);
            INI_WriteInt(File,"Banned",0);
            INI_Close(File);
            Kick(targetid);
            return 1;
            }
            else return SendClientMessage(playerid, COLOR_ERROR, "ERROR: You are unauthorized to use this command.");
}
Reply
#3

If I use this, it just returns the SendClientMessage.

I'm using sscanf, not sscanf2 or anything like that by the way.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)