Differences between "stock" "public" "normal function" ?
#3

Quote:

What's the difference between:
public ABC()
|
stock ABC()

As far as i know theres quite some difference.
A Public function can be called in a timer, needs to be forwarded and mostly returns something;
inside a public function there can be other functions, things to do. Like unfreeze someone..

A stock function can be used to make a function that can be used in commands.
I created (many did too) SCM, this is the shortened version of SendClientMessage, but has same parameters.
stock functions cant be used in timers. they don't have to be forwarded aswell.

So if you wish to make a new function, like GetPlayerZPos, (returns the player's height) use stock.
If you would like to Get the player's Z pos every 50 seconds, then use the stock inside a public function and
put a timer on the function.

Stock makes functions (can use them too)
Public uses functions

Example of SCM

stock SCM(playerid, color, const message[]){return SendClientMessage(playerid,color,message);}
Note this is not mine but a friend made it for me some time ago.
Reply


Messages In This Thread
Differences between "stock" "public" "normal function" ? - by Glint - 18.09.2012, 09:49
Re: Differences between "stock" "public" "normal function" ? - by FalconX - 18.09.2012, 09:54
Re: Differences between "stock" "public" "normal function" ? - by [GF]Logic - 18.09.2012, 10:00
Re: Differences between "stock" "public" "normal function" ? - by Glint - 18.09.2012, 10:01
Re: Differences between "stock" "public" "normal function" ? - by playbox12 - 18.09.2012, 10:51
Re: Differences between "stock" "public" "normal function" ? - by Glint - 18.09.2012, 11:05

Forum Jump:


Users browsing this thread: 1 Guest(s)