Why are there so few "return" functions with SA:MP?
#4

Despite what the wiki might say, most functions do also have a return value. Most of them return 1 on success and 0 on failure (i.e. not connected or invalid vehicleid). GetPlayerHealth is no exception. This means that doing something like this (common practice) is redundant;

pawn Code:
if(IsPlayerConnected(target))
{
    GetPlayerHealth(target, health);
}
This could be shortened to
pawn Code:
if(GetPlayerHealth(target, health))
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)