emundus Posted March 7, 2023 Group: Members Topic Count: 6 Topics Per Day: 0.01 Content Count: 37 Reputation: 7 Joined: 03/07/23 Last Seen: December 8, 2024 Share Posted March 7, 2023 Basically is a script that, when the player creates a new character and login for the first time shows a box to select the rates (low, mid or high). Need to be changed ONLY for the player that selected that rate, no for the whole server (that was the only way I could do it). And the message don't show more when the player login in the char, ONLY for the first time.. Can someone help, please? 1 Quote Link to comment Share on other sites More sharing options...
0 ryzenthird Posted May 15, 2023 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 23 Reputation: 3 Joined: 10/31/12 Last Seen: February 17, 2024 Share Posted May 15, 2023 (edited) Try this - script SelectRate -1,{ OnPCLoginEvent: if(!server_preferred_rate){ mes "Select Your Preferred Server Rates"; switch(select("High Rate:Mid Rate:Low Rate")){ case 1: mes "Thank you for choosing!"; set server_preferred_rate,1; close; case 2: mes "Thank you for Choosing!"; set server_preferred_rate,2; close; case 3: mes "Thank you for Choosing!"; set server_preferred_rate,3; close default: mes "Please relogin to choose!"; close; } } OnShowStatistics: query_sql("SELECT COUNT(*) FROM char_reg_num WHERE `key` = 'server_preferred_rate' AND `value` = 1",.@highratecount); query_sql("SELECT COUNT(*) FROM char_reg_num WHERE `key` = 'server_preferred_rate' AND `value` = 2",.@midratecount); query_sql("SELECT COUNT(*) FROM char_reg_num WHERE `key` = 'server_preferred_rate' AND `value` = 3",.@lowratecount); mes "This is the current statistics"; mes "High Rate Count : ("+.@highratecount+")"; mes "Mid Rate : ("+.@midratecount+")"; mes "Low Rate : ("+.@lowratecount+")"; close; OnInit: bindatcmd("showstatistics",strnpcinfo(3)+"::OnShowStatistics",99,99); end; } Edited May 15, 2023 by ryzenthird Wrong SQL Query 1 Quote Link to comment Share on other sites More sharing options...
0 emundus Posted February 24, 2024 Group: Members Topic Count: 6 Topics Per Day: 0.01 Content Count: 37 Reputation: 7 Joined: 03/07/23 Last Seen: December 8, 2024 Author Share Posted February 24, 2024 On 5/15/2023 at 12:10 AM, ryzenthird said: Try this - script SelectRate -1,{ OnPCLoginEvent: if(!server_preferred_rate){ mes "Select Your Preferred Server Rates"; switch(select("High Rate:Mid Rate:Low Rate")){ case 1: mes "Thank you for choosing!"; set server_preferred_rate,1; close; case 2: mes "Thank you for Choosing!"; set server_preferred_rate,2; close; case 3: mes "Thank you for Choosing!"; set server_preferred_rate,3; close default: mes "Please relogin to choose!"; close; } } OnShowStatistics: query_sql("SELECT COUNT(*) FROM char_reg_num WHERE `key` = 'server_preferred_rate' AND `value` = 1",.@highratecount); query_sql("SELECT COUNT(*) FROM char_reg_num WHERE `key` = 'server_preferred_rate' AND `value` = 2",.@midratecount); query_sql("SELECT COUNT(*) FROM char_reg_num WHERE `key` = 'server_preferred_rate' AND `value` = 3",.@lowratecount); mes "This is the current statistics"; mes "High Rate Count : ("+.@highratecount+")"; mes "Mid Rate : ("+.@midratecount+")"; mes "Low Rate : ("+.@lowratecount+")"; close; OnInit: bindatcmd("showstatistics",strnpcinfo(3)+"::OnShowStatistics",99,99); end; } Thank you, I had some personal problems and couldn't see the answer.. I have a question: how will this influence that character's rates on the server? Quote Link to comment Share on other sites More sharing options...
0 Winterfox Posted February 25, 2024 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 245 Reputation: 93 Joined: 06/30/18 Last Seen: November 27, 2024 Share Posted February 25, 2024 (edited) On 2/24/2024 at 11:05 AM, emundus said: Thank you, I had some personal problems and couldn't see the answer.. I have a question: how will this influence that character's rates on the server? It won't influence the individual rates. What he provides is more or less just a poll. I think there is no direct way to overwrite rates directly for an individual player. But what you could do is set the rates of your server to default and use status changes to give each player an exp and drop bonus according to his choice to basically get the effect of different rates. - script RateSelect -1,{ OnSetRate: OnPCLoginEvent: switch(individual_rate) { case 1: .@exp_rate_bonus = .low_rate_exp_bonus; .@drop_rate_bonus = .low_rate_drop_bonus; break; case 2: .@exp_rate_bonus = .mid_rate_exp_bonus; .@drop_rate_bonus = .mid_rate_drop_bonus; break; case 3: .@exp_rate_bonus = .high_rate_exp_bonus; .@drop_rate_bonus = .high_rate_drop_bonus; break; default: mes "Select your preferred server rate for this character."; mes "BE CAREFUL: YOU CAN'T CHANGE IT AFTERWARD!" individual_rate = select("Low Rate:Mid Rate:High Rate"); close2; goto OnSetRate; } sc_start SC_EXPBOOST, INFINITE_TICK, .@exp_rate_bonus, 10000, SCSTART_NOICON; sc_start SC_ITEMBOOST, INFINITE_TICK, .@drop_rate_bonus, 10000, SCSTART_NOICON; end; OnInit: .low_rate_exp_bonus = 100; .mid_rate_exp_bonus = 19900; .high_rate_exp_bonus = 199900; .low_rate_drop_bonus = 100; .mid_rate_drop_bonus = 19900; .high_rate_drop_bonus = 199900; } Edited February 26, 2024 by Winterfox 2 Quote Link to comment Share on other sites More sharing options...
0 emundus Posted February 26, 2024 Group: Members Topic Count: 6 Topics Per Day: 0.01 Content Count: 37 Reputation: 7 Joined: 03/07/23 Last Seen: December 8, 2024 Author Share Posted February 26, 2024 On 2/25/2024 at 8:50 AM, Winterfox said: It won't influence the individual rates. What he provides is more or less just a poll. I think there is no direct way to overwrite rates directly for an individual player. But what you could do is set the rates of your server to default and use status changes to give each player an exp and drop bonus according to his choice to basically get the effect of different rates. - script RateSelect -1,{ OnSetRate: OnPCLoginEvent: switch(individual_rate) { case 1: .@exp_rate_bonus = .low_rate_exp_bonus; .@drop_rate_bonus = .low_rate_drop_bonus; break; case 2: .@exp_rate_bonus = .mid_rate_exp_bonus; .@drop_rate_bonus = .mid_rate_drop_bonus; break; case 3: .@exp_rate_bonus = .high_rate_exp_bonus; .@drop_rate_bonus = .high_rate_drop_bonus; break; default: mes "Select your preferred server rate for this character."; mes "BE CAREFUL: YOU CAN'T CHANGE IT AFTERWARD!" individual_rate = select("Low Rate:Mid Rate:High Rate"); close2; goto OnSetRate; } sc_start SC_EXPBOOST, INFINITE_TICK, .@exp_rate_bonus; sc_start SC_ITEMBOOST, INFINITE_TICK, .@drop_rate_bonus; end; OnInit: .low_rate_exp_bonus = 2; .mid_rate_exp_bonus = 20; .high_rate_exp_bonus = 200; .low_rate_drop_bonus = 2; .mid_rate_drop_bonus = 20; .high_rate_drop_bonus = 200; } I would like to thank you very much for the support provided, could you answer some questions regarding the script? 1. Are other boost items applicable separately or do they accumulate with the script boosts? 2. is the rate based on, for example, 2x 20x and 200x? Thanks Quote Link to comment Share on other sites More sharing options...
0 Winterfox Posted February 26, 2024 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 245 Reputation: 93 Joined: 06/30/18 Last Seen: November 27, 2024 Share Posted February 26, 2024 (edited) 1. I don't know how the status changes accumulate if you stack them. But I think it isn't hard for you to test that, simply choose a rate and use an item like bubble gum and check how it influences your rate. 2. If your server is configured to have the default rates, those would be 1x, when a player chooses low it would add a bonus of 100% so 2x, on mid 19900% or 20x etc. It is good that you asked, since I realized I made a mistake in the script above and could correct it. Edited February 26, 2024 by Winterfox 1 Quote Link to comment Share on other sites More sharing options...
0 emundus Posted February 26, 2024 Group: Members Topic Count: 6 Topics Per Day: 0.01 Content Count: 37 Reputation: 7 Joined: 03/07/23 Last Seen: December 8, 2024 Author Share Posted February 26, 2024 3 minutes ago, Winterfox said: 1. I don't know how the status changes accumulate if you stack them. But i think it isn't hard for you to test that, simply choose a rate and use an item like bubble gum and check how it influences your rate. 2. If your server is configured to have the default rates those would be 1x, when a player chooses low it would add a bonus of 200% so 2x, on mid 2000% or 20x etc. Thank you so much, I will test and leave a feedback Quote Link to comment Share on other sites More sharing options...
0 emundus Posted February 26, 2024 Group: Members Topic Count: 6 Topics Per Day: 0.01 Content Count: 37 Reputation: 7 Joined: 03/07/23 Last Seen: December 8, 2024 Author Share Posted February 26, 2024 - script RateSelect -1,{ OnSetRate: OnPCLoginEvent: switch(individual_rate) { case 1: .@exp_rate_bonus = .low_rate_exp_bonus; .@drop_rate_bonus = .low_rate_drop_bonus; break; case 2: .@exp_rate_bonus = .mid_rate_exp_bonus; .@drop_rate_bonus = .mid_rate_drop_bonus; break; case 3: .@exp_rate_bonus = .high_rate_exp_bonus; .@drop_rate_bonus = .high_rate_drop_bonus; break; default: mes "Selecione suas rates preferidas para este personagem."; mes "TENHA CUIDADO: VOCÊ NÃO PODE MUDAR DEPOIS!"; mes "[Rates EXP/Drop %]"; mes "- Low Rates:" + .low_rate_exp_bonus + ", " + .low_rate_drop_bonus + "."; mes "- Mid Rates:" + .mid_rate_exp_bonus + ", " + .mid_rate_drop_bonus + "."; mes "- High Rates:" + .high_rate_exp_bonus + ", " + .high_rate_drop_bonus + "."; individual_rate = select("- Low Rate:- Mid Rate:- High Rate"); close2; goto OnSetRate; } sc_start SC_EXPBOOST, INFINITE_TICK, .@exp_rate_bonus; sc_start SC_ITEMBOOST, INFINITE_TICK, .@drop_rate_bonus; end; OnInit: .low_rate_exp_bonus = 200; .mid_rate_exp_bonus = 2000; .high_rate_exp_bonus = 20000; .low_rate_drop_bonus = 200; .mid_rate_drop_bonus = 2000; .high_rate_drop_bonus = 20000; } I translated it into my language and added the information on rates, would the code be like this? Quote Link to comment Share on other sites More sharing options...
0 Winterfox Posted February 26, 2024 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 245 Reputation: 93 Joined: 06/30/18 Last Seen: November 27, 2024 Share Posted February 26, 2024 25 minutes ago, emundus said: - script RateSelect -1,{ OnSetRate: OnPCLoginEvent: switch(individual_rate) { case 1: .@exp_rate_bonus = .low_rate_exp_bonus; .@drop_rate_bonus = .low_rate_drop_bonus; break; case 2: .@exp_rate_bonus = .mid_rate_exp_bonus; .@drop_rate_bonus = .mid_rate_drop_bonus; break; case 3: .@exp_rate_bonus = .high_rate_exp_bonus; .@drop_rate_bonus = .high_rate_drop_bonus; break; default: mes "Selecione suas rates preferidas para este personagem."; mes "TENHA CUIDADO: VOCÊ NÃO PODE MUDAR DEPOIS!"; mes "[Rates EXP/Drop %]"; mes "- Low Rates:" + .low_rate_exp_bonus + ", " + .low_rate_drop_bonus + "."; mes "- Mid Rates:" + .mid_rate_exp_bonus + ", " + .mid_rate_drop_bonus + "."; mes "- High Rates:" + .high_rate_exp_bonus + ", " + .high_rate_drop_bonus + "."; individual_rate = select("- Low Rate:- Mid Rate:- High Rate"); close2; goto OnSetRate; } sc_start SC_EXPBOOST, INFINITE_TICK, .@exp_rate_bonus; sc_start SC_ITEMBOOST, INFINITE_TICK, .@drop_rate_bonus; end; OnInit: .low_rate_exp_bonus = 200; .mid_rate_exp_bonus = 2000; .high_rate_exp_bonus = 20000; .low_rate_drop_bonus = 200; .mid_rate_drop_bonus = 2000; .high_rate_drop_bonus = 20000; } I translated it into my language and added the information on rates, would the code be like this? Looks correct. 1 Quote Link to comment Share on other sites More sharing options...
0 emundus Posted February 26, 2024 Group: Members Topic Count: 6 Topics Per Day: 0.01 Content Count: 37 Reputation: 7 Joined: 03/07/23 Last Seen: December 8, 2024 Author Share Posted February 26, 2024 1 hour ago, Winterfox said: 1. I don't know how the status changes accumulate if you stack them. But I think it isn't hard for you to test that, simply choose a rate and use an item like bubble gum and check how it influences your rate. 2. If your server is configured to have the default rates, those would be 1x, when a player chooses low it would add a bonus of 200% so 2x, on mid 2000% or 20x etc. It is good that you asked, since I realized I made a mistake in the script above and could correct it. the item buffs do not add up to the script buff Quote Link to comment Share on other sites More sharing options...
0 emundus Posted February 26, 2024 Group: Members Topic Count: 6 Topics Per Day: 0.01 Content Count: 37 Reputation: 7 Joined: 03/07/23 Last Seen: December 8, 2024 Author Share Posted February 26, 2024 (edited) I'll leave it like that, thanks! Edited February 26, 2024 by emundus Quote Link to comment Share on other sites More sharing options...
0 emundus Posted February 26, 2024 Group: Members Topic Count: 6 Topics Per Day: 0.01 Content Count: 37 Reputation: 7 Joined: 03/07/23 Last Seen: December 8, 2024 Author Share Posted February 26, 2024 52 minutes ago, Winterfox said: Looks correct. Can you help me to create a code for a command (@myrates) showing the selected rates? I thought about, when selecting the rates, saving a variable in the character (char_reg_num) specifying the chosen rates and then showing it in the command @myrates... Quote Link to comment Share on other sites More sharing options...
0 emundus Posted February 26, 2024 Group: Members Topic Count: 6 Topics Per Day: 0.01 Content Count: 37 Reputation: 7 Joined: 03/07/23 Last Seen: December 8, 2024 Author Share Posted February 26, 2024 38 minutes ago, emundus said: Can you help me to create a code for a command (@myrates) showing the selected rates? I thought about, when selecting the rates, saving a variable in the character (char_reg_num) specifying the chosen rates and then showing it in the command @myrates... I ended up creating the command with the values manually, thanks for the support @Winterfox! Quote Link to comment Share on other sites More sharing options...
Question
emundus
Basically is a script that, when the player creates a new character and login for the first time shows a box to select the rates (low, mid or high).
Need to be changed ONLY for the player that selected that rate, no for the whole server (that was the only way I could do it).
And the message don't show more when the player login in the char, ONLY for the first time..
Can someone help, please?
Link to comment
Share on other sites
12 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.