Jump to content

Question

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;}

 

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
-	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 by Dastgir Pojee

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.