PDA

View Full Version : Some question from newbie...


neatek
10/10/2015, 03:21 PM
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.

ZeMuNaC
10/10/2015, 03:35 PM
http://forum.sa-mp.com/showthread.php?t=570899

Unte99
10/10/2015, 03:49 PM
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://wiki.sa-mp.com/wiki/CallRemoteFunction and with the help of PVars you could try doing what you wanted.

neatek
10/10/2015, 05:23 PM
2) https://wiki.sa-mp.com/wiki/CallRemoteFunction and with the help of PVars you could try doing what you wanted.
http://forum.sa-mp.com/showthread.php?t=570899
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>

Unte99
10/10/2015, 05:35 PM
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.

neatek
10/10/2015, 05:44 PM
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 :rolleyes:
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.

Unte99
10/10/2015, 06:13 PM
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 :rolleyes:
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: http://forum.sa-mp.com/showthread.php?t=421090

neatek
11/10/2015, 11:38 AM
#include <test/RegisterSystem.pwn>


GMNK.pwn(26) : fatal error 100: cannot read from file: "test/RegisterSystem.pwn"

why? o.o

Ahmad45123
11/10/2015, 11:46 AM
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:

#include "test/RegisterSystem.pwn"