Some question from newbie... -
neatek - 10.10.2015
Hello everyone, im newbie, i have a big problems with English, but i have a few questions.
first of all - 1) What different between gamemode and filterscripts, where better connect database?
2) How to use functions of one filterscript in other? (is it possible?) (I want create a core .amx, and in other filterscripts use functions of core filterscript)
3) Creating dedicated file of job for each job - is it better? Or better create all jobs in one file?
thanks for answers.
Re: Some question from newbie... -
ZeMuNaC - 10.10.2015
https://sampforum.blast.hk/showthread.php?tid=570899
Re: Some question from newbie... -
Unte99 - 10.10.2015
Quote:
Originally Posted by neatek
Hello everyone, im newbie, i have a big problems with English, but i have a few questions.
first of all - 1) What different between gamemode and filterscripts, where better connect database?
2) How to use functions of one filterscript in other? (is it possible?) (I want create a core .amx, and in other filterscripts use functions of core filterscript)
3) Creating dedicated file of job for each job - is it better? Or better create all jobs in one file?
thanks for answers.
|
2)
https://sampwiki.blast.hk/wiki/CallRemoteFunction and with the help of PVars you could try doing what you wanted.
Re: Some question from newbie... -
neatek - 10.10.2015
Quote:
Originally Posted by Unte99
|
Quote:
Originally Posted by ZeMuNaC
|
wow, thanks you.
As i can understand it's not a good idea - to split a gamemode to few filterscripts, cuz it
may have lags, right?
so, we can include .pwn parts of code in one large(main) .pwn file, right?
Код:
#include <test/RegisterSystem.pwn>
Re: Some question from newbie... -
Unte99 - 10.10.2015
Quote:
Originally Posted by neatek
wow, thanks you.
so, we can include .pwn parts of code in one large(main) .pwn file, right?
Код:
#include <test/RegisterSystem.pwn>
|
I don't know if there is a lot of difference if parts of the gamemode are in includes or filterscripts, but, most if it, is the comfort. For me for example, it would be quite a struggle to have multiple files to work with, a lot of open windows, searching through directories where is the code. It's not for me... It's more simple for me when I have everything in one place.
Re: Some question from newbie... -
neatek - 10.10.2015
Quote:
Originally Posted by Unte99
I don't know if there is a lot of difference if parts of the gamemode are in includes or filterscripts, but, most if it, is the comfort. For me for example, it would be quite a struggle to have multiple files to work with, a lot of open windows, searching through directories where is the code. It's not for me... It's more simple for me when I have everything in one place.
|
For me for comfortable have a lot of files, and each have special functions...
i dont like a search code in large file...
for example, we have
Main.pwn (gamemode), which
#included:
#Classes (Functions)
- Class_Register.pwn
- Class_Home.pwn
- Class_Jobs.pwn
#Real parts of code which using Classes doing actions.
- Jobs.pwn (Use Class_Jobs.pwn functions)
- JobEditor.pwn
- Homes.pwn (Class_Home.pwn)
... etc
As result ->
Main.amx (1 file - gamemode)
Its much comfortable i think... and for development it much comfortable
1 scripter - writing Classes.
2 scripter - By using classes write real actions.
Now, i know that usage of remote functions may have lags.
Next Question - Is there a difference in what language to write? (С++, Js, Pawn)
Interested in execution speed.
Re: Some question from newbie... -
Unte99 - 10.10.2015
Quote:
Originally Posted by neatek
For me for comfortable have a lot of files, and each have special functions...
i dont like a search code in large file...
for example, we have Main.pwn (gamemode), which #included:
#Classes (Functions)
- Class_Register.pwn
- Class_Home.pwn
- Class_Jobs.pwn
#Real parts of code which using Classes doing actions.
- Jobs.pwn (Use Class_Jobs.pwn functions)
- JobEditor.pwn
- Homes.pwn (Class_Home.pwn)
... etc
As result -> Main.amx (1 file - gamemode)
Its much comfortable i think... and for development it much comfortable
1 scripter - writing Classes.
2 scripter - By using classes write real actions.
Now, i know that usage of remote functions may have lags.
Next Question - Is there a difference in what language to write? (С++, Js, Pawn)
Interested in execution speed.
|
I don't know much about usage of other programming language for sa-mp, but as I remember, I read somewhere, that using C++ gives you less speed, but you gain more flexibility in code. Pawn is the default language for sa-mp, so I guess it's faster than C++. You should wait for someone more experienced to answer.
Found a link where you can get some more information:
https://sampforum.blast.hk/showthread.php?tid=421090
Re: Some question from newbie... -
neatek - 11.10.2015
Код:
#include <test/RegisterSystem.pwn>
Код:
GMNK.pwn(26) : fatal error 100: cannot read from file: "test/RegisterSystem.pwn"
why? o.o
Re: Some question from newbie... -
Ahmad45123 - 11.10.2015
Make sure you have that file in the folder called "test" in your includes folder.
To make it take from the gamemodes folder, Change it to:
PHP код:
#include "test/RegisterSystem.pwn"