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-nmm7 (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-nmm7 (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-nmm7 (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
random 1 player in region
Author Message
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #11
RE: random 1 player in region
(08-30-2012 08:46 PM)Alias Wrote:  Hi Bye i have problem, how to choose 1 player random in region and give this funtion f_luckyplayer to player who was randomy choosed ?

Looks like you mentioned you wanted to parse f_luckyplayer on 1 'random' player in the region, that's why I coded that above script for you.

Oh damn, I see, I'm running the script over and over... should use vars and erase, oh well. TAGs will clutter your spheredata.scp. Here, try this one out:
Code:
[function luckyplayer]
region.allchars f_luckyplayer_choose_rnd
if (<var0.luckyplayers>)
  local.player=<eval {1 <var0.luckyplayers>}>
  local.player=<var0.luckyplayer.<dlocal.player>>
  uid.<local.player>.f_luckplayer //this will give f_luckyplayer to a random player in the region
  for x 1 <var0.luckyplayers>
    var.luckyplayer.<dlocal.x>=
  endfor
  var.luckyplayers=
endif

[function f_luckyplayer_choose_rnd]
if (<isplayer>)
  var0.luckyplayers += 1
  var.luckyplayer.<dvar0.luckyplayers>=<uid>
endif

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
(This post was last modified: 09-03-2012 10:41 AM by Skul.)
09-03-2012 10:32 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Ben
Sphere Developer
*****

Posts: 612
Likes Given: 2
Likes Received: 123 in 70 posts
Joined: Mar 2010
Reputation: 18

SphereCommunity

Post: #12
RE: random 1 player in region
Thats why I used the CLEARTAGS function Wink

AxisII's current version: 2.0.4j
AxisII SourceCode on Github
AxisII up to date changelog
09-03-2012 10:46 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)