(1) the label before the function name defines the type of value returned by the function. In your case this should be string
(2) objeo as you have described it is a string variable, not a function which returns a string.
if your function named treasure is to return a string (I assume the string is a resref for a treasure blueprint), then you should do as follows:
string treasure()
{
string objeo; // this is a variable. it will hold the string that is returned by the function treasure
int azarss =Random(3)+ 1;
if (azarss==1)
objeo = "a";
else if (azarss==2)
objeo = "b";
else if (azarss==3)
objeo = "c";
return objeo;
}
[edit: ooops. failed bard got to this first. ]
Modifié par henesua, 08 novembre 2012 - 01:34 .