Posted 26 May 2015 - 02:49 AM
We would like to allow users to push a button to receive more HQM lives on our server and the command computer seems to be the perfect way to do this however, I am having a few issues that I hope the community can help me with.
At the console, as an admin you can run this command to add one life to a player named steve: "/hqm lives add steve 1". I want the closest player to the command computer to get the lives so I put together the following program:
When I run this I get the following error from HQM:
"Please use only positive numbers and / or a correct Playername."
If I use the player name, rather than @p (as seen below) everything works:
I believe the problem is the @p but I am at a loss on how to fix it. Any advice is appreciated.
Note: I am trying to stay away from Sensors if I can.
At the console, as an admin you can run this command to add one life to a player named steve: "/hqm lives add steve 1". I want the closest player to the command computer to get the lives so I put together the following program:
commands.exec("/hqm lives add @p 1")
When I run this I get the following error from HQM:
"Please use only positive numbers and / or a correct Playername."
If I use the player name, rather than @p (as seen below) everything works:
commands.exec("/hqm lives add steve 1")
I believe the problem is the @p but I am at a loss on how to fix it. Any advice is appreciated.
Note: I am trying to stay away from Sensors if I can.
Edited on 26 May 2015 - 12:50 AM