Innos Posted October 11, 2017 Posted October 11, 2017 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. Quote
0 Skorm Posted October 11, 2017 Posted October 11, 2017 atoi stands for ASCII to Integer. String -> Number getitemname uses an integer value you don't need to use atoi. 2 Quote
0 Haruka Mayumi Posted October 12, 2017 Posted October 12, 2017 (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 October 12, 2017 by Haruka Mayumi 1 Quote
0 Innos Posted October 12, 2017 Author Posted October 12, 2017 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! Quote
0 Haruka Mayumi Posted October 12, 2017 Posted October 12, 2017 (edited) oh yes. i forgot to change that too =) You're welcome Edited October 12, 2017 by Haruka Mayumi Typo Quote
Question
Innos
Can everyone help me for my Script.
I have Problems with
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.
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.