making include to normal code
#1

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;
}
Reply
#2

Copy this all thing and paste it in your gamemode.
Reply
#3

If i copy/paste them, they stop working
Reply
#4

YAGNI - why do you want to do so?
Reply
#5

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
Reply
#6

Can someone help me?
Reply
#7

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.
Reply
#8

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.
Reply
#9

Including it wont effect anything.
Reply
#10

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


Forum Jump:


Users browsing this thread: 2 Guest(s)