Jump to content
  • 0

Lucky player of the day


Quesooo

Question


  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.07
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

good day masters can you help me to make this script to a random items??

 

if the player pick the lucky player of the day he will get a random item base on my script

 

thank you so much

 

this is the script

 

-	script	LuckyPlayer	-1,{

OnInit:
OnClock0000:
set .LuckyTime,rand(24);
OnMinute00:
if( gettime(3) == .LuckyTime ){
set .DelayMin,rand(60);
sleep ( rand(60) * 1000 );
while(1){
 query_sql "select account_id from `char` where online = 1 order by rand() limit 1", .@aid;
 attachrid .@aid;
 if( CheckVending() ){
  DetachRID();
  continue;
  }
 announce strcharinfo(0) +" Get 1 Old Gift Box for Lucky Player of the day!", 0,0x00FF00;
 getitem 12244,1;
 dispbottom "you got 1 Old Gift Box";
 break;
}
}
end;
}

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2350
  • Joined:  10/28/11
  • Last Seen:  

getitem 12244,1;

change to

getitem F_Rand( 501,502,503,504,505,506,507 ),1;

 

  • Upvote 1
Link to comment
Share on other sites

  • 1

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  235
  • Reputation:   55
  • Joined:  12/02/11
  • Last Seen:  

1 hour ago, Questune09 said:

good day masters can you help me to make this script to a random items??

 

if the player pick the lucky player of the day he will get a random item base on my script

 

thank you so much

 

this is the script

 


-	script	LuckyPlayer	-1,{

OnInit:
OnClock0000:
set .LuckyTime,rand(24);
OnMinute00:
if( gettime(3) == .LuckyTime ){
set .DelayMin,rand(60);
sleep ( rand(60) * 1000 );
while(1){
 query_sql "select account_id from `char` where online = 1 order by rand() limit 1", .@aid;
 attachrid .@aid;
 if( CheckVending() ){
  DetachRID();
  continue;
  }
 announce strcharinfo(0) +" Get 1 Old Gift Box for Lucky Player of the day!", 0,0x00FF00;
 getitem 12244,1;
 dispbottom "you got 1 Old Gift Box";
 break;
}
}
end;
}

 

 
 

 

 

	-    script    LuckyPlayer    -1,{
	OnInit:
OnClock0000:
set .LuckyTime,rand(24);
OnMinute00:
    if( gettime(3) == .LuckyTime ){
    set .DelayMin,rand(60);
    sleep ( rand(60) * 1000 );
    while(1) {
        query_sql "select account_id from `char` where online = 1 order by rand() limit 1", .@aid;
        attachrid .@aid;
        if( CheckVending() ) {
            DetachRID();
            continue;
        }
        announce strcharinfo(0) +" Get 1 Old Gift Box for Lucky Player of the day!", 0,0x00FF00;
        getitem F_Rand ( 1,2,3,4,5,6,7),1; // <item_id>
            dispbottom "you got 1 Old Gift Box";
            break;
        }
    }
    end;
}
	

 

Didn't know Emistry got the respond first.

Edited by Kaze
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

what you mean by random? from whole itemdb ?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.07
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

sorry for bad English

 

i mean a lucky player will get a random item?

 

but only 1 item

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  197
  • Topics Per Day:  0.07
  • Content Count:  883
  • Reputation:   28
  • Joined:  02/13/17
  • Last Seen:  

thank  you ^_^

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...