15.08.2016, 11:58
Use "i" instead of "u"
The "u" specifier in sscanf is used for bots and players, not actors.
So if the player isn't connected, it will return 0xFFFF instead of an integer.
Also, use IsValidActor instead of INVALID_ACTOR_ID because "i" doesn't work like "u"
Also, take this advice and create strings AFTER the checks, because if someone enters an invalid actor id, you'd be creating a string with 200 cells, and then wasting them because you stopped the command.
The "u" specifier in sscanf is used for bots and players, not actors.
So if the player isn't connected, it will return 0xFFFF instead of an integer.
Also, use IsValidActor instead of INVALID_ACTOR_ID because "i" doesn't work like "u"
Also, take this advice and create strings AFTER the checks, because if someone enters an invalid actor id, you'd be creating a string with 200 cells, and then wasting them because you stopped the command.