SA-MP Forums Archive
difference between stock ant public - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: difference between stock ant public (/showthread.php?tid=281094)



difference between stock ant public - ajwar - 04.09.2011

What's the difference between those two? Example?


Re: difference between stock ant public - Lorenc_ - 04.09.2011

stock is mainly used for functions that will not be used, afaik.

public is used for public functions which can be called from other scripts and such with some pre-made functions.


Re: difference between stock ant public - Babul - 04.09.2011

the advantage of placing (larger) scripts into publics: the Performance Profiler handles publics, but not stocks, so debugging is best done by tending to use publics :P


Re: difference between stock ant public - DRIFT_HUNTER - 04.09.2011

Also stock's can return strings and public's cant


AW: Re: difference between stock ant public - Joshua_Turnerz - 04.09.2011

Quote:
Originally Posted by DRIFT_HUNTER
View Post
Also stock's can return strings and public's cant
care to put a wager on that ?


AW: difference between stock ant public - Joshua_Turnerz - 04.09.2011

bet i can return a string from public.... I REALLY wish some of you would thing outside of the box.

a public only requires a 0 / 1 at the end, however, at any point inside of a public, you can return a very long list of variables, stings, ints, floats, blah blah ....

the PASS/FAIL is what is needed at the end.

If I provide an example...whats in it for me... so ****** if your accepting my challenge, then by all means, lets make the wager.


AW: difference between stock ant public - Joshua_Turnerz - 04.09.2011

ooo ive no doubt that a public can 'return' anything ...

I'm simply stating, that ANYONE can 'return' a [string] from a public, so long as the ending allows a pass or fail return ( or at least something OTHER then the string ).

The point in all of this, is that people give out false information ALL the time ( CANT do this/that ) ...when in fact, countless people have been expanding what this community claims are 'CANT BE DONE'

In my experience, ive seen every 'limitation' surpassed .... and the biggest reason why everyone duplicates is because its so rare that people think outside of that limited box.

as for the wager, it matters not what 'rules' are set as to 'how' something gets done, it only matters that the result proves that it CAN be done.


AW: difference between stock ant public - Joshua_Turnerz - 04.09.2011

again .. as I've stated ... you can EASILY 'return' a [string] from any 'public' function ...and since you stated the workarounds, WHY in hell would you tell people that it 'CANT' be done ?

Again..there is no 'Goody' for anyone ... this is about people telling others that something 'CANT' be done, when it simply CAN be done!

PS, this isn't the first time you and I have come to a debate...
2 years ago, we had a debate about surpassing 'checkpoints' and allow a player to have more then one at a give time... of which, I claimed that a player could have unlimited ( least up to 10,000 ) as that was my array limit.... and resulted in telling everyone off showing them a screenshot of 5 checkpoints next to each other...
SADLY .... the result of that 'debate' lead to a forum ban ... which is why most people who CAN build odd ball shit dont participate on these forums.

Now... as i stated ... the ONLY limitations that people on these forums have, are the limitations that you people STATE there are...sadly, people actually BUY into that crap.


Re: difference between stock ant public - [S]trong - 04.09.2011

Remember:
"stock" is not necessary if you use the function, pawn can recognizes function using only :

pawn Code:
function(params)
{
   return params;
}
- [S]trong


Re: difference between stock ant public - Scenario - 04.09.2011

Quote:
Originally Posted by [S]trong
View Post
Remember:
"stock" is not necessary if you use the function, pawn can recognizes function using only :

pawn Code:
function(params)
{
   return params;
}
- [S]trong
Go compile that and you will receive errors.

pawn Code:
function(params[])
{
    return params;
}
That would be the way to do it.