#1

So this gamemode i am editing has 208 stocks. All textdraws, objects everything is in stock. Is that bad and is it going to slow things down??
Reply
#2

Guys I need answer because this is urgent
Reply
#3

Stock is useless if you don't make an include. Remove the keyword stock.
Reply
#4

Hello Micko123,
stocks are just there to tell the compiler to ignore warnings/erros inside of it if the stock is not used.
Reply
#5

Well is it going to infect gamemode's speed in game and could there be any invisible errors or warnings?
Reply
#6

stock means that if that function is not used in your script, it will not be added to the .amx while compiling.
So if you have this:
Код:
//In OnPlayerCommandText
if(!strcmp(cmdtext, "/mycommand", true) {
    Func1();
    Func2();
    return 1;
}

//Somewhere in your script
Func1() {
    //Do something
}

stock Func2() {
    //Do something
}

stock Func3() {
    //Do something
}

Func4() {
    //Do something
}
  • Func1 will be included in the .amx file, because it is not stock and is used in the command.
  • Func2 will be included in the .amx file, because it is stock and used in the command.
  • Func3 will be NOT included in the .amx file, because it is stock and not used.
  • Func4 will give a compile warning that it is not used.
So if you don't use a function, but don't want to delete it, declare it stock.
Reply
#7

They're not necessary, if you return warnings/errors upon removing them it's a sign of useless/unneeded code.

edit: Freaksken beat me too it and elaborated better :^)
Reply
#8

Thank you guys for answers but one more question. This gm has 55280 lines. When i try to compile, compiler stuck. It is showing liike it is compiling but nothing happens. I left it there for 20 min and still same. What could be the problem? I re-downliaded pawn few times and still the same
Reply
#9

Quote:
Originally Posted by Micko123
Посмотреть сообщение
Thank you guys for answers but one more question. This gm has 55280 lines. When i try to compile, compiler stuck. It is showing liike it is compiling but nothing happens. I left it there for 20 min and still same. What could be the problem? I re-downliaded pawn few times and still the same
Pawno (the standard Pawn IDE) was not built for large scripts. Try using another compiler.
The other possibility could be that you have an error somewhere.
Reply
#10

Quote:
Originally Posted by [HLF]Southclaw
Посмотреть сообщение
Pawno isn't the compiler, pawncc is and it's likely another IDE would just use pawncc. What you're probably getting mixed up with is Zeex's compiler which was patched to support longer lines (not longer scripts, pawncc can handle a lot more than 50k lines).
You're right, even though I wasn't thinking "compiler", that's what my hands decided to type . If you change the word compiler in my sentence to IDE, it should make sense .

EDIT:
This is what I meant.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)