Raised This Month: $ Target: $400
 0% 

read_arg?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Z@C
Member
Join Date: May 2006
Location: Moscow, Russia
Old 06-19-2006 , 09:45   read_arg?
Reply With Quote #1

i need got param from command amx_ban,amx_addip and someone.
how i can do this?
example,amx_ban name minute reason
if minutes == 0 {...}
__________________
HLDS protocol 48 (CS 1.1.2.6 build 4883 on FreeBSD 9.0)
AMXX v1.8.1.3746 | METAMOD v1.19p32 | DProto 0.9.87
Web: Nginx 1.0.10 (build 1.1), Apache 2.2.21, PHP 5.3.8, MySQL 5.5.17
Z@C is offline
Send a message via ICQ to Z@C
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-19-2006 , 11:00  
Reply With Quote #2

Use read_argv();
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Z@C
Member
Join Date: May 2006
Location: Moscow, Russia
Old 06-19-2006 , 12:39  
Reply With Quote #3

write example for me how i must get params
__________________
HLDS protocol 48 (CS 1.1.2.6 build 4883 on FreeBSD 9.0)
AMXX v1.8.1.3746 | METAMOD v1.19p32 | DProto 0.9.87
Web: Nginx 1.0.10 (build 1.1), Apache 2.2.21, PHP 5.3.8, MySQL 5.5.17
Z@C is offline
Send a message via ICQ to Z@C
Smokey485
Senior Member
Join Date: Dec 2004
Location: Newt 'Ellin
Old 06-19-2006 , 13:17  
Reply With Quote #4

if the cmd was
amx_ban name minutes

Code:
public test(id)
{
   new namearg[32], minutearg[32], minutes
   read_argv(1,namearg,31) // the first argument(name)
   read_argv(2,minutearg,31) // the second argument(minutes)
   minutes = str_to_num(minutearg)
   server_cmd("banid %d.0 ^"%s^" kick", minutes,namearg)
   
return PLUGIN_HANDLED;
}
__________________
+karma if I am helpful to you.
I am one in a few million.
Smokey485 is offline
Send a message via AIM to Smokey485 Send a message via MSN to Smokey485
Z@C
Member
Join Date: May 2006
Location: Moscow, Russia
Old 06-19-2006 , 13:43  
Reply With Quote #5

if i write this:
read_argv(1,name,31)
read_argv(2,minutes,9)
read_argv(3,reason,127)
read_argv(4, target, 31)
read_argv(5,cmd,15)
new player = cmd_target(id, target, 9)
get_user_name(player,nick,31)

if (equal(cmd,"amx_ban") == 1) {
if (str_to_num(minutes) == 0) {
log_amx("%s %s %s %s",nick,name/*<<admin*/,reason)
}
}
... for example. this will be work?
__________________
HLDS protocol 48 (CS 1.1.2.6 build 4883 on FreeBSD 9.0)
AMXX v1.8.1.3746 | METAMOD v1.19p32 | DProto 0.9.87
Web: Nginx 1.0.10 (build 1.1), Apache 2.2.21, PHP 5.3.8, MySQL 5.5.17
Z@C is offline
Send a message via ICQ to Z@C
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 08:04.


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