I've got a GUI (modified from the existing Statusline), and on it is a button (btnPortrait) which is intended to change depending on which character the player is using, with a global int variable "whoisplayer". The way I've got it set up at the moment is:
if (whoisplayer = 1) {
btnportrait.NormalGraphic = 74;
}
As far I thought, it should have set the button to look like sprite 74, when the int was 1. When trying to compile, it complains about a "parse error in expr near 'whoisplayer'". I've little doubt this is something to do with a deificiency of my understanding about how scripts work, but cana anyone tell me where I'm going wrong?
Much obliged!
It should be:
if ( whoisplayer == 1 )
Apart from that it should work if you put it in the right place (and whoisplayer is a correct variable).
Ah, so it was just a stupid mistake on my part. Thanks!
Even though the issue solved, I have to ask why use a global variable? Why not "if (player==cJohn)" ?
~Trent