variablename is global
_variablename is local.
heres an example, we will start on _variablename first, since _variablename is a local variable it can only be accessed by the script/.sqf file that it is in, lets say you have 2 .sqf files, one with a addaction to display a hint / message, and the other to write the message.
addmessage.sqf
Code:
_message = 4;
start = {
player addAction ["display variable value", displayv];
};
displayv = {
execVM "displaymessage.sqf";
};
displaymessage.sqf
Code:
hint format [" the value of the message variable is %1", _message];
see this wont work, inside of the displaymessage.sqf, it doesn't know what _message is, that is because it is local, only the file called addmessage.sqf knows what it is since the local variable was defined inside of that file. now if you were to replace that with this
addmessage.sqf
Code:
message = 4;
start = {
player addAction ["display variable value", displayv];
};
displayv = {
execVM "displaymessage.sqf";
};
displaymessage.sqf
Code:
hint format [" the value of the message variable is %1", _message];
as you can see i changed the variable _message to message, message is now global so displaymessage.sqf and all other files know what the variable message is and it can be accessed from any file that you want since it is global.
also player is yourself, for instance if your making a scroll menu(to cheat im assuming) you would use player as it would be for you and only you such as player addAction(as shown above).
now if you were making a mission for many people to play and you used player( we will use the init.sqf for example since that file of the mission is ran on everybody's computer), then it would show for everybody since everybodys computer is running the mission.