CMD:deleteacc(playerid, params[])
{
new targetname[24], filestring[79];
if(PlayerInfo[playerid][pAdminLevel] >= 7)
{
if(sscanf(params, "s[24]", targetname)) return SendClientMessage(playerid, -1, "Correct usage: /deleteacc [Player's name]");
format(filestring, sizeof(filestring), "Users/%.ini", targetname);
if(!fexist(filestring)) return SendClientMessage(playerid, -1, "Error: Account was not found!");
else
{
fremove(filestring);
new done[128];
format(done, sizeof(done), "You have delete account %s", targetname);
SendClientMessage(playerid, -1, done);
}
}
return 1;
}
hmmmm, it doesn't seem bugged for me.
make sure you have the correct path written and the correct name |
CMD:unban(playerid, params[])
{
new targetname[24], filestring[79];
if(PlayerInfo[playerid][pAdminLevel] >= 7)
{
if(sscanf(params, "s[24]", targetname)) return SendClientMessage(playerid, -1, "Correct Usage: /unban [Player's Name]");
format(filestring, sizeof(filestring), "Users/%s.ini", targetname);
if(!fexist(filestring)) return SendClientMessage(playerid, -1, "Error: The player name you have chosen was not found in our system.");
else
{
new INI:file = INI_Open(filestring);
INI_SetTag(file, "Player's Data");
INI_WriteInt(file, "Banned", 0);
INI_Close(file);
new done[128];
new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(done, sizeof(done), "You have unbanned %s", targetname);
format(string, sizeof(string), "Administrator %s have just unbanned %s", name, targetname);
AdminLog(string);
SendClientMessage(playerid,-1 , done);
}
}
return 1;
}
Here's the problem
if(sscanf(params, "s[24]", targetname)) A target player ( Either name Either ID ) must always be defined as "u" so that should be replaced with if(sscanf(params, "u", targetname)) |
Here's the problem
if(sscanf(params, "s[24]", targetname)) A target player ( Either name Either ID ) must always be defined as "u" so that should be replaced with if(sscanf(params, "u", targetname)) |