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:
#include "file1.sinc"
#include "file2.sinc"
public plugin_init()
{
register_clcmd( "say t0", "t1_clcmd" )
register_clcmd( "say t1", "t2_clcmd" )
}
public t1_clcmd(id)
{
gvar[id] = 3
call_test(id, 7)
client_print(0, print_chat, "varriable value: %d", gvar2[id])
}
public t2_clcmd(id)
{
gvar[id] = 1
call_test2(id, 1)
client_print(0, print_chat, "varriable value: %d", gvar2[id])
}
Inside of file1.sinc :
PHP Code:
#include "file1.vinc"
call_test(id, value)
{
gvar2[id] = value
gvar[id] += 2
gvar2[id] += gvar[id]
client_print(0, print_chat, "file1 called")
}
Inside of file2.sinc :
PHP Code:
#include "file1.vinc"
call_test2(id, value)
{
gvar2[id] = value
gvar[id] += 6
gvar2[id] += gvar[id]
client_print(0, print_chat, "file1 called")
}
Inside of file1.vinc :
PHP Code:
#include "include/amxmodx.inc"
#include "include/amxmisc.inc"
new gvar2[33], gvar[33]
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:
public server_frame()
{
if ( g_myvar )
call_myfunc
}
and in example my_func.f_inc
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:
public call_myfunc()
{
if ( gCcount > 20 )
g_myvar = 0
else
gCcount++
}
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:
if ( myvar < 10 )
i know that this do but how it work in computer?
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:
switch (myvar)
{
case 1:
{
// computer now know that myvar is 1
}
case 2:
{
// computer now know that myvar is 2
}
...
if computer find out that myvar is example 1 then computer will skip ohter cases?
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:
switch (myvar)
{
case 1:
{
// computer now know that myvar is 1
}
case 2:
{
// computer now know that myvar is 2
}
...
same as
PHP Code:
if ( myvar == 1 )
{
// computer now know that myvar is 1
}
else if if ( myvar == 2 )
{
// computer now know that myvar is 2
}
...
?
_____________________________________________ _______________
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!