22.07.2011, 10:45
return has different meanings in different functions but the basic use looks like this:
It returns a value to the place it was called. In that example Function() returns 5.
Variable can be dynamic or static. Difference is that dynamic variable gets deleted when it's not used anymore (out of scope), but static variable is always there (like global variables).
It's all explained in wiki:
return: https://sampwiki.blast.hk/wiki/Control_Structures#return
static/non-static: https://sampwiki.blast.hk/wiki/Scripting_Basics#Scope
pawn Код:
Function()
{
return 5;
}
if(Function() == 5)
{
// true
}
else
{
// false
}
Variable can be dynamic or static. Difference is that dynamic variable gets deleted when it's not used anymore (out of scope), but static variable is always there (like global variables).
It's all explained in wiki:
return: https://sampwiki.blast.hk/wiki/Control_Structures#return
static/non-static: https://sampwiki.blast.hk/wiki/Scripting_Basics#Scope