Raised This Month: $12 Target: $400
 3% 

[Not Solved ] Scripting Help related to ban command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shubhamgulati12
Senior Member
Join Date: Oct 2010
Location: Inida The Holy Place!!
Old 12-08-2012 , 01:59   [Not Solved ] Scripting Help related to ban command
Reply With Quote #1

Hi,
I wanted to ask , that for the command :
Quote:
amx_addban <"authid" or ip> <minutes> [reason]
we use the following command in scripting :
PHP Code:
server_cmd("amx_addban %s 0 ^"You are a hacker!^"",ip
But now I am using advanced bans for which the format of amx_addbans Is :
Quote:
amx_addban <name> <authid or ip> <time in minutes> <reason>
Can anyone tell me what should i write in the command for
amx_addban <name> <authid or ip> <time in minutes> <reason> ..?
PHP Code:
?? 
Thanks!
__________________

Join Free File hosting - http://db.tt/VvebKSSW
[Free 2 GB cloud storage]

Last edited by shubhamgulati12; 12-09-2012 at 01:04.
shubhamgulati12 is offline
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 12-08-2012 , 02:38   Re: Scripting Help related to ban command
Reply With Quote #2

Quote:
amx_addban <name> <authid or ip> <time in minutes> <reason>
Quote:
server_cmd("amx_addban %s 0 ^"You are a hacker!^"",ip)
Looks good for me.
__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
shubhamgulati12
Senior Member
Join Date: Oct 2010
Location: Inida The Holy Place!!
Old 12-08-2012 , 03:00   Re: Scripting Help related to ban command
Reply With Quote #3

Quote:
Originally Posted by naven View Post
Looks good for me.
no bro , first it is demanding nick and we have written ip of the player ....... pls provide me with the right command....
__________________

Join Free File hosting - http://db.tt/VvebKSSW
[Free 2 GB cloud storage]
shubhamgulati12 is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 12-08-2012 , 07:38   Re: Scripting Help related to ban command
Reply With Quote #4

define new variable for name
format that with get_user_name(id,string,charsmax(string));
and use inside the command:
PHP Code:
new szName32 ];
get_user_name(id,szName,charsmax(szName));
server_cmd("amx_addban %s %s 0 ^"You are a hacker!^"",szName,ip
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT

Last edited by AngeIII; 12-08-2012 at 07:38.
AngeIII is offline
Send a message via Skype™ to AngeIII
shubhamgulati12
Senior Member
Join Date: Oct 2010
Location: Inida The Holy Place!!
Old 12-08-2012 , 09:26   Re: Scripting Help related to ban command
Reply With Quote #5

Quote:
Originally Posted by AngeIII View Post
define new variable for name
format that with get_user_name(id,string,charsmax(string));
and use inside the command:
PHP Code:
new szName32 ];
get_user_name(id,szName,charsmax(szName));
server_cmd("amx_addban %s %s 0 ^"You are a hacker!^"",szName,ip
it is leading in compiling error :
In attachment...
Attached Thumbnails
Click image for larger version

Name:	Picture1.png
Views:	117
Size:	54.4 KB
ID:	112980  
__________________

Join Free File hosting - http://db.tt/VvebKSSW
[Free 2 GB cloud storage]
shubhamgulati12 is offline
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 12-08-2012 , 10:10   Re: Scripting Help related to ban command
Reply With Quote #6

Post your entire code if you want our help with this matter. Basically, you forgot
Code:
}
somewhere
__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
shubhamgulati12
Senior Member
Join Date: Oct 2010
Location: Inida The Holy Place!!
Old 12-08-2012 , 13:28   Re: Scripting Help related to ban command
Reply With Quote #7

Quote:
Originally Posted by naven View Post
Post your entire code if you want our help with this matter. Basically, you forgot
Code:
}
somewhere
Ops I am sorry .
Scripting in my next post..
__________________

Join Free File hosting - http://db.tt/VvebKSSW
[Free 2 GB cloud storage]

Last edited by shubhamgulati12; 12-08-2012 at 17:10.
shubhamgulati12 is offline
shubhamgulati12
Senior Member
Join Date: Oct 2010
Location: Inida The Holy Place!!
Old 12-08-2012 , 17:10   Re: Scripting Help related to ban command
Reply With Quote #8

Here is scripting :
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <file>

new t;

enum INFO NAMEAUTHORVERSION }

new const 
PLUGIN[INFO:3][] = { "mSoft BlackList Players","MaSTeR","1.0" }

public 
plugin_init()
{
 
register_plugin(PLUGIN[NAME],PLUGIN[VERSION],PLUGIN[AUTHOR])
}

public 
client_putinserver(id)
{
 new 
user[32];
 
get_user_name(id,user,31)
 
set_task(15.0,"mSoftVerificaClasaDeIp",id)
 
server_cmd("amx_chat Clasa de IP a lui %s este verificata automat de sistem.",user)
 
server_cmd("amx_chat Daca va primi BAN, inseamna ca IP-ul se afla in lista neagra!")
}

public 
mSoftVerificaClasaDeIp(id)
{
 if(
is_user_connected(id) == 1)
 {
  new 
user[32],ip[32], clasaIpA[10];
  
get_user_name(id,user,31)
  
get_user_ip(id,ip,31,1)
  
get_user_ip(id,clasaIpA,9,1)
  new 
counterIpuri;
  
counterIpuri 0
  
new fopen("/addons/amxmodx/configs/msoft_blacklist.ini","r")
  new 
data[128]
  while( !
feof(f) ) 
  {
   
fgets(fdata127)
   if(
data[0] != ';')
   {
    
counterIpuri++;
   }
  }
  
fclose(f)
  new 
fisierBlackList[128],clasaIpB[10];
  
format(fisierBlackList127"/addons/amxmodx/configs/msoft_blacklist.ini")
  for (new 
i=0i<counterIpurii++)
  {
   
read_file(fisierBlackListiclasaIpB9t)
   
//replace_all(clasaIpA, 9, ".", "")
   //replace_all(clasaIpB, 9, ".", "")
   
if (equal(clasaIpBclasaIpA))
   {
    
set_task(5.0,"mSoftAdaugaBanPermanent",id)
    
client_print(id,print_chat,"[info] Ops.. %s se pare ca ai fost pedepsit de catre conducerea acestui server. BAN PERMANENT pe CLASA de IP!",user)
    
client_print(id,print_chat,"[info] In cazul in care consideri ca aceasta pedeapsa este un abuz, asteptam reclamatia pe forum: http://counterstrike.master-software.ro")
   }
  }
 }
}

public 
mSoftAdaugaBanPermanent(id

if(
is_user_connected(id) == 1

new 
szName[32],ip[32]; 
get_user_name(id,szName,31
get_user_ip(id,ip,31,1
server_cmd("amx_addban %s %s 0 ^"Your Ip Has Been Blacklisted Headshooter^"",szName,ip
client_print(0,print_chat," %s has been banned from server - Headshooter Bans! ",szName
 } 

problem that i am facing now is that it detects the ip of player but doesnt bans him
I am able to say that it detects just because it comes in chat that %s ip has been banned something , i tried entering my ip too , still it shows in chat that it has banned me but command is not functioning...

Problem seems to be in :
server_cmd("amx_addban %s %s 0 ^"Your Ip Has Been Blacklisted - Headshooter^"",szName,ip)
please tell me what should i do
Format I want is same :
amx_addban "name" "ip" "time" "reason"

And Original plugin :
http://forums.alliedmods.net/showthread.php?t=148296
__________________

Join Free File hosting - http://db.tt/VvebKSSW
[Free 2 GB cloud storage]

Last edited by shubhamgulati12; 12-08-2012 at 17:11. Reason: Added in detail about my problem..
shubhamgulati12 is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 12-09-2012 , 16:00   Re: [Not Solved ] Scripting Help related to ban command
Reply With Quote #9

use ^" ^" to add quotas.
amx_addban "name" "ip" "time" "reason"
server_cmd("amx_addban ^"%s^" ^"%s^" ^"%d^" ^"%s^"",szName,ip,time,reason)
name,ip,reasons -> strings.
time -> integer.

server_cmd("amx_addban %s %s 0 ^"Your Ip Has Been Blacklisted - Headshooter^"",szName,ip)
->
server_cmd("amx_addban ^"%s^" ^"%s^" 0 ^"Your Ip Has Been Blacklisted - Headshooter^"",szName,ip)
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
shubhamgulati12
Senior Member
Join Date: Oct 2010
Location: Inida The Holy Place!!
Old 12-10-2012 , 00:48   Re: [Not Solved ] Scripting Help related to ban command
Reply With Quote #10

Quote:
Originally Posted by AngeIII View Post
use ^" ^" to add quotas.
Still same
What is happening is :
it comes in chat so and so is banned , which comes only when command is executed..
But he doesnt get banned!
I entered my ip in .ini file , it came in chat i get banned but i didnt get banned..
Please someone check the scripting for error...
I want person to get banned if his ip matches one in .ini file...
please see the code and tell the mistake ...
and yes i want for advanced bans only...
Thanks..
__________________

Join Free File hosting - http://db.tt/VvebKSSW
[Free 2 GB cloud storage]
shubhamgulati12 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode