How to detect argument empty?
if i type like amx_some_cmd argument1
i wanna know how it can be detected if argument1 is empty or not ( im not using numbers ) i tryed Code:
help? :roll: |
Code:
argument_count should be the number of arguments plus one, so if your command was amx_command <player> <action> then the number would be 3. This automatically checks admin flags and argument count and outputs text to the console. |
okey... :? how does it know its 3? :? that only says argument_count...
so where do i pu the "3"? it looks like this now Code:
|
nvm :P i just changed
" " to "" and it worked :P |
argument_count is the only variable you actually have to change yourself, it doesn't actually magically know.
|
:?:
"nvm" means "never mind" dude...:idea: how would argument_count know how many args i want? i've got 6 different things happening if there are 0-5 arguments... |
argument_count doesn't know anything, you tell it what it is supposed to do, that's it. For example, cmd_access(id,level,cid,3), argument_count is not a predefined variable like the other three.
|
I think you can also do "if(!my_arg) return 0".
|
Quote:
but i wanna do if argument 5 is empty it goes to next thing... the thing with 4 arguments. and if argument 4 isn't found it will use next, the one with 3 arguments... cani do it like this?: (!0,0,0,5) { lalala } (!0,0,0,4) { something else } :?: btw... wtf is level and cid? and it still works... so it doesn't matters BUT if i wanna show the result that got most votes in my votings, how do i do. i checked the adminvote but i got really confused :P lol i have 2-4 options... can some1 just help me with the easiest way to do it :P |
maybe read_argc()
http://www.amxmodx.org/funcwiki.php?go=func&id=177 |
| All times are GMT -4. The time now is 23:38. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.