Jump to content
  • 0

Script Help with atoi itemname


Question

Posted

Can everyone help me for my Script.

I have Problems with

set .@itemname$, getitemname( atoi( .@risk_price ) );

mes " ~ "+.@itemname$+""; give me not the right Item Name after the second try. And i mean the answer is not the right item id in the array, it's only the first id.

1.PNG

4 answers to this question

Recommended Posts

  • 0
Posted (edited)

What happened in your script is.

the value of risk_price is being converted from Integer to Integer.. 

atoi only accept String to integer.

As you can see on the error, it says "Expected String"

Here's the right code i guess =)

riskPlay:
	setarray .@risk_price[0],501,502,503,504,504;
	set .@randitem, rand(0,getarraysize(.@risk_price ) );
	set .@itemname$, getitemname( .@risk_price[.@randitem] );
	set .@win,rand(0,1);
	if(.@win == 1){
		mes "You won!";
		mes " ~ "+.itemname$;
		getitem .@risk_price[.@randitem],1;
	}else{
		mes "You Lose";
	}

 

Edited by Haruka Mayumi
  • Like 1
  • 0
Posted

with  change

6 hours ago, Haruka Mayumi said:

mes " ~ "+.itemname$;

to

6 hours ago, Haruka Mayumi said:

mes " ~ "+.@itemname$;

works perfectly.

Thanks for your help!

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...