03.02.2018, 09:06
Interior isn't too bad, as it's a simple quick check, but if anyone else is in any interior (As many interiors share interior IDs), then that will be a problem.
If you use a player enum, simply put a variable in there. Or, if you need to, make a "IsInArena[MAX_PLAYERS]" array, and simply set it on entering the arena.
If you set it to 0 for not being in there, and 1 for being in there, then you can simply use "if(IsInArena[playerid])" as the check.
It's a lot better in checking this, as if you check the interior, it can cause trouble later on when you decide to use interiors for future things.
Another option, is to use different VirtualWorlds for the arena, then you could simply check which VW they are in.
For instance, you could have VW 0 is 'normal', VW 1 is arenas, VW2 is racing, VW3 is stunt, e.t.c.
When I look at things, I look at how it can be expanded later, rather than just doing what needs to be done 'currently'.
If you use a player enum, simply put a variable in there. Or, if you need to, make a "IsInArena[MAX_PLAYERS]" array, and simply set it on entering the arena.
If you set it to 0 for not being in there, and 1 for being in there, then you can simply use "if(IsInArena[playerid])" as the check.
It's a lot better in checking this, as if you check the interior, it can cause trouble later on when you decide to use interiors for future things.
Another option, is to use different VirtualWorlds for the arena, then you could simply check which VW they are in.
For instance, you could have VW 0 is 'normal', VW 1 is arenas, VW2 is racing, VW3 is stunt, e.t.c.
When I look at things, I look at how it can be expanded later, rather than just doing what needs to be done 'currently'.