AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   read_arg? (https://forums.alliedmods.net/showthread.php?t=29941)

Z@C 06-19-2006 09:45

read_arg?
 
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 {...}

v3x 06-19-2006 11:00

Use read_argv();

Z@C 06-19-2006 12:39

write example for me how i must get params

Smokey485 06-19-2006 13:17

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;
}


Z@C 06-19-2006 13:43

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?


All times are GMT -4. The time now is 08:04.

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