SA-MP Forums Archive
Unbanacc help - 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: Unbanacc help (/showthread.php?tid=387664)



banacc help - Face9000 - 25.10.2012

Hello, i just made this quick code to offline ban a player account, it works fine but there is a problem.

It allows me to ban the account ALREADY banned, so i need to add a check, how?

pawn Код:
CMD:banacc(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 5)
    {
    new name[MAX_PLAYER_NAME];
    new aName[MAX_PLAYER_NAME];
    new aid;
    new string[200];
    new echos[200];
    new am[128];
    new Year, Month, Day, Hour, Minute, Second;
    getdate(Year, Month, Day);
    gettime(Hour, Minute, Second);
    GetPlayerName(aid, aName, sizeof(aName));
    if(sscanf(params, "s",name)) return SendClientMessage(playerid,-1,"{F70505}Usage: {FFFFFF}/banacc <account name>");
    if(!fexist(UserPath(playerid))) return SendClientMessage(playerid, red, "Player account not found, please note the files are CASE SENSITIVE.");
    else
    {
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Banned",1);
    INI_Close(File);
    }
    format(string, sizeof(string), "Admin %s (%d) banned %s's account - %02d/%02d/%d - %02d:%02d:%02d", aName,aid,name,Day,Month,Year,Hour,Minute,Second);
    format(echos, sizeof(echos), "1,4Admin %s (%d) banned %s's account - %02d/%02d/%d - %02d:%02d:%02d", aName,aid,name,Day,Month,Year,Hour,Minute,Second);
    format(am, sizeof(am), "You have successfully banned %s's account.", name);
    SendClientMessage(aid,red,am);
    SendMessageToAdmins(red,string);
    IRC_Say(gGroupID, IRC_CHANNEL, echos);
    IRC_Say(gGroupID, IRC_ACHANNEL, echos);
    AccBanLog(string);
    }
    return 1;
}



Re: Unbanacc help - ViniBorn - 25.10.2012

Try INI_IsSet


Re: Unbanacc help - GangsterLifeRP - 25.10.2012

Well No if you banned the player he is banned he cannot join unless he has changed his IP, You could just permaban him next time and he will not Join because his External IP Will be banned from your server


Re: Unbanacc help - Face9000 - 25.10.2012

Quote:
Originally Posted by GangsterLifeRP
Посмотреть сообщение
Well No if you banned the player he is banned he cannot join unless he has changed his IP, You could just permaban him next time and he will not Join because his External IP Will be banned from your server
................

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
Try INI_IsSet
Can you give me an example please?