Home   Help Search Login Register  

Author Topic: what do i use for more than one player?  (Read 1367 times)

0 Members and 1 Guest are viewing this topic.

Offline danturn

  • Members
  • *
what do i use for more than one player?
« on: 06 Jul 2008, 23:05:33 »
Basically, i have an NPC who you can 'buy' weapons off in the game.

However the script removes cash from the the players inventory (cash is in the form of a magazine named "rpo_obj3").

What i need to know is, if you have more than one player on the game what do you use in the script?

for example, if there is just one player and his name was bob you would use,

Code: [Select]
bob removemagazine "rpo_obj3",

is it possible to put something in place of bob so that it will only deduct the magazine from the player was uses the addaction at that particular time?

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: what do i use for more than one player?
« Reply #1 on: 06 Jul 2008, 23:43:07 »
player only refers to the player object on the current client. Actions only run a script on the current client, so using player in this situation is fine. In global triggers, for example, the scripts are run on all machines, so that would be a different situation.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline danturn

  • Members
  • *
Re: what do i use for more than one player?
« Reply #2 on: 07 Jul 2008, 00:14:12 »
meaning? Lol. Does that mean it can or can't be done? I really don't understand what you mean.

Offline Cheetah

  • Former Staff
  • ****
Re: what do i use for more than one player?
« Reply #3 on: 07 Jul 2008, 00:19:51 »
He means that you don't have to change your script to make it work on a MP server.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline danturn

  • Members
  • *
Re: what do i use for more than one player?
« Reply #4 on: 07 Jul 2008, 00:27:16 »
Ahh i see, so when using player in multiplayer, it actually refers to the person who is, at the time, selecting the addaction?
« Last Edit: 07 Jul 2008, 00:31:17 by danturn »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: what do i use for more than one player?
« Reply #5 on: 07 Jul 2008, 00:34:30 »
Indeed it does.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)