Closed Erythritee closed 1 year ago
Hello, sorry for the late response. Replace in
with ref
.
void get_infect(ref Player | Player[] p) {
p.isInfect[0] = 1;
p.isInfect[1] = TotalTimeElapsed();
}
https://github.com/ItsDeltin/Overwatch-Script-To-Workshop/wiki/Methods,-Macros-and-Subroutines#ref
but is still can't use like this:
void Show(ref Player | Player[] p){
p.showCursor = true;
}
rule: 'My Rule'
{
Show(AllPlayers());
}
Expected a variable.
and get :
The variable 'isInfect' cannot be set in the current context
when I remove the Player[] , it worked so how could I set the player var with the Player[] type in function?