cassie24 Posted June 27, 2014 Posted June 27, 2014 Can I request for a script where a random online player could be generated and be given a reward? It must be activated by a GM and not automated. Pls help TY Quote
Jyabil Posted June 27, 2014 Posted June 27, 2014 (edited) As per the script that EL Dragon posted, here's a GM activated version. prontera,100,100,4 script Who's Online Event 99,{ if (getgroupid() == 99) goto Event_Menu; mes "[Who's Online Event]"; mes "Only GM's are allowed to use this NPC."; close; Event_Menu: set .@invokeid,getcharid(3); mes "[Who's Online Event]"; mes "Enable event?"; menu "Yes",-,"No",Event_End; 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) +" won 500 Cash in Who's Online Event", 0,0x00FF00; set #CASHPOINTS,#CASHPOINTS+500; dispbottom "You got 500 cash point"; break; } attachrid(.@invokeID); close; Event_End: close; } Edited June 27, 2014 by Jyabil Quote
EL Dragon Posted June 27, 2014 Posted June 27, 2014 (edited) aw fail sorry its atomatic xD Edited June 27, 2014 by EL Dragon Quote
cassie24 Posted June 27, 2014 Author Posted June 27, 2014 Its okay, can I see the script again, sir? Quote
EL Dragon Posted June 27, 2014 Posted June 27, 2014 sorry it was automatic script //http://rathena.org/board/topic/53877-lucky-pick-event/ //emistry script - script AutoFunEvent -1,{ OnInit: OnClock0000: set .LuckyTime,rand(24); OnMinute00: if( gettime(3) == .LuckyTime ){ set .DelayMin,rand(60); sleep ( .DelayMin * 60000 ); 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) +" won 500 Cash in Lucky Pick Event", 0,0x00FF00; set #CASHPOINTS,#CASHPOINTS+500; dispbottom "you got 500 cash point"; break; } } end; } Quote
cassie24 Posted June 28, 2014 Author Posted June 28, 2014 Thanks El Dragon and Jyabil, but how can I set the prize to item ID though? And also announce a line before actually announcing who's the winner? Quote
Jyabil Posted June 28, 2014 Posted June 28, 2014 (edited) Thanks El Dragon and Jyabil, but how can I set the prize to item ID though? And also announce a line before actually announcing who's the winner? If you want the prize to be items instead of cash points, remove set #CASHPOINTS,#CASHPOINTS+500; and change it to getitem 501,1; // In example, this code will give you 1 pc of Red Potion To add announcement, add these before the announcing of the winner announce "Your Message Here",0,0x00FF00; sleep 1000; // 1 second delay before announcing the winner, configure it to your liking Edited June 28, 2014 by Jyabil 1 Quote
cassie24 Posted June 28, 2014 Author Posted June 28, 2014 Jyabil thanks but I figured it out already earlier, just based it to some existing scripts and it worked! Thanks very much Jyabil! Quote
Potato Chips Posted September 2, 2014 Posted September 2, 2014 sorry it was automatic script //http://rathena.org/board/topic/53877-lucky-pick-event/ //emistry script - script AutoFunEvent -1,{ OnInit: OnClock0000: set .LuckyTime,rand(24); OnMinute00: if( gettime(3) == .LuckyTime ){ set .DelayMin,rand(60); sleep ( .DelayMin * 60000 ); 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) +" won 500 Cash in Lucky Pick Event", 0,0x00FF00; set #CASHPOINTS,#CASHPOINTS+500; dispbottom "you got 500 cash point"; break; } } end; } If im not mistaken this is every 1 hour? Quote
MusiLiciouS Posted December 8, 2014 Posted December 8, 2014 Can someon give ascript of this where it is automated in a certain time. like it will be picking 1 lucky player every 7pm Quote
cutekram Posted August 30, 2015 Posted August 30, 2015 Sir how to add time for example i want it to set 4 times a day if i would like to pick 12PM 5PM 9PM it this gonna be like this? OnInit: OnClock1200: OnClock1700: OnClock2100: set .LuckyTime,rand(24);OnMinute00:if( gettime(3) == .LuckyTime ){ Quote
Question
cassie24
Can I request for a script where a random online player could be generated and be given a reward? It must be activated by a GM and not automated. Pls help TY
10 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.