Attack -Help
#7

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
Prevent all remote NPCs with this:
PHP код:
public OnPlayerConnect(playerid)
{
    if(
IsPlayerNPC(playerid)) {
        new 
ip_addr_npc[64+1];
        new 
ip_addr_server[64+1];
        
GetServerVarAsString("bind",ip_addr_server,64);
        
GetPlayerIp(playerid,ip_addr_npc,64);
        if(!
strlen(ip_addr_server)) {
            
ip_addr_server "127.0.0.1";
        }
        if(
strcmp(ip_addr_npc,ip_addr_server,true) != 0) {
            
// this bot is remote connecting
            
printf("NPC: Got a remote NPC connecting from %s and I'm kicking it.",ip_addr_npc);
            
Kick(playerid);
            return 
0;
        }
        
printf("NPC: Connection from %s is allowed.",ip_addr_npc);
    }
    return 
1;

did not work..
Reply


Messages In This Thread
Attack -Help - by reelist - 25.01.2015, 07:09
Respuesta: Attack -Help - by Zume - 25.01.2015, 07:15
Re: Attack -Help - by reelist - 25.01.2015, 07:18
Respuesta: Attack -Help - by Zume - 25.01.2015, 07:21
Re: Respuesta: Attack -Help - by reelist - 25.01.2015, 07:27
Re: Attack -Help - by ATGOggy - 25.01.2015, 07:28
Re: Attack -Help - by reelist - 25.01.2015, 07:41

Forum Jump:


Users browsing this thread: 1 Guest(s)