Page 1 of 1

The script for the issuance of items to those who are online

Posted: 30 Dec 2018, 20:38
by SpawN
Is it possible to implement such a script, which would check someone online, and give them a certain item?
That is, not all players in the database, but only those who are online.

Re: The script for the issuance of items to those who are online

Posted: 31 Dec 2018, 06:42
by Nyuton
Sure, the Livemap RCON has this function "Give Item to Everyone"
Everyone meaning all online players in this case.

Re: The script for the issuance of items to those who are online

Posted: 31 Dec 2018, 09:04
by SpawN
How to make the script run automatically every hour?

Re: The script for the issuance of items to those who are online

Posted: 01 Jan 2019, 08:27
by Nyuton
Not possible yet. Need to make a custom script for that.

Re: The script for the issuance of items to those who are online

Posted: 04 Jan 2019, 15:24
by SpawN
And does not it make it difficult for you to share a script that is responsible for distributing items to those who are online?

Re: The script for the issuance of items to those who are online

Posted: 04 Jan 2019, 17:12
by Nyuton
It's simple like that:

Code: Select all

foreach(%player in PlayerList) %player.inventoryAddItem(%itemID, %quantity, %quality, %durability, %durability);
But you'll have to wrap it into some routine that runs every hour.
I think I posted one example to add some alignment in official forums here: https://lifeisfeudal.com/forum/alignmen ... 1/#p158603
Using this %player.inventoryAddItem... instead of the %player.changeAlignment... should work.