SA-MP Forums Archive
Something gone wrong :S - 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: Something gone wrong :S (/showthread.php?tid=357445)



Something gone wrong :S - Audi_Quattrix - 07.07.2012

Код:
//
//
#define FILTERSCRIPT

#include <a_samp>
#define GREEN 0x33AA33AA
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Anti Bot loaded");
	print("--------------------------------------\n");
	return 1;
}
public OnPlayerConnect(playerid)
{
	if(IsPlayerNPC(playerid))
	{
        if(GetPlayerIPEx(playerid) == 127.0.0.1)
        {
        
        }
        else
        {
			Ban(playerid);
		}
    }
	return 1;
}
stock GetPlayerIPEx(playerid)
{
	new IP[15];//Is it 16 :O
	GetPlayerIp(playerid, IP, 15);
	return IP;
}
#endif
Код:
C:\Users\asus\Desktop\Antibot.pwn(19) : error 033: array must be indexed (variable "GetPlayerIPEx")
C:\Users\asus\Desktop\Antibot.pwn(19) : error 029: invalid expression, assumed zero
C:\Users\asus\Desktop\Antibot.pwn(19) : warning 215: expression has no effect
C:\Users\asus\Desktop\Antibot.pwn(19) : error 001: expected token: ";", but found ")"
C:\Users\asus\Desktop\Antibot.pwn(19) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: Something gone wrong :S - zombieking - 07.07.2012

pawn Код:
//
//
#define FILTERSCRIPT

#include <a_samp>
#define GREEN 0x33AA33AA
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Anti Bot loaded");
    print("--------------------------------------\n");
    return 1;
}
public OnPlayerConnect(playerid)
{
    new pIP[16];
    GetPlayerIp(playerid,pIP,16);
    if(IsPlayerNPC(playerid))
    {
        if(strcmp(pIP,"127.0.0.1",false))
        {

        }
        else
        {
            Ban(playerid);
        }
    }
    return 1;
}
stock GetPlayerIPEx(playerid)
{
    new IP[15];//Is it 16 :O
    GetPlayerIp(playerid, IP, 15);
    return IP;
}
#endif