Gothic Online Forums
Short question about Gold, how to give it ? - Printable Version

+- Gothic Online Forums (https://archive.gothic-online.com)
+-- Forum: Scripting (English) (https://archive.gothic-online.com/forum-11.html)
+--- Forum: Scripting Help (https://archive.gothic-online.com/forum-12.html)
+--- Thread: Short question about Gold, how to give it ? (/thread-2328.html)



Short question about Gold, how to give it ? - Mattwell - 25.01.2018

Can someone tell me how to add gold for player ?
I didn't find any function for giving money for player on wiki.
If gold is item with specific value, can you give me instance of it?

Ps. Sorry for a lot of new threads with problems, but I really want to start server and only you can help me :/


RE: Short question about Gold, how to give it ? - Patrix - 25.01.2018

http://gothic-online.com.pl/new_wiki/index.php?title=GiveItem

Example code:
Squirrel Script
  1. addEventHandler("onPlayerConnect",function(pid)
  2. {
  3. giveItem(pid, Items.id("ITMI_GOLD"), 1000)
  4. })



@Edit
Rembember to register item that you want to give in Items.xml file.


RE: Short question about Gold, how to give it ? - Mattwell - 26.01.2018

Thank you, I found instance ITMI_GOLD and I tried giveItem function, but I didn't know that I must register this item in Items.xml manually.
Thank you so much !