Can't figure out how to add commands
I cannot figure out how to add commands in the correct way.

I type
/rewards add command "sedan" "spawn sedan" 5
/rewards add command "mc" "spawn minicopter" 5
/rewards add command "rowboat" "spawn rowboat" 5

These seem to add fine in the rewards_data.json


  "commands": {
    "Day": {
      "description": "Spawn yourself a Car",
      "iconName": "sedan",
      "commands": [
        "spawn sedan"
      ],​

Rcon outputs the player called the command, however the coordinates seem to spawn the vehicle at "0.0 0.0 0.0"

Any idea what i am doing wrong?


---------------
Also "iconName": "sedan",  --I have a sedan.png located in /oxide/data/ServerRewards/Images

The image will not load.

I have tried adding a url here to see and it will not load this either.

Everything else is working fine.

Merged post

Update, got my custom images to load, turns out when i added the /oxide/data/ServerRewards/Images, i forgot to add permissions to the folder (linux for the win)

However my spawn commands still are not working correctly.


Unloaded plugin ServerRewards v0.4.67 by k1lly0u

[ServerRewards] All UI elements have been successfully generated!

Loaded plugin ServerRewards v0.4.67 by k1lly0u

spawned sedantest.entity[9971391] at (0.0, 0.0, 0.0)​


Merged post

Ok final update, please change to solved.

Upon studying the code i have come across the correct way to add the custom parameters for spawning cars and such. The documentation page was incorrect.

In reward.data.json

The command should be written "spawn sedan $player.x,player.y,player.z"

No spaces, back slashes or seperation of the parameters whatsoever.
"Mini Copter": {
"description": "Spawns a mini copter at your location (Be outside before using this command)",
"iconName": null,
"commands": [
"entity.spawn minicopter"
],
"displayName": "Mini Copter",
"cost": 40000,
"cooldown": 0
This is what I have in my data file for server rewards. If I use that command in console, it will spawn a mini copter but if I write it out like this, it does not work. Any help would be greatly appreciated, Thank you!
You would need to give everyone on the server admin permissions for that to work, I'm pretty sure.
In response to LoneWolfAU ():
You would need to give everyone on the server admin permissions for that to work, I'm pretty sure.
thank you for your response, is there a way to assign to a specific group then, like a VIP group?
"cmd": ["spawnminicopter $player.id", ""],
^^^^ there you go, I stand corrected :)

You are amazing, I've been trying to work this out for ages. Thanks for the tips!

Just took the spaces out of the command "spawn rhib $player.x,$player.y,$player.z" and it works

Thanks guys for the response! I will hop on shortly and give this a try :)

Merged post

So here is what I put in, it takes the points but nothing spawns:

"Mini Copter": {
"description": "Spawns a mini copter at your location (Be outside before using this)",
"iconName": null,
"commands": [
"spawnminicopter $player.id", ""
],
"displayName": "Mini Copter",
"cost": 40000,
"cooldown": 0
}
You can try

"spawn minicopter \"$player.x, $player.y, $player.z\""

I think for the command spawnminicopter you will need a plugin which has that command.

*edit: The plugin in question is My Mini Copter
In response to chadomat ():
You can try

"spawn minicopter \"$player.x, $player.y, $player.z\""

I think for...
Okay I will take a look at this, thank you so much!
how to add commands for chinook, minicopter, RHIB and mor
how to add a photo to the command
:)
After reading through all of this and trying various different things (thanks guys and gals), this works for minicopters. No spaces in the co-ords as HerpDerp said. The player doesn't need admin perms - we just tested it with a player and she's now very happy she has a minicopter. ;-)

  "commands": {
    "Spawn Minicopter": {
      "description": "Spawn Minicopter",
      "iconName": null,
      "commands": [
        "spawn minicopter.entity $player.x,$player.y,$player.z"
      ],
      "displayName": null,
      "cost": 3000,
      "cooldown": 0
    }
​