Jump to content
  • 0

@warp payment required


darking123

Question


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  931
  • Reputation:   13
  • Joined:  12/20/11
  • Last Seen:  

Script works if command is issued via @warp prontera 123 123

 

However is I tried to warp with comma like @warp prontera,123,123 then an issue exist. may I ask to help fix the written script. Thanks!

-	script	war_pay	-1,{
OnInit:
bindatcmd "warp",strnpcinfo(3)+"::OnWarpCommand";
end;
OnWarpCommand:
	.@command$ = strtolower(.@atcmd_parameters$[0]);
	dispbottom "It cost you 1,000 zeny to warp.";
	if(.@atcmd_numparameters == 1 || .@atcmd_numparameters == 3){
		if ( Zeny > 1000 ){
			set Zeny, Zeny - 1000;
			warp .@command$,atoi(.@atcmd_parameters$[1]),atoi(.@atcmd_parameters$[2]);
			end;
		} 
		if ( Zeny < 1000 ){
			dispbottom "Can't warp you. You don't have zeny.";
			end;
		}
	}

	
}


 

Error as seen below when using @warp with comma.

[Warning]: (mapindex_normalize_name) Map name '                prontera,123,123' is too long!
[Debug]: (buildin_warp) mapindex_name2id: Map "prontera,12" not found in index list!
[Debug]: pc_setpos: Passed mapindex(0) is invalid!
[Error]: buildin_warp: moving player 'awesome' to "prontera,123,123",0,0 failed.
 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   703
  • Joined:  12/21/14
  • Last Seen:  

try this

-	script	war_pay	-1,{
OnInit:
bindatcmd "warp",strnpcinfo(3)+"::OnWarpCommand";
end;
OnWarpCommand:
	if(.@atcmd_numparameters != 1 && .@atcmd_numparameters != 3){
		dispbottom "@warp Failed.";
		dispbottom "@warp <map_name> <x> <y>";
		dispbottom "@warp <map_name>,<x>,<y>";
		end;
	}

	.@command$ = strtolower(.@atcmd_parameters$[0]);
	.@x = atoi(.@atcmd_parameters$[1]);
	.@y = atoi(.@atcmd_parameters$[2]);
	if(.@atcmd_numparameters == 1){
		if(compare(.@command$,",")){
			explode(.@info$, .@command$, ",");
			.@command$ = .@info$[0];
			.@x = atoi(.@info$[1]);
			.@y = atoi(.@info$[2]);
		}
	}
	dispbottom "It cost you 1,000 zeny to warp.";
	if ( Zeny > 1000 ){
		set Zeny, Zeny - 1000;
			warp .@command$,.@x,.@y;
		end;
	}
	dispbottom "Can't warp you. You don't have zeny.";
	end;
}

 

  • Love 1
Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...