Jump to content

playerranks.reward fails to execute rewarding command

Pending 2.3.2

Rustling
Rustling

Posted

Hi!

I'm trying to reward players with RP from the Server Rewards plugin. The rewards are set in data/PlayerRanksRewards.json like this:

"First": "rp add {id} 10"

When I use /pr reward in chat, everything works fine. However, when I use playerranks.reward through the console, I receive a bunch of similar errors:

Command 'rp add 12345678901234567 10' not found.

I am using this method because Player Ranks doesn't reward players on wipe for some reason, despite "IssueRewardsAtWipe": true being set in both the config and data/PlayerRanksRewards.json.

I would appreciate any help with this.

  • Administrator
Steenamaroo

Posted

Unless there's a way to change it, the command for server rewards is sr and /sr, not rp.

Rustling

Posted

Thank you for the quick response.

Maybe I'm missing something, but it looks like there's no command called sr or /sr. The Server Rewards documentation only refers to /rp add and rp add (link).

Also, as I mentioned earlier, this command rewards players correctly when triggered via Player Ranks' /pr reward chat command, but it fails when called from the console via playerranks.reward.

  • Administrator
Steenamaroo

Posted

Oh, looks like it was changed some months ago.
Default was always sr.

What version of server rewards are you on?

 

PlayerRanks calls exactly the same code whether you use chat command or console command, so there should be no difference.
If you're only seeing the complaint sometimes, I'd guess it's not calling that sr/rp command sometimes due to the top player not being online at the time,
or something like that.

do rp add yoursteamid 1 in console and see if it works.
if it doesn't, do sr add yoursteamid 1

Rustling

Posted

I'm using the latest available version of Server Rewards (v2.0.7).

Quote

PlayerRanks calls exactly the same code whether you use chat command or console command, so there should be no difference.
If you're only seeing the complaint sometimes, I'd guess it's not calling that sr/rp command sometimes due to the top player not being online at the time,
or something like that.

The console command playerranks.reward fails consistently, while the chat command /pr reward works correctly every time, regardless of whether the top player is online. I have tested both repeatedly under the same conditions, with a mix of online and offline top players. I have also set "WaitUntilPlayerIsOnline": false for all categories in data/PlayerRanksRewards.json, so the player's online status should not be a factor.

Quote

do rp add yoursteamid 1 in console and see if it works.
if it doesn't, do sr add yoursteamid 1

Running rp add yoursteamid 1 in the console always works, including when the player is offline (it outputs: [Server Rewards] You have added 1RP to yourname (yoursteamid)!).

However, running sr add yoursteamid 1 produces no output at all.

  • Administrator
Steenamaroo

Posted (edited)

I just tested with public PlayerRanks and latest ServerRewards.
Chat command and console command both worked fine for me.

 

I can't think of a good reason for the behaviour you're seeing,

but If you're seeing the same confirmation message each time (default is "Rewards issued for all enabled categories."),
then PlayerRanks is calling exactly the same code, whether the reward call comes from console or chat.

I was going to ask if PlayerRanks is latest version but I just checked - The relevant code hasn't changed in a very long time.

Edited by Steenamaroo
  • Administrator
Steenamaroo

Posted

You said you saw "a bunch of similar errors", and I guess you've put in a placeholder for the player's userID.
Could you private message me a recent console log showing a failure, please?

Rustling

Posted

32 minutes ago, Steenamaroo said:

I just tested with public PlayerRanks and latest ServerRewards.
Chat command and console command both worked fine for me.

That's odd... I'll reinstall both after the wipe and check again.

31 minutes ago, Steenamaroo said:

I can't think of a good reason for the behaviour you're seeing,

but If you're seeing the same confirmation message each time (default is "Rewards issued for all enabled categories."),
then PlayerRanks is calling exactly the same code, whether the reward call comes from console or chat.

Yep, I see that message every time. The difference is that when rewards are triggered via the console, I get a bunch of Command 'rp add playerid 10 not found for each category, while via the chat command I see a bunch of [Server Rewards] You have added 1RP to playername (playersteamid)! in the console instead of errors. Also, in this case, Rewards issued for all enabled categories appears only in chat.

26 minutes ago, Steenamaroo said:

You said you saw "a bunch of similar errors", and I guess you've put in a placeholder for the player's userID.
Could you private message me a recent console log showing a failure, please?

Sure, I'll DM you.

  • Administrator
Steenamaroo

Posted

Ok, thank you.

When you issue the command in chat, do you see "Rewards issued for all enabled categories." in chat?
And, also, when you issue the command by console, do you see the same message but in console?

2.2m

Downloads

Total number of downloads.

10.2k

Customers

Total customers served.

147.2k

Files Sold

Total number of files sold.

3.1m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.