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