Some questions about source pawn.
Hi
I have some questions about pawn. _____________________________________________ _______________ #1 First, i want to know something about include files. I have .sma .vinc and two .sinc files Inside of .sma : PHP Code:
PHP Code:
PHP Code:
PHP Code:
the problem is that if file1.sinc and file2.sinc include file1.vinc then gvar2 and gvar will be defined twice. it will couse the error : sombol already defined "gvar" ( and gvar2 ) what i want to know is how to make include what do not couse that error. i need to use those variables in all inc files ( and in sma ofcourse ) I have one big script inside of .sma in xinc files are small functions and in vinc are all variables what my sma and xinc file will use. it is for that example in sma i have PHP Code:
this function just count calling and when calls count is like i want will set myvar to 0 so it will not call myfunc anymore, because function is done PHP Code:
i have very big sma and i just want to make all functions in parts. But the functions mayby use variables what ohter functions also use, so thats way i need to know it. to making native ( or something like that ) for set variable value is just too much, there are soo many variables what i have done. anyway there must be a way how to do it. I would be very grateful if i can get a solution from here! _____________________________________________ _______________ #2 Now there come question about amxmodx and about goldsource engine. I have made model ( water model ), there are 81 bone. What i want to do now is controll these bone position. I want to make water animation, but i can not make it inside model. In my system there are wind and i just need my own way to controll bones in script ( like wind want ) i have search codes and things 2 week now and i did not found it, i need help. _____________________________________________ _______________ #3 how that thing work? PHP Code:
whether computer do one check for that or more than just one check ( in this case mayby 10 time check )? basically i wanna know how computer understand this. _____________________________________________ _______________ #4 how this will work? PHP Code:
I mean if i have 50 case in function and if computer know that myvar is 1 and computer must take case 1 then ohter cases will increase cpu or not? it is main thing what i want to know. if myvar is example 4 how to computer take it? whether computer check 1,2,3 too or it will just take 4 and computer no need to check here something more? is this PHP Code:
PHP Code:
_____________________________________________ _______________ That is all right now. I really hope that you found the time to answer to my questions. I will be very very grateful! Sorry about my bad english, i hope that you will understand me. Thanks! |
Re: Some questions about source pawn.
TL;DR
Pawn or Source Pawn? Which are you actually asking about. None of the code you posted is Source Pawn. EDIT: Ok, I skimmed over it: #1: Example: amxmodx.inc PHP Code:
#4: A switch() is always more efficient than an if else if structure. #3&4: If you want to know more then you should first read the AMX Mod X wiki. There are some explanations of why some things are more efficient than others. |
Re: Some questions about source pawn.
thanks.
|
Re: Some questions about source pawn.
Quote:
The variables are defined IN THAT CLASS ONLY and do not effect anything outside of it. You can use cheeseGraterC as a var in every single plugin on a server and it will act independently in each plugin. Variables are block specific.....for instance you can define a global (for use in all of your plugin) and use it throughout all your functions and loops and blocks. ex: PHP Code:
|
Re: Some questions about source pawn.
Quote:
|
Re: Some questions about source pawn.
Quote:
Class, sma, headerfile, include. Whatever you call it. Its all the same. |
Re: Some questions about source pawn.
Quote:
Quote:
|
Re: Some questions about source pawn.
bump for:
Quote:
If i know how to do this then almost everything is possible. I can do that cs1.6 look like a new fps game what has come out in 2010-2012. I can controll so many things, like creating blood decal in model or create berfect water or i can even do pixel shader with some render tricks. It is really so important, i really want to update goldsource and when i have done this then i will update source engine ; ) I already done some great things what never will be seen in ohter plugins or servers or what ever in goldsource. and all things support client-server side. And please, dont say it is impossible and most important dont say nothing it will make me sad. |
| All times are GMT -4. The time now is 00:28. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.