The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripit donations
Author Message
victorstelzer
Journeyman
*

Posts: 80
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jun 2012
Reputation: 0



Post: #1
Scripit donations
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
(This post was last modified: 02-02-2014 10:35 PM by victorstelzer.)
02-02-2014 10:07 PM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #2
RE: Scripit donations
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/S..._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
02-02-2014 11:21 PM
Find all posts by this user Like Post Quote this message in a reply
victorstelzer
Journeyman
*

Posts: 80
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jun 2012
Reputation: 0



Post: #3
RE: Scripit donations
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?
02-02-2014 11:35 PM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #4
RE: Scripit donations
Allclients works for all LOGGED IN players only, so you want to run a FOR on all accounts.
02-02-2014 11:48 PM
Find all posts by this user Like Post Quote this message in a reply
victorstelzer
Journeyman
*

Posts: 80
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jun 2012
Reputation: 0



Post: #5
RE: Scripit donations
[FUNCTION addbank]
SERV.NEWITEM=i_bag
NEW.allclients=<FINDLAYER.29>


test well did not work out
02-03-2014 01:12 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #6
RE: Scripit donations
Code:
serv.allclients addbank

[function addbank]
serv.newitem=i_bag
new.cont=<findlayer.29>
02-03-2014 01:31 AM
Find all posts by this user Like Post Quote this message in a reply
amonvangrell
Banned

Posts: 337
Likes Given: 17
Likes Received: 32 in 20 posts
Joined: Aug 2012

britannia shard

Post: #7
RE: Scripit donations
Cool this is useful to create a system of time rewards like in Runuo.
02-03-2014 06:16 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #8
RE: Scripit donations
Lol

Sent from my GT-I9505 using Tapatalk

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
02-04-2014 02:56 AM
Find all posts by this user Like Post Quote this message in a reply
victorstelzer
Journeyman
*

Posts: 80
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jun 2012
Reputation: 0



Post: #9
RE: Scripit donations
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>
02-28-2014 02:38 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #10
RE: Scripit donations
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

[Image: 2nis46r.jpg]
02-28-2014 02:54 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)