[Tutorial] Stop the abuse of stock!
#24

@Emmet_ : static globals are useful. But only in libraries.

OT : Nice tut. I was aware of it, though never told it to correct someone - I'm maybe guilty or maybe not, not that I answered much helping threads - IMO that was useless since, as someone (sorry to not remember the name) said above, the lambda samp user won't learn from this. Some of them will read, but none of them will learn. Their only point being here is to get their scripting problems solved by someone else.

By the way we're talking about functions, I read somewhere that you could "forward" public functions using the "static" keyword. This way, the public function will be static : if another function with the same name exists in a gamemode where your library is included, it won't create compiling errors.

PHP Code:

// in mylib.inc

static myPublic();
public 
myPublic()
{
      
printf("Called from library");
}

// in gm

#include <mylib>

forward myPublic();
public 
myPublic()
{
      
printf("Called from gamemode");
      return 
1;

Reply


Messages In This Thread
Stop the abuse of stock! - by Vince - 12.04.2015, 09:26
Re: Stop the abuse of stock! - by Glossy42O - 12.04.2015, 10:12
Re: Stop the abuse of stock! - by FernandoLight - 12.04.2015, 10:14
Re: Stop the abuse of stock! - by Emmet_ - 12.04.2015, 12:04
AW: Stop the abuse of stock! - by Mellnik - 12.04.2015, 12:05
Re: Stop the abuse of stock! - by Patrick - 12.04.2015, 16:12
Re: Stop the abuse of stock! - by Abagail - 12.04.2015, 18:06
Re: Stop the abuse of stock! - by iZN - 12.04.2015, 21:17
Re: Stop the abuse of stock! - by Michael@Belgium - 12.04.2015, 21:25
Re: Stop the abuse of stock! - by Vince - 12.04.2015, 21:30
Re: Stop the abuse of stock! - by iZN - 12.04.2015, 21:31
Re: Stop the abuse of stock! - by Michael@Belgium - 12.04.2015, 21:37
Re: Stop the abuse of stock! - by yugecin - 12.04.2015, 22:14
Re: Stop the abuse of stock! - by EiresJason - 12.04.2015, 23:42
Re: Stop the abuse of stock! - by Onfroi - 13.04.2015, 00:00
Re: Stop the abuse of stock! - by Gammix - 13.04.2015, 01:18
Re: Stop the abuse of stock! - by Abagail - 13.04.2015, 01:48
Re: Stop the abuse of stock! - by EiresJason - 13.04.2015, 01:59
Re: Stop the abuse of stock! - by Pottus - 13.04.2015, 02:11
Re: Stop the abuse of stock! - by Abagail - 13.04.2015, 02:21
Re: Stop the abuse of stock! - by arakuta - 13.04.2015, 02:24
Re: Stop the abuse of stock! - by Pottus - 13.04.2015, 02:26
Re: Stop the abuse of stock! - by iZN - 13.04.2015, 07:01
Re : Stop the abuse of stock! - by S4t3K - 13.04.2015, 15:31
AW: Stop the abuse of stock! - by Kaliber - 14.04.2015, 00:48
Re: AW: Stop the abuse of stock! - by Ahmad45123 - 17.04.2015, 23:32
Re: Re : Stop the abuse of stock! - by Bakr - 18.04.2015, 06:25
Re : Stop the abuse of stock! - by S4t3K - 18.04.2015, 18:18
AW: Re : Stop the abuse of stock! - by Kaliber - 25.04.2015, 12:51
Re: Stop the abuse of stock! - by vannesenn - 01.05.2015, 22:16
Re: Stop the abuse of stock! - by ThePhenix - 02.05.2015, 00:16
Re: Stop the abuse of stock! - by Jay_ - 03.05.2015, 14:07
Re: Stop the abuse of stock! - by Jonny5 - 18.05.2015, 00:50
Re: Stop the abuse of stock! - by Freezo - 03.09.2015, 19:25
Re: Stop the abuse of stock! - by Onfroi - 06.09.2015, 17:49
Re: Stop the abuse of stock! - by Variable™ - 06.09.2015, 17:54
Re: Stop the abuse of stock! - by SickAttack - 06.09.2015, 17:55
Re: Stop the abuse of stock! - by Tamer - 06.09.2015, 18:07
Re: Stop the abuse of stock! - by Darrenr - 15.09.2015, 11:15
Re: Stop the abuse of stock! - by DarkLored - 15.09.2015, 18:54
Re: Stop the abuse of stock! - by introzen - 04.04.2016, 16:29
Re: Stop the abuse of stock! - by Puppy - 05.04.2016, 00:11
Re: Stop the abuse of stock! - by Arastair - 05.04.2016, 03:11
Re: Stop the abuse of stock! - by Itzhak E. - 07.04.2016, 12:47
Re: Stop the abuse of stock! - by Sew_Sumi - 07.04.2016, 13:00
Re: Stop the abuse of stock! - by Sasino97 - 17.04.2016, 20:28
Re: Stop the abuse of stock! - by iKevin - 07.06.2016, 12:15
Re: Stop the abuse of stock! - by vannesenn - 07.06.2016, 16:36
Re: Stop the abuse of stock! - by LockedLucas - 07.06.2016, 18:26
Re: Stop the abuse of stock! - by TwinkiDaBoss - 07.06.2016, 19:04
Re: Stop the abuse of stock! - by Private200 - 07.06.2016, 19:16
Re: Stop the abuse of stock! - by SickAttack - 10.06.2016, 16:44
Re: Stop the abuse of stock! - by vannesenn - 10.06.2016, 18:47
Re: Stop the abuse of stock! - by Konstantinos - 10.06.2016, 18:56
Re: Stop the abuse of stock! - by Stinged - 11.06.2016, 10:12
Re: Stop the abuse of stock! - by SickAttack - 11.06.2016, 13:59
Re: Stop the abuse of stock! - by PeanutButter - 11.02.2017, 10:36
Re: Stop the abuse of stock! - by HydraHumza - 11.02.2017, 10:54
Re: Stop the abuse of stock! - by iLearner - 11.02.2017, 11:36
Re: Stop the abuse of stock! - by ATomas - 22.02.2017, 12:59
Re: Stop the abuse of stock! - by organe. - 22.02.2017, 13:13
Re: Stop the abuse of stock! - by BiosMarcel - 22.02.2017, 21:49
Re: Stop the abuse of stock! - by iKarim - 23.02.2017, 05:08
Re: Stop the abuse of stock! - by Kwarde - 16.10.2019, 20:49
Re: Stop the abuse of stock! - by [FMJ]PowerSurge - 04.05.2020, 02:57

Forum Jump:


Users browsing this thread: 1 Guest(s)