Jakub Kučera 6 Odesláno: 22. Květen, 2014 Share Odesláno: 22. Květen, 2014 Ahoj, mám kód a chci si udělat zabezpečení na port serveru a udělal jsem si to zatím jen na IP, ale nevím, jak to udělat i na port. #include <a_samp> //By SA-MP Team public OnFilterScriptInit() { if( !strcmp( IPSERVER( ), "MOJE.IP.TOHO.SERVERU" ) ) //Kontrola IP { SendRconCommand( "exit" ); //Vypne server } return 1; } public OnFilterScriptExit() { return 1; } stock IPSERVER() { static IpServeru[16] ; GetServerVarAsString("bind", IpServeru, sizeof(IpServeru)); //Zjistí IP return IpServeru; } Poradí mi někdo? Link to comment Share on other sites More sharing options...
0 GAMELASTERツ 73 Odesláno: 22. Květen, 2014 Share Odesláno: 22. Květen, 2014 http://wiki.sa-mp.com/wiki/GetServerVarAsIntTak ťažké? Máš tam presne príklad na port Link to comment Share on other sites More sharing options...
0 Jakub Kučera 6 Odesláno: 22. Květen, 2014 Author Share Odesláno: 22. Květen, 2014 Zkusil jsem to, ale místo toho mi to server spustí i když je to na jiné IP.. Link to comment Share on other sites More sharing options...
0 GAMELASTERツ 73 Odesláno: 22. Květen, 2014 Share Odesláno: 22. Květen, 2014 Máš opačne strcmp, nemá tam byť ! Link to comment Share on other sites More sharing options...
0 Jakub Kučera 6 Odesláno: 22. Květen, 2014 Author Share Odesláno: 22. Květen, 2014 Takže takto : #include <a_samp> //By SA-MP Team public OnFilterScriptInit() { if( !strcmp( IPSERVER( ), "MOJE.IP.TOHO.SERVERU" ) ) //Kontrola IP { SendRconCommand( "exit" ); //Vypne server } if( !PORTSERVER( ), "PORT" ) //Kontrola PORTU { SendRconCommand( "exit" ); //Vypne server } return 1; } public OnFilterScriptExit() { return 1; } stock IPSERVER() { static IpServeru[16] ; GetServerVarAsString("bind", IpServeru, sizeof(IpServeru)); //Zjistí IP return IpServeru; } stock PORTSERVER() { static PortServeru[16] ; GetServerVarAsString("port", PortServeru, sizeof(PortServeru)); //Zjistí PORT return PortServeru; } ? To je asi blbě, nejde mi to zkompilovat.. Link to comment Share on other sites More sharing options...
0 Administrátor Ewwe 434 Odesláno: 25. Květen, 2014 Administrátor Share Odesláno: 25. Květen, 2014 Port je integer takže to neukládej do stringový proměný a taky nechápu ty tvoje funkce Link to comment Share on other sites More sharing options...
Dotaz
Jakub Kučera 6
Ahoj, mám kód a chci si udělat zabezpečení na port serveru
a udělal jsem si to zatím jen na IP, ale nevím, jak to udělat i na port.
Poradí mi někdo?
Link to comment
Share on other sites
5 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now