SA-MP Forums Archive
making include to normal code - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: making include to normal code (/showthread.php?tid=492991)



making include to normal code - MrTinder - 06.02.2014

So..I wanna this include to make it code that i can use directly in my GM.

Код:
#include <a_samp>
#include <a_http>
 
new _P_SERVERIP[20];
stock GetServerIP() return _P_SERVERIP;
        public OnGameModeInit()
        {
                HTTP(0,HTTP_GET,"www.ipchicken.com/","","OnServerGetIP");
                return (funcidx("GSIP_OnGameModeInit") != -1)?CallLocalFunction("GSIP_OnGameModeInit",""):1;
        }
        #if defined _ALS_OnGameModeInit
                #undef OnGameModeInit
        #else
                #define _ALS_OnGameModeInit
        #endif
        #define OnGameModeInit GSIP_OnGameModeInit
        forward GSIP_OnGameModeInit();
		
forward OnServerGetIP(index, response_code, data[]);
public OnServerGetIP(index, response_code, data[])
{      
        if(response_code == 200)
        {
                strmid(_P_SERVERIP,data,1550,1570,1570);
				printf("Server IP is %s",_P_SERVERIP);
        }
        return 1;
}



Re: making include to normal code - ACI - 06.02.2014

Copy this all thing and paste it in your gamemode.


Re: making include to normal code - MrTinder - 06.02.2014

If i copy/paste them, they stop working


Re: making include to normal code - ACI - 06.02.2014

YAGNI - why do you want to do so?


Re: making include to normal code - MrTinder - 06.02.2014

I'll make Server IP protection but with include file hackers can easy go through it..So i wanna to make this code directly in my GM


Re: making include to normal code - MrTinder - 06.02.2014

Can someone help me?


Re: making include to normal code - PowerPC603 - 06.02.2014

Are you sure it's an include, and not a filterscript?

If it's an include, you can copy/paste it.

Because #include does exactly the same.
It reads the file and pastes the content of that file at the location of the #include statement.
It actually replaces "#include <yourincludefile>" with the contents of that file.

Where you have:
pawn Код:
#include <YourIncludeFile>
Replace that line with the code from that file.


Re: making include to normal code - MrTinder - 06.02.2014

It's include but i wanna to paste his code in my GM.I don't wanna to use '#include <YourIncludeFile>' because it's going to be a security but if i use include hackers can go through it.


Re: making include to normal code - ACI - 06.02.2014

Including it wont effect anything.


Re: making include to normal code - MrTinder - 06.02.2014

Oh..I wanna to make this code to work directly in my GM not using include ;d that's all..please help