Can't give points to players
-
this is a part from my code where I try to give 10000 points,
menu_fast_reset()
{for (;;) { self waittill("reset_fast"); self.score+=10000; self notify("close_menu");
}
}When I trigger 'reset_fast' i get the 'close_menu' notify but not the points
help plzzz -
@Nakero77 What is the caller of the menu_fast_reset() function?
-
JezuzLizard Im new to GSC so correct me if im wrong but menu_fast_reset() is a thread that should be inicialized since i write
menu thread menu_fast_reset();
few lines above, right?
-
This post is deleted!
-
JezuzLizard since i get the ''close menu'' notify i dont think its a problem with the function, it might be related with the self.score tool
-
@Nakero77 Well if the menu is the caller than self is the menu. You are trying to do menu.score += 10000;. If you want to set a player's score you call the function on a player so self will be the player.
-
JezuzLizard didn't undertood tbh, what i need to change exacly?
inicialize the thread as
player thread menu_fast_reset();????
-
@Nakero77 I don't know what your codebase looks like so I don't know the exact answer. All I know is from the examples you've given me you are trying to set the score of a menu not a player. Either pass the player as self by making a player the caller, or pass a player as an argument and do player.score.
-
JezuzLizard i changed
self.score+=10000; into player.score+=10000;
but still getting nothing :(((