#define and #include
#1

what are #define and #include for, also when i compile a script i downloaded it tells me that it cant read the file "utils" which is one of the #include's it says on line 21 "#include <utils>"

any can help me with these questions it would be much apprieciated!
Reply
#2

#include is when you "add" a include to your script look for the dutils include to fix this

#define is when you set example a word a speciffic value like #define TEAM_GROVE 1

Then if you type TEAM_GROVE later it will automaticly change it to 1 when compiled. This can make it alot easier to keep count on lots of teams for a TDM server

Editted: Typo
Reply
#3

okayt thanks i understand #define but i am still a little confused about #include and how i can fix my problem, thanks for the help so far but can you just elaborate on what #include is and how i can fix my problem?

thanks
Reply
#4

#include includes another script in your gamemode

Example

main.inc
pawn Код:
main()
{
    print("Main");
}
Gamemode.pwn
pawn Код:
#include <a_samp> //includes a_samp.inc - if it fail it will give you an warning
#tryinclude <main> //try to include main.inc - if it fail nothing will happen

public OnGameModeInit()
{
    AddPlayerClass( 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
}
if you complie your script, it would look something like that in the amx (just converted)

Код:
//samp stuff

main()
{
	print("Main");
}

public OnGameModeInit()
{
	AddPlayerClass( 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
}
How to fix your problem ?
Easy, you need to get the file "utils.inc" (serach for it - ****** helps, too)
And then put it in the include folder (?:\...\sa-mp_server_directory\pawno\include\)
Reply
#5

awesome thank you so much for the help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)