Help with actors
#3

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.
Reply


Messages In This Thread
Help with actors - by TayFunCZE - 15.08.2016, 07:11
Re: Help with actors - by oliverrud - 15.08.2016, 10:27
Re: Help with actors - by Stinged - 15.08.2016, 11:58

Forum Jump:


Users browsing this thread: 1 Guest(s)