Resetaccount command - 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: Resetaccount command (
/showthread.php?tid=440252)
Resetaccount command -
SilencedPistol - 29.05.2013
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.");
}
Re: Resetaccount command -
Translator - 29.05.2013
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.");
}
Re: Resetaccount command -
SilencedPistol - 29.05.2013
If I use this, it just returns the SendClientMessage.
I'm using sscanf, not sscanf2 or anything like that by the way.