Console Commands

I am playing on a roleplaying server and to make it more realistic the server uses the /me command.
I pull out my gun by pressing the number 1 on my keyboard so I’ve attempted to make it so that whenever I pull out the gun it performs “me grabs gun” and whenever I press 1 again to tuck the gun it performs “me tucks gun”.

this is what i’ve come up with:

bind KEYBOARD 1 "toggle grab tuck"
set grab "me grabs glock from behind his shirt."
set tuck "me tucks glock behind his shirt."

but this returns this in the console:
Argument count mismatch (passed 2, wanted 3)

Hello, this is a friendly reminder because this is your first time creating a topic (or it has been a while since your last topic) in this category.

Please note that most of the support is provided by the Cfx.re community on a voluntary basis. We ask you to be patient; there is no guarantee we have a solution to your problem(s). To avoid unnecessary/duplicate topics, please browse the forums before creating a topic.

To improve your chances of your issue(s) being solved, please provide as much information as possible about the issue(s) you are having. Also —whenever possible— please use the template given to you when creating a topic.

Thanks for keeping these forums tidy!
:mascot:

You could try this:

# command set
seta grab "me grabs glock"
seta tuck "me tucks glock away"

# set an initial command
seta curcmd "vstr grab"

# bind
bind keyboard 1 "vstr curcmd; toggle curcmd \"vstr grab\" \"vstr tuck\""
1 Like

@MEHDI_MMO I know you can help him.

1 Like

The toggle command requires three arguments, but you’ve only provided two, the correct syntax for the toggle command is:

toggle (variable) (value1) (value2)

something like this:

bind keyboard 1 “toggle gunaction”
set gunaction “grab”
set grab “me grabs glock from behind his shirt.”
set tuck “me tucks glock behind his shirt.”

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.