AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   Function (https://forums.alliedmods.net/showthread.php?t=275272)

felipemilralze 11-26-2015 08:40

Function
 
What is the difference of a function without the public and the public?

Chihuahuax 11-26-2015 18:23

Re: Function
 
afaik public function will get hooked by other plugins while the one without public (blank) is just a stock

felipemilralze 11-26-2015 21:42

Re: Function
 
Thank you, but I can use the public as stock?

Chihuahuax 11-26-2015 23:23

Re: Function
 
Well it depends

one common example would be:
PHP Code:

public Spawn(id// you must use "public" here in this case
{
    if(
is_user_alive(id))
        
kill(id);
}

stock kill(id)
{
    
xxx



felipemilralze 11-27-2015 18:11

Re: Function
 
ok thx

CrazY. 03-27-2017 08:05

Re: Function
 
Cara, eu acho que funções public podem ser acessadas por outros plugins, por exemplo, quando você registra uma native. Stock são funções que, quando são compiladas, não apresentam erros e não são acessadas por outros plugins. Acredito que seja isso.

edon1337 03-29-2017 09:59

Re: Function
 
Quote:

Originally Posted by CrazY. (Post 2507104)
Cara, eu acho que funções public podem ser acessadas por outros plugins, por exemplo, quando você registra uma native. Stock são funções que, quando são compiladas, não apresentam erros e não são acessadas por outros plugins. Acredito que seja isso.

Don't you see the last post was back in 2015? A function without the 'public' prefix is a private function not a stock. You create a stock by adding the 'stock' prefix.

CrazY. 03-29-2017 11:14

Re: Function
 
What is the problem that the last post was back in 2015? Case you dont have a explication to this question, dont say nothing.

Kotoamatsukami 03-30-2017 06:19

Re: Function
 
Quote:

Originally Posted by edon1337 (Post 2507628)
Don't you see the last post was back in 2015? A function without the 'public' prefix is a private function not a stock. You create a stock by adding the 'stock' prefix.

Actually, you can bump if you have a question to be asked, explanation that you want to make for others, or when the thread still hasn't receive any solution after a period of two weeks( well, I don't find any further information regarding this rule, ermm, nah, whatever).
  • Do not derail threads or post completely unrelated topics in a thread.
What I see he did wrong is he didn't provide an English text for his explanation.
  • This is an English forum (other than a few specific, labeled subforums). If you're going to post in another language, also add the text in English, even if from online translator.

edon1337 03-30-2017 07:35

Re: Function
 
Quote:

Originally Posted by CrazY. (Post 2507647)
What is the problem that the last post was back in 2015?

Why do you bother bringing up a 2 year old thread, also writing in other foreign language?

Quote:

Originally Posted by CrazY. (Post 2507647)
Case you dont have a explication to this question, dont say nothing.

I already gave an explanation, you were calling a private function a stock, stop misinforming people. Also the OP stated that the problem was solved.

Quote:

Originally Posted by Kotoamatsukami (Post 2507823)
Actually, you can bump if you have a question to be asked, explanation that you want to make for others, or when the thread still hasn't receive any solution after a period of two weeks( well, I don't find any further information regarding this rule, ermm, nah, whatever).
  • Do not derail threads or post completely unrelated topics in a thread.

Are you blind ? He already stated that it was solved, don't try to tell me what is right and what is wrong.
Quote:

Originally Posted by felipemilralze (Post 2366967)
ok thx



All times are GMT -4. The time now is 21:30.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.