Include?
#1

Ok, just in general... how do i create an include? ex. missles or something like that. THANKZ!!!
Reply
#2

Hmm dunno xD
Reply
#3

well... then y u reply? thanks... i guess.
Reply
#4

Quote:
Originally Posted by Markx
Посмотреть сообщение
Hmm dunno xD
Honestly, why did you bother posting this? If your aim was laughs, you succeeded, i LOLD pretty hard. Its pretty annoying as well though!



Anyways, an include is just code that is included into another file. To make it, you would just go about coding as you normally would, but the thing about includes is they're sectioned off by the #section directive, so all global variables should be declared "static" so they keep their values (Also its a good idea to precede the global variables with "g_" so people dont get issues due to your var naming...example: static g_VariableName; ).

If you plan on using callbacks in the include you'll also need to use callback hooks, and thanks to Mr.****** that is VERY easy! Its literally one line, and is the fastest method yet. Read about it here: https://sampforum.blast.hk/showthread.php?tid=241446

But yes, other than using globals/callbacks, code exactly how you normally would.
Reply
#5

ok...
Reply
#6

But what if i wanted to add a new function?
Reply
#7

Quote:
Originally Posted by sciman001
Посмотреть сообщение
But what if i wanted to add a new function?
You would create the function in the include, it is that simple. A big thing about includes is you have to make sure you dont cause the user trouble, so callback hooks, appropriate variable naming, and declaring your functions as "stock" is very important.


If you dont know what stock is, basically its a way to declare things so that if it isnt used, the compiler wont include it. This is ideal for things like includes cause you dont want to give the users warnings regarding one of your functions not being used! You can declare variables as stock as well, for more information check the sa-mp wiki about it.
Reply
#8

ok. maybe ill wait t start making includes... kinda complex...
Reply
#9

Quote:
Originally Posted by sciman001
Посмотреть сообщение
ok. maybe ill wait t start making includes... kinda complex...
Thats the best way to do it man, just jump into it! Start small and get a good idea of how it works, and build your way up.


If you need any help, feel free to PM me. I'll try to answer all your questions (as long as i have time/im not busy of course).
Reply
#10

What means "y" -.-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)