Jump to content
  • 0

pomoc Pomoc s Portem


Jakub Kučera

Dotaz

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

5 odpovědí na tuto otázku

Recommended Posts

  • 0

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...