kerbiii 5 Posted December 15, 2013 i got this error: [Warning]: Unexpected type for argument 1. Expected number.[Debug]: Data: variable name='.@atcmd_parameters$' index=0[Debug]: Function: getmonsterinfo[Debug]: Source (NPC): at_monster (invisible/not on a map) this is my script: - script at_monster -1,{ OnInit: bindatcmd "monster",strnpcinfo(3)+"::OnAtcommand",0,99; end; OnAtcommand: atcommand "@monster " +implode(.@atcmd_parameters$, " "); announce "[ "+strcharinfo(0)+" ] spawned "+(.@atcmd_parameters$[1]==""?1:.@atcmd_parameters$[1])+" "+getmonsterinfo(.@atcmd_parameters$[0], 0)+" on "+strcharinfo(3)+"!",0; end;} Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted December 15, 2013 (edited) - script at_monster -1,{ OnInit: bindatcmd "monster",strnpcinfo(3)+"::OnAtcommand",0,99; end; OnAtcommand: atcommand "@monster " +implode(.@atcmd_parameters$, " "); announce "[ "+strcharinfo(0)+" ] spawned "+(.@atcmd_parameters$[1]==""?1:.@atcmd_parameters$[1])+" "+getmonsterinfo(atoi(.@atcmd_parameters$[0]), 0)+" on "+strcharinfo(3)+"!",0; end;} You inputted number, but .@atcmd_parameters$[0] is a string($ at end indicates its a string variable), so just use atoi for it. Edited December 15, 2013 by Dastgir Pojee 1 kerbiii reacted to this Quote Share this post Link to post Share on other sites
0 Patskie 88 Posted December 15, 2013 - getmonsterinfo(.@atcmd_parameters$[0], 0)+ getmonsterinfo(atoi(.@atcmd_parameters$[0]), 0) Quote Share this post Link to post Share on other sites
i got this error:
this is my script:
Share this post
Link to post
Share on other sites