Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Give- / Removeitems on Focus
#1
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?
Reply
#2
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]
Reply
#3
I want to create a traiding system to give something to someone in front of me (Focus)
Reply
#4
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:
Code:
local focus = getPlayerFocus(0)
print(focus) // this will print 1

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


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)