SA-MP Forums Archive
array is to small ? - 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: array is to small ? (/showthread.php?tid=573020)



array is to small ? - IndependentGaming - 03.05.2015

Hello im working on a ani hack system but it keeps giving me this error:


Код:
(1038) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
when i change the number from>>>

Код:
ptask anticheat[2000](playerid)
What can i do to fix this error (if code is needed reply to fix the code please do not send wiki links!)


Re: array is to small ? - arlindi - 03.05.2015

Dont use 2000 Its too big use something 128 or 256


Re: array is to small ? - IndependentGaming - 03.05.2015

Still getting the same error..


Re: array is to small ? - arlindi - 03.05.2015

Show here Erors and Lines


Re: array is to small ? - IndependentGaming - 03.05.2015

Код:
(1038) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Line 1037 and 1038 and 1039
Код:
ptask anticheat[256](playerid)
{



Re: array is to small ? - arlindi - 03.05.2015

Use 128


Re: array is to small ? - IndependentGaming - 03.05.2015

Код:
(1038) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: array is to small ? - arlindi - 03.05.2015

PHP код:
ptask anticheat[256](playerid)

Show all lines of this


Re: array is to small ? - IndependentGaming - 03.05.2015

Код:
ptask anticheat[128](playerid)
{
    if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid)) return 1;
    {
		if(GetPlayerState(playerid) == PLAYER_STATE_NONE) return 1;
        {
			//Anti-Jetpack Cheat
        	new string[128];
	    	if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
	    	{
	        	format(string, sizeof(string), "SGDM has banned %s [%d] from SGDM - Reason: Jetpack detected", pName(playerid), playerid);
	        	SendClientMessageToAll(COLOR_RED, string);
	        	SendClientMessageToAll(COLOR_WHITE, "SGDM: OWNED!");
        		PlayerInfo[playerid][pBanned] = 0;
        		GameTextForPlayer(playerid, "~r~Banned", 5000, 5);
        		SendClientMessage(playerid, COLOR_RED, "You have been banned from SGDM. You were banned by SGDM.(SGDM BOT)");
        		SendClientMessage(playerid, COLOR_ORANGE, "If you think this ban is unfair post an appeal at www.SOON.net");

       			BanEx(playerid, "Jetpack Detected");
	        	return 1;
	    	}
            /*//Anti Money Cheat
            if(GetPlayerCash(playerid) != GetPlayerCash(playerid))
            {
                ResetServerCash(playerid);
                UpdateServerCash(playerid, GetPlayerCash(playerid));
            }*/
            new Float:hp;
            GetPlayerHealth(playerid, hp);
            //Anti Health/God Cheat
            if(hp > 101.0)
            {
            	format(string, sizeof(string), "SGDM has banned %s [%d] from SGDM - Reason: Health/God hacks detected", pName(playerid), playerid);
	        	SendClientMessageToAll(COLOR_RED, string);
	        	SendClientMessageToAll(COLOR_WHITE, "SGDM: OWNED!");
        		PlayerInfo[playerid][pBanned] = 0;
        		GameTextForPlayer(playerid, "~r~Banned", 5000, 5);
        		SendClientMessage(playerid, COLOR_RED, "You have been banned from SGDM. You were banned by SGDM.(SGDM BOT)");
        		SendClientMessage(playerid, COLOR_ORANGE, "If you think this ban is unfair post an appeal at www.SOON.net");

 				BanEx(playerid, "Health/God Hacks Detected");
	        	return 1;
        	}
            //Anti Weapon Cheat
            for(new w; w < sizeof(BannableWeapons); w++)
    		{
        		if(GetPlayerWeapon(playerid) == BannableWeapons[w])
        		{
            		format(string, sizeof(string), "SGDM has banned %s [%d] from SGDM - Reason: Weapon hacks detected", pName(playerid), playerid);
	        		SendClientMessageToAll(COLOR_RED, string);
	        		SendClientMessageToAll(COLOR_WHITE, "SGDM: OWNED!");
        			PlayerInfo[playerid][pBanned] = 0;
        			GameTextForPlayer(playerid, "~r~Banned", 5000, 5);
        			SendClientMessage(playerid, COLOR_RED, "You have been banned from SGDM. You were banned by SGDM.(SGDM BOT)");
        			SendClientMessage(playerid, COLOR_ORANGE, "If you think this ban is unfair post an appeal at www.SOON.net");

					BanEx(playerid, "Weapon Hacks Detected");
	        		return 1;
        		}
        	}
        	//Auto Ping Kicker
        	if(GetPlayerPing(playerid) >= MAX_PING)
        	{
        	    format(string, sizeof(string), "SGDM: %s reduce your ping then relog, its too high!", pName(playerid));
                SendClientMessageToAll(COLOR_WHITE, string);
				format(string, sizeof(string), "SGDM has kicked %s [%d] from SGDM - Reason: Ping reached %d", pName(playerid), playerid, MAX_PING);
                SendClientMessageToAll(COLOR_RED, string);
        		GameTextForPlayer(playerid, "~r~Kicked", 5000, 5);
        		SendClientMessage(playerid, COLOR_RED, "You have been kicked from SGDM. You were kicked by SGDM.(SGDM BOT)");
        		SendClientMessage(playerid, COLOR_ORANGE, "If you think this kick is unfair complain at www.Soon.net");
   				Kick(playerid);
   				return 1;
        	}
        }
    }
	return 1;
}



Re: array is to small ? - Pottus - 03.05.2015

Quote:
Originally Posted by arlindi
Посмотреть сообщение
Dont use 2000 Its too big use something 128 or 256
That is a timer not an array silly.