Problem or not
#1

Hey guys if i would create a rob system and i will put it as a include in pawno/includes then i will add it to my gamemode #include <name of the include> it will be a problem ? or it will be like in gamemode , i will have lag/crash ?
Reply
#2

I believe you can't put commands in the include, If you want to make it as an include you may just make the functions, but the cmds should be made in game, And put it in the buttom of your includes.
Reply
#3

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
I believe you can't put commands in the include, If you want to make it as an include you may just make the functions, but the cmds should be made in game, And put it in the buttom of your includes.
how ? "but the cmds should be made in game" how can i put them in gamemode and in the same time at the bottom of my include?

P.S: i already put my system in include and it worked fine i wanted to know if i will have problems with the system commands will stop etc...
Reply
#4

If you meant to make it like include <%s.pwn> then it will work perfectly, I thought that you were speaking about a .inc file, I don't know if it is possible to add commands in a .inc file, But i guess no..
Reply
#5

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
If you meant to make it like include <%s.pwn> then it will work perfectly, I thought that you were speaking about a .inc file, I don't know if it is possible to add commands in a .inc file, But i guess no..
i really mean .inc file and it worked i tested do a simple command and compile your gamemode with it and test it it 100% work

P.S: and yes it is possible JunkBuster if you remember the anti-hack had commands in it
Reply
#6

The include directive just copies everything from the source file into the target file. It's not nearly as special as everyone seems to think. Anything can be put in an include and the include directive can appear anywhere. So yes, it is possible to put commands in an include, or objects, or vehicles, or whatever the hell you please. It is possible to include a file that only consists on CreateObject lines like so:
PHP код:
public OnGameModeInit()
{
    
#include ..\source\maps\somemap.inc
    
return 1;

Reply
#7

Quote:
Originally Posted by StR_MaRy
Посмотреть сообщение
Hey guys if i would create a rob system and i will put it as a include in pawno/includes then i will add it to my gamemode #include <name of the include> it will be a problem ? or it will be like in gamemode , i will have lag/crash ?
Yes that will work, in fact that is how everything is scripted/programmed the right way. Also you dont have to put it into pawno/includes.

Код:
//If you use it like these
#include <something>
//pawno will try to read from pawnp/includes folder

//But if you use it like these
#include "something.pwn"
//It will include file relative to your script (where you are including from)
Reply
#8

Quote:
Originally Posted by DRIFT_HUNTER
Посмотреть сообщение
Yes that will work, in fact that is how everything is scripted/programmed the right way. Also you dont have to put it into pawno/includes.

Код:
//If you use it like these
#include <something>
//pawno will try to read from pawnp/includes folder

//But if you use it like these
#include "something.pwn"
//It will include file relative to your script (where you are including from)
Yea but i want to compile the gamemode without giving a system online like uploading on your host just the .amx file not the .pwn so if i put it on #include <file name> to read from pawno/includes i wont need to add the .pwn to work and if someone will acces my host account wont steal my work so that why i asked if i will put it under #include <file name> to read from pawno/includes , will work 100% ok or not like i said, i tested already and i compiled my gamemode with that include in it and removed from pawno/includes before i opened the server and it worked fine and now i try to wait and see what others have to say if is ok or not.
Reply
#9

You should try compiling with the -l (lowercase L) option once to see for yourself how that shit works. This option only runs the pre-processor and the result you get is what normally gets fed to the actual compiler. Everything that gets included gets compiled into one amx. You NEVER need to upload a raw source file to a live server.
Reply
#10

Quote:
Originally Posted by Vince
Посмотреть сообщение
You should try compiling with the -l (lowercase L) option once to see for yourself how that shit works. This option only runs the pre-processor and the result you get is what normally gets fed to the actual compiler. Everything that gets included gets compiled into one amx. You NEVER need to upload a raw source file to a live server.
Thx you all , you gived me a lot of info's that will help me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)