Author Topic: SetPlayerData - is it one way, only?  (Read 749 times)

scornflake

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 1
  • Posts: 15
    • View Profile
SetPlayerData - is it one way, only?
« on: April 06, 2017, 03:32:22 AM »
In case I'm going mad.

Is SetPlayerData one way?
i.e: only the client with that player can call it?!

In other words, I cannot, as player 1, update data for Player 2 (from player 1's game)?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: SetPlayerData - is it one way, only?
« Reply #1 on: April 07, 2017, 06:53:27 PM »
Yes. Only the player can modify its own data.

If you want to modify data from another player, send a request to do so to the player in question:
  1. tno.Send("IncreaseKillCount", tno.owner, 1);
  1. [RFC] void IncreaseKillCount (int amount)
  2. {
  3.     TNManager.SetPlayerData("kill count", TNManager.GetPlayerData<int>("kill count") + amount);
  4. }

scornflake

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 1
  • Posts: 15
    • View Profile
Re: SetPlayerData - is it one way, only?
« Reply #2 on: April 09, 2017, 01:20:30 AM »
OK. Thanks for the clarification.