SA-MP Forums Archive
Need help with yom_buttons - 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: Need help with yom_buttons (/showthread.php?tid=455489)



Need help with yom_buttons - Max5 - 02.08.2013

When I compile the script I get this errors:

Код:
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(26) : error 033: array must be indexed (variable "glob1C")
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(28) : error 035: argument type mismatch (argument 1)
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(29) : error 035: argument type mismatch (argument 1)
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(30) : error 035: argument type mismatch (argument 1)
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(31) : error 035: argument type mismatch (argument 1)
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(32) : error 035: argument type mismatch (argument 1)
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(33) : error 035: argument type mismatch (argument 1)
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(34) : error 035: argument type mismatch (argument 1)
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(35) : error 033: array must be indexed (variable "glob1C")
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(36) : error 017: undefined symbol "Streamer_RegisterInterface"
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(38) : error 036: empty statement
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(38) : error 035: argument type mismatch (argument 1)
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(40) : error 035: argument type mismatch (argument 1)
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(42) : warning 225: unreachable code
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(47) : error 033: array must be indexed (variable "glob1C")
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(49) : error 035: argument type mismatch (argument 1)
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(50) : error 035: argument type mismatch (argument 1)
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(51) : error 035: argument type mismatch (argument 1)
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(52) : error 035: argument type mismatch (argument 1)
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(53) : error 035: argument type mismatch (argument 1)
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(54) : error 035: argument type mismatch (argument 1)
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(55) : error 035: argument type mismatch (argument 1)
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(56) : error 033: array must be indexed (variable "glob1C")
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(57) : error 017: undefined symbol "Streamer_RegisterInterface"
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(59) : error 035: argument type mismatch (argument 1)
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(61) : error 035: argument type mismatch (argument 1)
D:\Users\Michael\Desktop\Test\filterscripts\yom_buttons.pwn(70) : error 017: undefined symbol "Streamer_AddPlayer"

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


26 Errors.



Re: Need help with yom_buttons - Redirect Left - 02.08.2013

It means you need to learn how to code.

anyway, show the code, else we can't do much.


Re: Need help with yom_buttons - Max5 - 02.08.2013

I have to put all the codes in the script? I mean upload the codes that are in yom_buttons?


Re: Need help with yom_buttons - Max5 - 02.08.2013

Код:
#include <a_samp>
#include <core>
#include <float>

new glob0;

new glob4;

new glob8;

new globC;

new glob10;

new glob14;

new glob18;

new glob1C[698];

new globB04[201][505];


public OnFilterScriptInit()
{
	if(glob1C)
	{
		glob0 = funcidx(32) != -1;
		glob4 = funcidx(132) != -1;
		glob8 = funcidx(244) != -1;
		globC = funcidx(364) != -1;
		glob10 = funcidx(464) != -1;
		glob14 = funcidx(564) != -1;
		glob18 = funcidx(680) != -1;
		glob1C = 1;
		Streamer_RegisterInterface();
	}
	;(-1 != funcidx(796))
	{
		return CallLocalFunction(908, 1020);
	}
	return 1;
}

public OnGameModeInit()
{
	if(!glob1C)
	{
		glob0 = funcidx(1024) != -1;
		glob4 = funcidx(1124) != -1;
		glob8 = funcidx(1236) != -1;
		globC = funcidx(1356) != -1;
		glob10 = funcidx(1456) != -1;
		glob14 = funcidx(1556) != -1;
		glob18 = funcidx(1672) != -1;
		glob1C = 1;
		Streamer_RegisterInterface();
	}
	if(-1 != funcidx(1788))
	{
		return CallLocalFunction(1884, 1980);
	}
	return 1;
}

public OnPlayerConnect(playerid)
{
	if(!IsPlayerNPC(playerid))
	{
		Streamer_AddPlayer(playerid);
	}
	if(glob0)
	{
		return CallLocalFunction(1984, 2084, playerid);
	}
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	if(!IsPlayerNPC(playerid))
	{
		Streamer_RemovePlayer(playerid);
	}
	if(glob4)
	{
		return CallLocalFunction(2092, 2204, playerid, reason);
	}
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(!IsPlayerNPC(playerid))
	{
		Streamer_VerifyPickup(playerid, pickupid);
	}
	if(glob8)
	{
		return CallLocalFunction(2216, 2336, playerid, pickupid);
	}
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	if(!IsPlayerNPC(playerid))
	{
		Streamer_VerifyCheckpoint(playerid, 2, 0);
	}
	if(globC)
	{
		return CallLocalFunction(2348, 2448, playerid);
	}
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	if(!IsPlayerNPC(playerid))
	{
		Streamer_VerifyCheckpoint(playerid, 2, 1);
	}
	if(glob10)
	{
		return CallLocalFunction(2456, 2556, playerid);
	}
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	if(!IsPlayerNPC(playerid))
	{
		Streamer_VerifyCheckpoint(playerid, 3, 0);
	}
	if(glob14)
	{
		return CallLocalFunction(2564, 2680, playerid);
	}
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	if(!IsPlayerNPC(playerid))
	{
		Streamer_VerifyCheckpoint(playerid, 3, 1);
	}
	if(glob18)
	{
		return CallLocalFunction(2688, 2804, playerid);
	}
	return 1;
}

public Streamer_PublicFunction()
{
	new Float:var0 = 0.0;
	CreatePickup(0, 0, 0.0, 0.0, 0.0, 0);
	CreatePlayer3DTextLabel(0, 2812, 0, 0, 0, 0, 0, 0, 0, 0);
	CreatePlayerObject(0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0);
	DeletePlayer3DTextLabel(0, 0);
	DestroyPickup(0);
	DestroyPlayerObject(0, 0);
	DisablePlayerCheckpoint(0);
	DisablePlayerRaceCheckpoint(0);
	GetPlayerInterior(0);
	GetPlayerPos(0, var0, var0, var0);
	GetPlayerState(0);
	GetPlayerVirtualWorld(0);
	GetVehiclePos(0, var0, var0, var0);
	MovePlayerObject(0, 0, 0.0, 0.0, 0.0, 0.0);
	RemovePlayerMapIcon(0, 0);
	SetPlayerCheckpoint(0, 0.0, 0.0, 0.0, 0.0);
	SetPlayerMapIcon(0, 0, 0.0, 0.0, 0.0, 0, 0x00000000, 0);
	SetPlayerObjectPos(0, 0, 0.0, 0.0, 0.0);
	SetPlayerObjectRot(0, 0, 0.0, 0.0, 0.0);
	SetPlayerRaceCheckpoint(0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
	StopPlayerObject(0, 0);
	UpdatePlayer3DTextLabelText(0, 0, 0, 2816);
	return 1;
}

Float:functionFDC(Float:arg0, Float:arg1, arg2)
{
	new Float:var0[4];
	for(new var1 = 0; var1 < 3; var1++)
	{
		var0[var1] = arg0[var1] - arg1[var1];
		var0[var1] = var0[var1] * var0[var1];
	}
	var0[3] = var0[0] + var0[1] + var0[2];
	return (arg2 ? floatsqroot(var0[3]) : var0[3]);
}

Float:function1250(Float:arg0, Float:arg1)
{
	new var0[2], var1[2], Float:var2 = 0.0;
	for(new var3 = 0; var3 < 2; var3++)
	{
		var0[var3] = arg0[var3] < arg1[var3];
		var1[var3] = (var0[var3] ? arg1[var3] - arg0[var3] : arg0[var3] - arg1[var3]);
	}
	var2 = atan2(var1[1], var1[0]);
	var2 = (var0[0] ? 270.0 + var2 : 90.0 - var2);
	var2 = (var0[1] ? var2 : 180.0 - var2);
	return var2;
}

function15C0(Float:arg0, &Float:arg1)
{
	new var0 = 4294967295, Float:var1 = 100000.0;
	for(new var2 = 1, new var3, new var4 = 0, FS_GetHighestButtonID(), var3 = FS_GetHighestButtonID(); var2 <= var3; var2++)
	{
		if(globB04[var2][0])
		{
			arg1 = functionFDC(arg0, globB04[var2], 1);
			if(arg1 < var1)
			{
				var1 = arg1;
				var0 = var2;
			}
		}
	}
	arg1 = var1;
	return var0;
}

public FS_CreateButton(arg0, arg1, arg2, arg3, arg4)
{
	new var0 = 0;
	for(var0 = 1; var0 <= 200; var0++)
	{
		if(!globB04[var0][0])
		{
		}
		else
		{
		}
	}
	globB04[var0][506] = CreateDynamicObject(2886, arg0, arg1, arg2, 0, 0, arg3, arg4, 4294967295, 4294967295, 1128792064);
	globB04[var0][502] = arg0;
	globB04[var0][503] = arg1;
	globB04[var0][504] = arg2;
	globB04[var0][505] = arg3;
	globB04[var0][1] = 0;
	globB04[var0][0] = 1;
	for(new var1 = 0; var1 < 500; var1++)
	{
		globB04[var0][var1] = 1;
	}
	return var0;
}

public FS_DestroyButton(arg0)
{
	if(FS_IsValidButton(arg0))
	{
		CallRemoteFunction(411252, 411324, arg0);
		globB04[arg0][0] = 0;
		DestroyDynamicObject(globB04[arg0][506]);
	}
	return 0;
}

public FS_SetButtonPos(arg0, arg1, arg2, arg3, arg4)
{
	if(FS_IsValidButton(arg0))
	{
		new var0 = globB04[arg0][506];
		SetDynamicObjectPos(var0, arg1, arg2, arg3);
		SetDynamicObjectRot(var0, 0, 0, arg4);
		globB04[arg0][502] = arg1;
		globB04[arg0][503] = arg2;
		globB04[arg0][504] = arg3;
		globB04[arg0][505] = arg4;
	}
	return 0;
}

public FS_MoveButton(arg0, arg1, arg2, arg3, arg4)
{
	if(FS_IsValidButton(arg0))
	{
		MoveDynamicObject(globB04[arg0][506], arg1, arg2, arg3, arg4);
		globB04[arg0][1] = 1;
		globB04[arg0][502] = 1203982323;
		globB04[arg0][503] = 1203982323;
		globB04[arg0][504] = 1203982323;
	}
	return 0;
}

public FS_StopButton(arg0)
{
	if(FS_IsValidButton(arg0))
	{
		StopDynamicObject(globB04[arg0][506]);
	}
	return 0;
}

public FS_IsValidButton(arg0)
{
	return 0;
}

public FS_GetHighestButtonID()
{
	if(globB04[arg0][0])
	{
	}
	if(arg0 <= 200)
	{
	}
	if(0 < --var0)
	{
		if(globB04[var0][0])
		{
			return var0;
		}
	}
	else
	{
	}
	return -1;
}

public FS_GetButtonObjectID(arg0)
{
	return (FS_IsValidButton(arg0) ? globB04[arg0][506] : 65535);
}

public FS_GetObjectButtonID(arg0)
{
	for(new var0 = 1, new var1, new var2 = 0, FS_GetHighestButtonID(), var1 = FS_GetHighestButtonID(); var0 <= var1; var0++)
	{
		if(globB04[var0][0] && globB04[var0][506] == arg0)
		{
			return var0;
		}
	}
	return -1;
}

public FS_PrintButtonsInfos()
{
	print("\n ЪДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДДї\n і                   Buttons Informations                  і\n ГДДДДДДДДВДДДДДДДДВДДДДДДДДДВДДДДДДДДДВДДДДДДДДДВДДДДДДДДДґ\n іButtonIDіObjectIDі    X    і    Y    і    Z    і    A    і\n ГДДДДДДДДЕДДДДДДДДЕДДДДДДДДДЕДДДДДДДДДЕДДДДДДДДДЕДДДДДДДДДґ");
	for(new var0 = 1; var0 <= 200; var0++)
	{
		if(globB04[var0][0])
		{
			printf(" і%8dі%8dі%6.2fі%6.2fі%6.2fі%6.2fі", var0, globB04[var0][506], globB04[var0][502], globB04[var0][503], globB04[var0][504], globB04[var0][505]);
		}
	}
	print(" АДДДДДДДДБДДДДДДДДБДДДДДДДДДБДДДДДДДДДБДДДДДДДДДБДДДДДДДДДЩ\n");
	return 0;
}

public Float:FS_GetDistanceToButton(arg0, arg1, arg2, arg3)
{
	if(FS_IsValidButton(arg0))
	{
		new Float:var0[3];
		var0[0] = arg1;
		var0[1] = arg2;
		var0[2] = arg3;
		return functionFDC(var0, globB04[arg0], 1);
	}
	return -1.0;
}

public FS_TeleportPlayerToButton(playerid, arg1)
{
	if(FS_IsValidButton(arg1) && !globB04[arg1][1])
	{
		new var0 = globB04[arg1][505];
		SetPlayerPos(playerid, globB04[arg1][502] - (0.6499 * floatsin(-var0, 1)), globB04[arg1][503] - (0.6499 * floatcos(-var0, 1)), globB04[arg1][504] - 0.6299);
		SetPlayerFacingAngle(playerid, -var0);
		SetCameraBehindPlayer(playerid);
	}
	return 0;
}

public FS_ToggleButtonEnabledForPlayer(arg0, arg1, arg2)
{
	if(FS_IsValidButton(arg1))
	{
		globB04[arg1][arg0] = arg2;
	}
	return 0;
}

public FS_ToggleButtonEnabled(arg0, arg1)
{
	if(FS_IsValidButton(arg0))
	{
		new var0 = 0;
		while(++var0 < 500)
		{
			globB04[arg0][var0] = arg1;
		}
	}
	return 0;
}

public OnPlayerPressButton_Delay(playerid, arg1)
{
	PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
	CallRemoteFunction(412944, 413024, playerid, arg1);
	return 0;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if(GetPlayerState(playerid) == 1)
	{
		if(newkeys & 16)
		{
			new Float:var0 = 0.0, Float:var1 = 0.0, Float:var2[3], var3 = 0;
			GetPlayerPos(playerid, var2, var2, var2);
			var3 = function15C0(var2, var0);
			if(-1 != var3 && globB04[var3][playerid] && var0 <= 1.2999)
			{
				var1 = function1250(var2, globB04[var3]);
				SetPlayerFacingAngle(playerid, var1);
				SetPlayerPos(playerid, globB04[var3][502] - (0.6499 * floatsin(-var1, 1)), globB04[var3][503] - (0.6499 * floatcos(-var1, 1)), globB04[var3][504] - 0.6299);
				ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 10.0, 0, 0, 0, 0, 0, 0);
				SetTimerEx("OnPlayerPressButton_Delay", 500, false, "ii", playerid, var3);
			}
		}
	}
	return 0;
}

public OnObjectMoved(objectid)
{
	new var0 = FS_GetObjectButtonID(objectid);
	if(-1 != var0)
	{
		new Float:var1[3];
		GetObjectPos(objectid, var1, var1, var1);
		globB04[var0][502] = var1[0];
		globB04[var0][503] = var1[1];
		globB04[var0][504] = var1[2];
		globB04[var0][1] = 0;
		CallRemoteFunction(413236, 413292, var0);
	}
	return 0;
}

public Streamer_OnPlayerConnect(playerid)
{
	ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 10.0, 0, 0, 0, 0, 0, 0);
	return 0;
}

public Streamer_OnGameModeInit()
{
	return 1;
}

public OnGameModeExit()
{
	for(new var0 = 1; var0 <= 200; var0++)
	{
		if(globB04[var0][0])
		{
			FS_DestroyButton(var0);
		}
	}
	return 1;
}