Bringer Posted April 6, 2017 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 746 Reputation: 47 Joined: 03/12/14 Last Seen: 1 hour ago Share Posted April 6, 2017 (edited) prontera,145,150,5 script Sample 56,{ if( BaseLevel == 99 && JobLevel == 700 && reward_lvl == 0 && Upper && .count < 100 ){ if( .count < 3 ) getitem 714,1; if( .count < 100 ) getitem 7227,1; reward_lvl++; .count++; announce "Congratulations " + strcharinfo(0) + " for receiving the level 99 reward, there are only "+ (100-.count) +" rewards left!",0; } else if ( reward_lvl ) { mes "you already get your reward"; close; } else if ( BaseLevel != 99 && JobLevel != 70 ) { mes "you are not lvl 99/70 "; close; } end; OnInit: .count = query_sql( "select `value` from `global_reg_value` where `str`= 'reward_lvl'", .@value ); if ( .count >99 ) end; // limit to 127 players online here .@size = query_sql( "select `account_id` from `char` where `char_id` not in ( select `char_id` from `global_reg_value` where `str`= 'reward_lvl' ) and `online`=1", .@account_id ); for ( .@i = 0; .@i < .@size; .@i++ ) { attachrid .@account_id[.@i]; if ( reward_lvl ) { .count++; if ( .count >99 ) end; } } end; } solved `global_reg_value` to `acc_reg_num` `str` to `key` Edited April 6, 2017 by Bringer Quote Link to comment Share on other sites More sharing options...
Question
Bringer
prontera,145,150,5 script Sample 56,{ if( BaseLevel == 99 && JobLevel == 700 && reward_lvl == 0 && Upper && .count < 100 ){ if( .count < 3 ) getitem 714,1; if( .count < 100 ) getitem 7227,1; reward_lvl++; .count++; announce "Congratulations " + strcharinfo(0) + " for receiving the level 99 reward, there are only "+ (100-.count) +" rewards left!",0; } else if ( reward_lvl ) { mes "you already get your reward"; close; } else if ( BaseLevel != 99 && JobLevel != 70 ) { mes "you are not lvl 99/70 "; close; } end; OnInit: .count = query_sql( "select `value` from `global_reg_value` where `str`= 'reward_lvl'", .@value ); if ( .count >99 ) end; // limit to 127 players online here .@size = query_sql( "select `account_id` from `char` where `char_id` not in ( select `char_id` from `global_reg_value` where `str`= 'reward_lvl' ) and `online`=1", .@account_id ); for ( .@i = 0; .@i < .@size; .@i++ ) { attachrid .@account_id[.@i]; if ( reward_lvl ) { .count++; if ( .count >99 ) end; } } end; }
solved
`global_reg_value` to `acc_reg_num`
`str` to `key`
Edited by BringerLink to comment
Share on other sites
0 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.