SphereCommunity
Scripit donations - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Requests (/Forum-Script-Requests)
+--- Thread: Scripit donations (/Thread-Scripit-donations)

Pages: 1 2


Scripit donations - victorstelzer - 02-02-2014 10:07 PM

Could not think of how to make this script still ......

How can I make a script to select an item in the game, and donate the item to all players. ??

Does anyone have any idea?

[FUNCTION addbank]
SERV.NEWITEM=i_bag
NEW.CONT=<FINDLAYER.29>

as it would be for all player instead of findlayer.layer


RE: Scripit donations - XuN - 02-02-2014 11:21 PM

It depends: all player connected, all player in the world or one char per player (account).

In the first case you should take a look to the serv.allclients function: http://wiki.sphere.torfo.org/index.php/Server#Properties_and_Functions

In the second and third one a simple FOR <eval <serv.accounts>-1> and using Account references: http://wiki.sphere.torfo.org/index.php/Accounts


RE: Scripit donations - victorstelzer - 02-02-2014 11:35 PM

I would like to play on all accounts, so the player log into shard, the item would be on the bench player

ACCOUNTS RW Gets or sets the number of accounts on the server.
ALLCLIENTS command W Executes command on all online player characters.

I would like to play on all accounts, so the player log into shard, the item would be on the bench player o ALL CLIENTS ??

  the accounts would be the best option?


RE: Scripit donations - XuN - 02-02-2014 11:48 PM

Allclients works for all LOGGED IN players only, so you want to run a FOR on all accounts.


RE: Scripit donations - victorstelzer - 02-03-2014 01:12 AM

[FUNCTION addbank]
SERV.NEWITEM=i_bag
NEW.allclients=<FINDLAYER.29>


test well did not work out


RE: Scripit donations - XuN - 02-03-2014 01:31 AM

Code:
serv.allclients addbank

[function addbank]
serv.newitem=i_bag
new.cont=<findlayer.29>



RE: Scripit donations - amonvangrell - 02-03-2014 06:16 AM

Cool this is useful to create a system of time rewards like in Runuo.


RE: Scripit donations - Extreme - 02-04-2014 02:56 AM

Lol

Sent from my GT-I9505 using Tapatalk


RE: Scripit donations - victorstelzer - 02-28-2014 02:38 AM

Create this function works most not .... it does not add the item into the player's bank


serv.allclients addbank

[function addbank]
serv.newitem = i_bag
new.cont = <findlayer.29>


RE: Scripit donations - Mordaunt - 02-28-2014 02:54 AM

Code:
for x 0 <eval <serv.accounts> -1>
    for y 0 <eval <account.chars> -1>
        ref1 = <serv.account.<dlocal.x>.char.<dlocal.y>>
        serv.newitem  //  <------ add your item here
        new.cont <ref1.findlayer.29>  
    endfor
endfor