AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   amxclient_cmd | more than 2 params (https://forums.alliedmods.net/showthread.php?t=313293)

PTE 01-04-2019 04:29

amxclient_cmd | more than 2 params
 
How to pass more than 2 params in amxclient_cmd? I tried to pass more than 1 param in arg1 and arg2 and both weren't working fine with read_argv(_*), it can read only 2 params.

I only wanna know if there's any way to force user execute amxmodx command with 3+ params(currently I need 4) without client_cmd, or should I parse params by myself(with strtok e.g.)?

thEsp 01-04-2019 13:18

Re: amxclient_cmd | more than 2 params
 
http://amxxmodx.ru/core/amxmodxinc/8...tdelnosti.html

E1_531G 01-04-2019 15:53

Re: amxclient_cmd | more than 2 params
 
I would say no.
amxclient_cmd() and endclient_cmd() have the same syntax.
This means, the same usage: *client_cmd( id, "drop", "weapon_c4" )
So, only cmd and/with 2 args.
https://github.com/alliedmodders/amx...modx.cpp#L2757
https://github.com/alliedmodders/amx...modx.cpp#L2701

PTE 01-04-2019 18:20

Re: amxclient_cmd | more than 2 params
 
So it mean I am only able to use client_cmd (to format cmd and params) or use read_args (to read all the params in one string and parse it on my own)?

fysiks 01-04-2019 20:51

Re: amxclient_cmd | more than 2 params
 
If what you say is true then it looks like you would need to submit a feature request to make it so that it can do a variable number of arguments (hopefully it will make it into AMX Mod X 1.10.0). I was the one who originally requested amxclient_cmd() and I guess I never thought about it needing to support more than what engclient_cmd() does probably because I've only ever used engclient_cmd() with a single argument IIRC.

Hopefully a variable number of arguments is possible because it's a good idea.

PTE 01-05-2019 08:37

Re: amxclient_cmd | more than 2 params
 
How do I submit the request?(Sorry for kinda stupid question)

Arkshine 01-05-2019 17:22

Re: amxclient_cmd | more than 2 params
 
You can create an issue here: https://github.com/alliedmodders/amxmodx/issues (this will need an account)


All times are GMT -4. The time now is 18:59.

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