29.10.2015, 17:05
pawn Код:
new TempIP[16];
#define PATH "/Users/%s.ini"
forward OfflineIP(name[], value[]);
public OfflineIP(name[], value[])
{
INI_String("IP", TempIP, sizeof(TempIP));
return 1;
}
CMD:unbanip(playerid, params[])
{
if(isnull(params)) SendClientMessage(playerid,-1,"Usage: /unbanip [player nick]");
else if(!(2 < strlen(params) < MAX_PLAYER_NAME)) SendClientMessage(playerid,-1,"Error: Incorrect name lenght.");
else
{
new str[40];
format(str,sizeof(str),PATH,params);
if(!INI_ParseFile(str, "OfflineIP")) SendClientMessage(playerid,-1,"Error: Account doesn't exists.");
else
{
printf("unbanip %s",TempIP);
format(str, sizeof(str),"unbanip %s", TempIP);
SendRconCommand(str);
//SendRconCommand("reloadbans");
}
}
return 1;
}