I created this cmd but now when I write the cmd it shows Member variable not found any help??
else if (cmd == "changeworld")
{
player.world=2;
MessagePlayer("world changed!", player);
}
W
Make the 'w' uppercase.
Squirrel is a case sensitive programming language. And its player.World So player.world wont work.
replace
player.world=2;
With
player.World=2;
What do you understand by "Member variable"? It means the variable you used with player instance. And, "not found" means it doesn't exists. So, "Member variable not found" means player.TheVariableYouUsed doesn't exist. Hence, in this context, player.world doesn't exist.
Were the last 3 posts really needed? Do you people here battle for the post-count or something?
Quote from: jWeb on Oct 02, 2016, 12:39 PMWere the last 3 posts really needed? Do you people here battle for the post-count or something?
Quote from: jWeb on Oct 02, 2016, 10:47 AMW
Tell me, what would you understand by this?
For ex: "Hello, why is this not working: player.world=2;" reply: "W", new code: "player.worldw=2;" or something similar. Really, trust me, people are like that here, they won't understand your one-letter solution :)
It's an UPPERCASE W. There's only one W in his code. If you need more than that then you're not suited to be anywhere near a line of code.
I used W uppercased and Also lowercased but still the same thing....
Quote from: Shovon^ on Oct 02, 2016, 03:22 PMI used W uppercased and Also lowercased but still the same thing....
In that case 'player' is not what you think it is.
typeof