Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Give- / Removeitems on Focus
Hey .. G2O forum! Tongue And Dear Scripters!

Is it possible to put "Giveitem" or "Removeitem" on the PlayerFocus? And not on an entered ID?
If so? How?
u have to insert id in front of function like giveItem(id, ..) id is id of player that u lookin at. No matter is it focus or not. Whatever to create such function u can use getPlayerFocus. Also to not add parameter id is not make sense because every player have seperate focus. (I'm talking about server side / DONT do that on client side becouse of security).
[Image: Quarchodr_sheqnnr.png]
I want to create a traiding system to give something to someone in front of me (Focus)
There is a function called "getPlayerFocus" on server-side, look inside Functions.txt and you'll find it's 'declaration'.
The function has one parameter, which is the id of player whose 'focus id' you want to get.
For example, if i am player (id 0), and you are player (id 1), and i focused you, then, when you call this function like this:
local focus = getPlayerFocus(0)
print(focus) // this will print 1

Of course, the above code is only a dummy example.

Possibly Related Threads…
Thread Author Replies Views Last Post
  Give random item for Player liegav 6 2,888 14.02.2018, 17:30
Last Post: Patrix
  Short question about Gold, how to give it ? Mattwell 2 1,551 25.01.2018, 23:12
Last Post: Mattwell

Forum Jump:

Users browsing this thread: 1 Guest(s)