samp.ban unbanning - 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: samp.ban unbanning (
/showthread.php?tid=609931)
samp.ban unbanning -
NeXoR - 18.06.2016
Hey guys, I know it's a lame question, but I never actually worked with file functions, so I really got no clue
I know its possible to unban an IP address using /rcon unbanip
but if I want to unban using a name instead of IP ?
Shall I use like File:ban = fopen: blah blah blah
and then strfind(ban, playername, false) ?
Sorry for the "newbie" question but I never actually used it :/
Re: samp.ban unbanning -
darkdevil - 18.06.2016
Huh?you need unban cmd?
Re: samp.ban unbanning -
darkdevil - 18.06.2016
PHP код:
CMD:unban(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
new string[128];
if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unban [playername]");
if( PlayerInfo[playerid][pBan] >= 1 )
{
PlayerInfo[playerid][pBan] = 0;
print("OnPlayerOfflineLogin: Variables saved properly");
format(string, 128, "[ADMIN] %s (IP:%s) was unbanned by %s.", params, PlayerInfo[playerid][pIP], GetPlayerNameEx(playerid));
SendStaffMessage(COLOR_RED,string);
new year, month,day;
getdate(year, month, day);
new playa[MAX_PLAYER_NAME];
GetPlayerName(playerid, playa, MAX_PLAYER_NAME);
format(string, sizeof(string), "[ADMIN] %s : was unbanned by %s.", params, playa);
SendStaffMessage(COLOR_RED, string);
}
else
{
SendClientMessage( playerid, COLOR_WHITE, "Not a banned account or no such account was found!" );
}
}
return 1;
}
Re: samp.ban unbanning -
NeXoR - 18.06.2016
Quote:
Originally Posted by darkdevil
PHP код:
CMD:unban(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
new string[128];
if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unban [playername]");
if( PlayerInfo[playerid][pBan] >= 1 )
{
PlayerInfo[playerid][pBan] = 0;
print("OnPlayerOfflineLogin: Variables saved properly");
format(string, 128, "[ADMIN] %s (IP:%s) was unbanned by %s.", params, PlayerInfo[playerid][pIP], GetPlayerNameEx(playerid));
SendStaffMessage(COLOR_RED,string);
new year, month,day;
getdate(year, month, day);
new playa[MAX_PLAYER_NAME];
GetPlayerName(playerid, playa, MAX_PLAYER_NAME);
format(string, sizeof(string), "[ADMIN] %s : was unbanned by %s.", params, playa);
SendStaffMessage(COLOR_RED, string);
}
else
{
SendClientMessage( playerid, COLOR_WHITE, "Not a banned account or no such account was found!" );
}
}
return 1;
}
|
-__-
No, it wouldn't work since im missing half of your functions, anyways, got it working alone
thx for trying (?)
Re: samp.ban unbanning -
Beckett - 18.06.2016
You have to unban the IP first through the command "unbanip".
Then, you will have to reload the bans so the said IP is removed from the file, the command to do that is "reloadbans".