Posts: 6,129
Threads: 36
Joined: Jan 2009
You're trying to ENCODE the string which opens the user file?
Posts: 603
Threads: 12
Joined: Sep 2007
Reputation:
0
You opened the file, although you didn't select the "IP" field from the account and save it to a variable.
Posts: 6,129
Threads: 36
Joined: Jan 2009
Quote:
Originally Posted by [VLV
Cross - (Venomous-VLV.com) ]
Quote:
Originally Posted by Calgon
You're trying to ENCODE the string which opens the user file?
|
i guess so, well ya i want it to go into the User File and get there IP.
|
You're also not defining anything for file. Use my code.
pawn Код:
dcmd_unban(playerid, params[])
{
new name[MAX_PLAYER_NAME], string[128], string2[256];
if (sscanf(params, "s", name))
{
SendClientMessage(playerid, COLOR_WHITE, "SYNTAX - /unban [name]");
SendClientMessage(playerid, COLOR_GREY, "Full name, this includes underscores. Also CaSe sEnSiTiVe.");
}
else
{
if(pStats[playerid][pAdmin] < 5)
{
SendClientMessage(playerid, COLOR_WHITE, BAD_ADMIN_MESSAGE);
return 1;
}
else
{
format(string, sizeof(string), "CRP_Scriptfiles/Accounts/%s.ini", name);
if(fexist(string))
{
string2 = dini_Get(string, "IP");
format(string, sizeof(string), "unbanip %s", string2);
SendRconCommand(string);
format(string, sizeof(string), "You have successfully unbanned %s (IP: %s).", name, string2);
SendClientMessage(playerid, COLOR_WHITE, string);
SendRconCommand("reloadbans");
SendClientMessage(playerid, COLOR_WHITE, "The bans list has been reloaded.");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Invalid name, the name was not recognized.");
}
}
}
return 1;
}
You'll want to change a few things, and fix the indentation.
Posts: 6,129
Threads: 36
Joined: Jan 2009
I'm not sure if this will work, but remove the "/" before "/vadmin.."