You should use the proper
tag, if you want to return a value.
For example: (from SA:MP Wiki)
pawn Код:
stock Float:Health(playerid)
{
new Float:HP;
GetPlayerHealth(playerid, HP);
return HP;
}
If you replace "new" with "static" in this example, you can optimize your code (speedwise) a little bit:
pawn Код:
stock Float:Health(playerid)
{
static Float:hp;
GetPlayerHealth(playerid, hp);
return hp;
}
"stock"s are basicly "scriptwise defined" functions you can use in your script. You can purely leave the "stock" keyword from this line, because what actually "stock" does is, that it removes the warnings that pops out, if this function has been never used in your script at all. "stock"s are basicly useful for includes only.
Example:
pawn Код:
Float:Health(playerid)
{
static Float:hp;
GetPlayerHealth(playerid, hp);
return hp;
}