I simply want to return a region so that a region may be selected depending on the triggering player. Anytime I try to return a region the compiler tells me that it needs to return a value... Please help me... In simple words I want to convert a Region into a valuable value that could be used in my code...
Edit :Current code
region gf_AssociateplayersspawnswithRegions () {
// Implementation
if ((EventPlayer() == 1)) {
return RegionFromId(24);
}
else {
}
}
From the code I see pasted above, you're getting a return value expected error because the function must ALWAYS return something, and the way you have it set up, it only has a return value if the if clause is true, so you also need to add a return outside of the if, or inside the else, to make sure the function always returns something.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I simply want to return a region so that a region may be selected depending on the triggering player. Anytime I try to return a region the compiler tells me that it needs to return a value... Please help me... In simple words I want to convert a Region into a valuable value that could be used in my code...
Edit :Current code
region gf_AssociateplayersspawnswithRegions () {
// Implementation
if ((EventPlayer() == 1)) {
return RegionFromId(24);
}
else {
}
}
error : Expected a return value
From the code I see pasted above, you're getting a return value expected error because the function must ALWAYS return something, and the way you have it set up, it only has a return value if the if clause is true, so you also need to add a return outside of the if, or inside the else, to make sure the function always returns something.