Author Topic: Change ban system of yours gups!working 100 %  (Read 3910 times)

0 Members and 1 Guest are viewing this topic.

Offline aledark24

  • Made Man
  • ***
  • Posts: 206
  • I am a scripter and you have celous of me....so you crashed my servers
    • View Profile
Change ban system of yours gups!working 100 %
« on: February 11, 2013, 10:57:44 pm »
Hi all... i know "gups contain many bugs, one example "register,givecash,deposit not show you real deposit,lockcars,ban system.... So now i fixed the ban system... only follow the steps xD

[pawn]public OnPlayerConnect(playerid)
{

InfoBanned(playerid);[/pawn]





[pawn]public OnPlayerCommandText(playerid, cmdtext[ ])
{
else if (strcmp(cmd, "ban", true) == 0) {
new razon[256], plr;
      tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp), razon = strtok(cmdtext, idx);
 if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, 0xF0182DFF, "Not have acces to this command" );
 else if (!strlen(razon)) SendClientMessage(playerid, 0xFFFF00AA,"[Error] - Write: /c ban <id/name> <reason>.");
   else if (plr == INACTIVE_PLAYER_ID)SendClientMessage(playerid, 0xF0182DFF,"[Error] - unknown player.");
      else {
              BaneoIP(plr,"Admin",gPlayers[playerid],cmdtext[strval(razon)+strlen(tmp)+4]);
       }
      return 1;
    }

    else if (strcmp(cmd, "unban", true) == 0) {
    new razon[256];
      tmp = strtok(cmdtext, idx), razon = strtok(cmdtext, idx);
      if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, 0xF0182DFF, "Not have acces to this command" );
 else if ( !strlen(tmp)) SendClientMessage(playerid, 0xFFFF00AA,"[Error] - Write: /c unban <Full name>.");
      else if (!IfPlayerBanned(tmp)) SendClientMessage(playerid, 0xFFFF00AA,"[Error] - not is in the banned list");
      else {
              DesbaneoIP(tmp,gPlayers[playerid],cmdtext[strval(razon)+strlen(tmp)+6]);
      }
      return 1;
    }
   
[/pawn]   
   
  [pawn] 
//==============================================================================
public InfoBanned(playerid)
{
   new IP[256],BAN,String[256];
    GetPlayerIp(playerid,IP,256);
    BAN = dini_Int("/Banned/BannedList.ini",IP);
    if(BAN == 1){
    format( String, sizeof( String ), "Auto-Kick: player  %s - Reason:[IP Banned of server].",gPlayers[playerid]);
SendClientMessageToAll(0xFFFF00AA, String );

      Kick(playerid);
       }
}
//==============================================================================
public IfPlayerBanned(player[ ])
{
   new ispb[256];
   ispb = dini_Get("/Banned/PlayerBanned.ini",player);
   return (strcmp(ispb, "0", true) == 0) ? false : true;
}
//==============================================================================
public BaneoIP(playerid,type[ ],admin[ ],reason[ ])
{
   new IP[256],inf[256],String[256];
    GetPlayerIp(playerid,IP,256);
    format(inf,256,"1 %s %s %s",gPlayers[playerid],admin,reason);
    dini_Set("/Banned/BannedList.ini",IP,inf);
    dini_Set("/Banned/PlayerBanned.ini",gPlayers[playerid],IP);
format( String, sizeof( String )," %s %s is banned player: %s, ID: %d, Reason:[%s ].",type,admin,gPlayers[playerid],playerid,reason);
SendClientMessageToAll(0xFFFF00AA, String );
   Kick(playerid);
}
//==============================================================================
[/pawn]
public DesbaneoIP(player[ ],admin[ ],reason[ ])
{
   new IP[256],param[2][128],String[256];
   IP = dini_Get("/Banned/PlayerBanned.ini",player);
    split(dini_Get("/Banned/BannedList.ini",IP) , param  , '  ' );
    format( String, sizeof( String ), "Admin %s Remove ban player: %s, Reason:[%s ].",admin,param[1],reason);
SendClientMessageToAll(0xFFFF00AA, String );
    dini_Unset("/Banned/BannedList.ini",IP);
    dini_Unset("/Banned/PlayerBanned.ini",player);
    return 1;
}
//==============================================================================
SORRY public desbaneo ip showme wrong the command whit pawno code, so i put only whit normal words xD but... copy all!

Download the banned folder
http://www.mediafire.com/?0yg0zwpxa55mb8j

You need delete the commands "ban and banip"
and of onplayerconnect
need delete
line "ipbans" to return
}

Put the banned folder inside of scriptfiles



VIDEO!

http://www.youtube.com/watch?v=DFTWivr1qXc&feature=youtu.be

SORRY my bad english but... thank me... some times....

« Last Edit: February 13, 2013, 10:01:44 pm by aledark24 »
I am a great scripter and you are celous of my works
.....

Vice City Life Multiplayer By Saint

Offline JaVeD

  • Street Thug
  • *
  • Posts: 46
  • Want scripts? Pm me now! Just for $
    • View Profile
    • Free Host -> Clicky
Re: Change ban system of yours gups!working 100 %
« Reply #1 on: February 12, 2013, 05:37:31 am »
Not Working For me i need to delete 1st ban system for this ? all old public ban functions ?

Code: [Select]
[code]C:\DOCUME~1\JAVEDA~1\Desktop\JAVED'~2\GAMEMO~1\UIF.pwn(5306) : error 021: symbol already defined: "InfoBanned"
C:\DOCUME~1\JAVEDA~1\Desktop\JAVED'~2\GAMEMO~1\UIF.pwn(5341) : error 027: invalid character constant
C:\DOCUME~1\JAVEDA~1\Desktop\JAVED'~2\GAMEMO~1\UIF.pwn(5341) : warning 215: expression has no effect
C:\DOCUME~1\JAVEDA~1\Desktop\JAVED'~2\GAMEMO~1\UIF.pwn(5341) : error 001: expected token: ";", but found ")"
C:\DOCUME~1\JAVEDA~1\Desktop\JAVED'~2\GAMEMO~1\UIF.pwn(5341) : error 029: invalid expression, assumed zero
C:\DOCUME~1\JAVEDA~1\Desktop\JAVED'~2\GAMEMO~1\UIF.pwn(5341) : fatal error 107: too many error messages on one line
[/code]

The vedio is not avaliable please put vedio :D
SA:MP Server: 5.231.49.21:7777
Website: www.nse-server.com

Offline VC[88]PD

  • Wiseguy
  • **
  • Posts: 52
    • View Profile
Re: Change ban system of yours gups!working 100 %
« Reply #2 on: February 12, 2013, 08:49:16 am »
Not Working For me i need to delete 1st ban system for this ? all old public ban functions ?

Code: [Select]
[code]C:\DOCUME~1\JAVEDA~1\Desktop\JAVED'~2\GAMEMO~1\UIF.pwn(5306) : error 021: symbol already defined: "InfoBanned"
C:\DOCUME~1\JAVEDA~1\Desktop\JAVED'~2\GAMEMO~1\UIF.pwn(5341) : error 027: invalid character constant
C:\DOCUME~1\JAVEDA~1\Desktop\JAVED'~2\GAMEMO~1\UIF.pwn(5341) : warning 215: expression has no effect
C:\DOCUME~1\JAVEDA~1\Desktop\JAVED'~2\GAMEMO~1\UIF.pwn(5341) : error 001: expected token: ";", but found ")"
C:\DOCUME~1\JAVEDA~1\Desktop\JAVED'~2\GAMEMO~1\UIF.pwn(5341) : error 029: invalid expression, assumed zero
C:\DOCUME~1\JAVEDA~1\Desktop\JAVED'~2\GAMEMO~1\UIF.pwn(5341) : fatal error 107: too many error messages on one line
[/code]

The vedio is not avaliable please put vedio :D

Try to replace public InfoBanned(playerid) to this
public InfoBanned(playerid)
{
   new IP[256],BAN,String[256];
    GetPlayerIp(playerid,IP,256);
    BAN = dini_Int("/Banned/BannedList.ini",IP);
    if(BAN == 1){
    format( String, sizeof( String ), "Auto-Kick: player  %s - Reason:[IP Banned of server].",gPlayers[playerid]);
SendClientMessageToAll(0xFFFF00AA, String );

      Kick(playerid);
       }
} And show me line 5341

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: Change ban system of yours gups!working 100 %
« Reply #3 on: February 13, 2013, 12:00:13 am »
isn't it the way to put completing filterscripts in server.cfg?


-Funniest quotes-

Quote from: asad3man
i cant able to understand