Jump to content
  • 0
Sign in to follow this  
glemor123

@warp payment required

Question

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:
	[email protected]$ = strtolower([email protected]_parameters$[0]);
	dispbottom "It cost you 1,000 zeny to warp.";
	if([email protected]_numparameters == 1 || [email protected]_numparameters == 3){
		if ( Zeny > 1000 ){
			set Zeny, Zeny - 1000;
			warp [email protected]$,atoi([email protected]_parameters$[1]),atoi([email protected]_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.
 

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

try this

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

	[email protected]$ = strtolower([email protected]_parameters$[0]);
	[email protected] = atoi([email protected]_parameters$[1]);
	[email protected] = atoi([email protected]_parameters$[2]);
	if([email protected]_numparameters == 1){
		if(compare([email protected]$,",")){
			explode([email protected]o$, [email protected]$, ",");
			[email protected]$ = [email protected]$[0];
			[email protected] = atoi([email protected]$[1]);
			[email protected] = atoi([email protected]$[2]);
		}
	}
	dispbottom "It cost you 1,000 zeny to warp.";
	if ( Zeny > 1000 ){
		set Zeny, Zeny - 1000;
			warp [email protected]$,[email protected],[email protected];
		end;
	}
	dispbottom "Can't warp you. You don't have zeny.";
	end;
}

 

  • Love 1

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.   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.

Sign in to follow this  

×
×
  • Create New...

Important Information

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