@reward script error help

OverLord

New member
Messages
168
Points
0
Age
36
Location
Brazil
Emulator
If i use preset system, for @reward 1 nick, or @reward 2 nick, WORK! But after @reward 3 ... dont work o.O, this script from rAthena, anyone help me to fix ?

The error ON LINE 74

 

if (!atoi(.@atcmd_parameters$[0]) || (atoi(.@atcmd_parameters$[0]) - 1) * 2 > .@atcmd_numparameters) {

If i remove:  || (atoi(.@atcmd_parameters$[0]) - 1) * 2 > .@atcmd_numparameters 

The script work fine, but i got bug if a GM use ID high of max preset

 
Last edited by a moderator:
Change the condition to :

Code:
if (!atoi(.@atcmd_parameters$[0]) || 	atoi(.@atcmd_parameters$[0]) <= 0 || 	atoi(.@atcmd_parameters$[0]) > getarraysize(.preset_id) / 2) {	//...}
 
Thx
default_smile.png
work

 
Back
Top