Question about GlobalInt

Started by Hartan, Wed 26/11/2003 10:36:52

Previous topic - Next topic

Hartan

HI
I want the player character to be able to kill another character in the game. So I wrote these lines:

if (GetGlobalInt(31)== 1) Display ("No!");
else  if (GetGlobalInt(31)== 0)  setGlobalInt(31,1);Display ("Die!!"); SetCharacterView(R,1); AnimateCharacter(R,4,3,0);

It works okay the animation of the other character collapsing and dying works.
THE PROBLEM IS: you can kill him over and over again, even though "SetGlobalInt 31,1".
The first time i kill him it works fine, skipping the first line, it says "Die" and loads the animation, the second time i try (when the killed one is "dead"") It says "No" then it runs the next line saying "die" and loads the whole animation again, Why when the GlobalInt 31 is set to 1?
/hartan

Gilbert

Simple fix ;) :

if (GetGlobalInt(31)== 1) Display ("No!");
else if (GetGlobalInt(31)== 0) { setGlobalInt(31,1);Display ("Die!!"); SetCharacterView(R,1); AnimateCharacter(R,4,3,0);
}

Hartan

yeah, it works fine now! thanks a lot!!

SMF spam blocked by CleanTalk