Raised This Month: $52 Target: $400
 13% 

Blockmaker error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mustq
New Member
Join Date: Feb 2019
Old 02-09-2019 , 13:39   Blockmaker error
Reply With Quote #1

yo! i have problem with bm so i get these errors:
bcm_6.1 (1).sma(991) : error 017: undefined symbol "ActionGrenade"
bcm_6.1 (1).sma(992) : error 017: undefined symbol "ActionWeapon"
bcm_6.1 (1).sma(5389) : warning 203: symbol is never used: "g_weapon_values"
so if somebody could help me out with this trouble i'll be thankful. Just send me msg, then i'll send code or .sma file

Last edited by mustq; 02-09-2019 at 20:57. Reason: Weapon block prop
mustq is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-09-2019 , 18:25   Re: Blockmaker error
Reply With Quote #2

How can we help you when you didn't provide the code?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
mustq
New Member
Join Date: Feb 2019
Old 02-09-2019 , 19:12   Re: Blockmaker error
Reply With Quote #3

Code:
enum _:BlockTypes
{
	PLATFORM,
	BUNNYHOP,
	DAMAGE,
	HEALER,
	NO_FALL_DAMAGE,
	ICE,
	TRAMPOLINE,
	SPEED_BOOST,
	DEATH,
	LOW_GRAVITY,
	SLAP,
	HONEY,
	CT_BARRIER,
	T_BARRIER,
	GLASS,
	NO_SLOW_DOWN_BUNNYHOP,
	DELAYED_BUNNYHOP,
	INVINCIBILITY,
	STEALTH,
	BOOTS_OF_SPEED,
	GRENADE,
	WEAPON
};

enum _:Teleports
{
	TELEPORT_START,
	TELEPORT_DESTINATION
};

enum
{
	NORMAL,
	TINY,
	LARGE,
	POLE
};

enum
{
	NORMAL,
	GLOWSHELL,
	TRANSCOLOR,
	TRANSALPHA,
	TRANSWHITE
};

new g_render[BlockTypes];
new g_red[BlockTypes];
new g_green[BlockTypes];
new g_blue[BlockTypes];
new g_alpha[BlockTypes];

new const g_block_names[BlockTypes][] =
{
	"Platform",
	"Bunnyhop",
	"Damage",
	"Healer",
	"No Fall Damage",
	"Ice",
	"Trampoline",
	"Speed Boost",
	"Death",
	"Low Gravity",
	"Slap",
	"Honey",
	"CT Barrier",
	"T Barrier",
	"Glass",
	"No Slow Down Bunnyhop",
	"Delayed Bunnyhop",
	"Invincibility",
	"Stealth",
	"Boots Of Speed",
	"Grenade",
	"Weapon"
};

new const g_property1_name[BlockTypes][] =
{
	"",
	"No Fall Damage",
	"Damage Per Interval",
	"Health Per Interval",
	"",
	"",
	"Upward Speed",
	"Forward Speed",
	"",
	"Gravity",
	"Hardness",
	"Speed In Honey",
	"",
	"",
	"",
	"No Fall Damage",
	"Delay Before Dissapear",
	"Invincibility Time",
	"Stealth Time",
	"Boots Of Speed Time",
	"Grenade",
	"Weapon"
};

new const g_property1_default_value[BlockTypes][] =
{
	"",
	"0",
	"5",
	"1",
	"",
	"",
	"500",
	"1000",
	"",
	"200",
	"2",
	"75",
	"",
	"",
	"",
	"0",
	"1",
	"10",
	"10",
	"10",
	"0",
	"0"
};

new const g_property2_name[BlockTypes][] =
{
	"",
	"",
	"Interval Between Damage",
	"Interval Between Heals",
	"",
	"",
	"",
	"Upward Speed",
	"",
	"",
	"",
	"",
	"",
	"",
	"",
	"",
	"",
	"Delay After Usage",
	"Delay After Usage",
	"Delay After Usage",
	"Amount",
	"Ammo"
};

new const g_property2_default_value[BlockTypes][] =
{
	"",
	"",
	"0.5",
	"0.5",
	"",
	"",
	"",
	"200",
	"",
	"",
	"",
	"",
	"",
	"",
	"",
	"",
	"",
	"60",
	"60",
	"60",
	"1",
	"1"
};

new const g_property3_name[BlockTypes][] =
{
	"",
	"Transparency",
	"Transparency",
	"Transparency",
	"Transparency",
	"Transparency",
	"Transparency",
	"Transparency",
	"Transparency",
	"Transparency",
	"Transparency",
	"Transparency",
	"Transparency",
	"Transparency",
	"",
	"Transparency",
	"Transparency",
	"",
	"",
	"Speed",
	"Transparency",
	"Transparency"
};

new const g_property3_default_value[BlockTypes][] =
{
	"",
	"255",
	"255",
	"255",
	"255",
	"255",
	"255",
	"255",
	"255",
	"255",
	"255",
	"255",
	"255",
	"255",
	"",
	"255",
	"255",
	"",
	"",
	"400",
	"255",
	"255"
};

new const g_property4_name[BlockTypes][] =
{
	"",
	"On Top Only",
	"On Top Only",
	"On Top Only",
	"",
	"",
	"On Top Only",
	"On Top Only",
	"On Top Only",
	"On Top Only",
	"On Top Only",
	"On Top Only",
	"On Top Only",
	"On Top Only",
	"",
	"On Top Only",
	"On Top Only",
	"On Top Only",
	"On Top Only",
	"On Top Only",
	"On Top Only",
	"On Top Only"
};

new const g_property4_default_value[BlockTypes][] =
{
	"",
	"0",
	"1",
	"1",
	"",
	"",
	"0",
	"0",
	"1",
	"0",
	"1",
	"0",
	"0",
	"0",
	"",
	"0",
	"0",
	"1",
	"1",
	"1",
	"1",
	"1"
};

new const g_block_save_ids[BlockTypes] =
{
	'A',
	'B',
	'C',
	'D',
	'E',
	'F',
	'G',
	'H',
	'I',
	'J',
	'K',
	'L',
	'M',
	'N',
	'O',
	'P',
	'Q',
	'R',
	'S',
	'T',
	'U',
	'V'
};

new const g_weapon_names[][] =
{
	"Glock",
	"Usp",
	"Awp"
};

new const g_weapon_values[][] =
{
	"weapon_glock",
	"weapon_usp",
	"weapon_awp"
};

new g_block_models[BlockTypes][256];

public plugin_precache()
{
	g_block_models[PLATFORM] =		g_model_platform;
	g_block_models[BUNNYHOP] =		g_model_bunnyhop;
	g_block_models[DAMAGE] =		g_model_damage;
	g_block_models[HEALER] =		g_model_healer;
	g_block_models[NO_FALL_DAMAGE] =	g_model_no_fall_damage;
	g_block_models[ICE] =			g_model_ice;
	g_block_models[TRAMPOLINE] =		g_model_trampoline;
	g_block_models[SPEED_BOOST] =		g_model_speed_boost;
	g_block_models[DEATH] =			g_model_death;
	g_block_models[LOW_GRAVITY] =		g_model_low_gravity;
	g_block_models[SLAP] =			g_model_slap;
	g_block_models[HONEY] =			g_model_honey;
	g_block_models[CT_BARRIER] =		g_model_ct_barrier;
	g_block_models[T_BARRIER] =		g_model_t_barrier;
	g_block_models[GLASS] =			g_model_glass;
	g_block_models[NO_SLOW_DOWN_BUNNYHOP] =	g_model_no_slow_down_bunnyhop;
	g_block_models[DELAYED_BUNNYHOP] =	g_model_delayed_bunnyhop;
	g_block_models[INVINCIBILITY] =		g_model_invincibility;
	g_block_models[STEALTH] =		g_model_stealth;
	g_block_models[BOOTS_OF_SPEED] =	g_model_boots_of_speed;
	g_block_models[GRENADE] =		g_model_grenade;
	g_block_models[WEAPON] =		g_model_weapon;
	
	SetupBlockRendering(GLASS, TRANSWHITE, 255, 255, 255, 100);
	SetupBlockRendering(INVINCIBILITY, GLOWSHELL, 255, 255, 255, 16);
	SetupBlockRendering(STEALTH, TRANSWHITE, 255, 255, 255, 100);
	
	new block_model[256];
	for ( new i = 0; i < BlockTypes; ++i )
	{
		precache_model(g_block_models[i]);
		
		SetBlockModelName(block_model, g_block_models[i], "Tiny");
		precache_model(block_model);
		
		SetBlockModelName(block_model, g_block_models[i], "Large");
		precache_model(block_model);
		
		SetBlockModelName(block_model, g_block_models[i], "Pole");
		precache_model(block_model);
	}
	
	precache_model(g_sprite_light);
	
	precache_model(g_sprite_teleport_start);
	precache_model(g_sprite_teleport_destination);
	g_sprite_beam = precache_model("sprites/zbeam4.spr");
	
	precache_sound(g_sound_invincibility);
	precache_sound(g_sound_stealth);
	precache_sound(g_sound_boots_of_speed);
Code:
ShowPropertiesMenu(id, ent)
{
	static title[32], block_type, entry[32], property[5], num[3], blanks;
	
	formatex(title, charsmax(title), "\r[%s] \ySet Properties", PLUGIN_PREFIX);
	
	block_type = entity_get_int(ent, EV_INT_body);
	blanks = 0;
	
	new menu = menu_create(title, "PropertiesMenuHandle");
	
	if ( g_property1_name[block_type][0] )
	{
		GetProperty(ent, 1, property);
		
		if ( block_type == BUNNYHOP
		|| block_type == NO_SLOW_DOWN_BUNNYHOP )
		{
			formatex(entry, charsmax(entry), "%s: %s", g_property1_name[block_type], property[0] == '1' ? "\yOn" : "\rOff");
		}
		else if ( block_type == SLAP )
		{
			formatex(entry, charsmax(entry), "%s: \y%s", g_property1_name[block_type], property[0] == '3' ? "High" : property[0] == '2' ? "Medium" : "Low");
		}
		else if ( block_type == WEAPON )
		{
			formatex(entry, charsmax(entry), "%s: \y%s", g_property1_name[block_type], g_weapon_names[property[0]]);
		}
		else
		{
			formatex(entry, charsmax(entry), "%s: \y%s", g_property1_name[block_type], property);
		}
		
		menu_additem(menu, entry, "1");
	}
	else blanks++;
	
	if ( g_property2_name[block_type][0] )
	{
		if ( g_property1_name[block_type][0] )
		{
			num = "2";
		}
		else
		{
			num = "1";
		}
		
		GetProperty(ent, 2, property);
		
		formatex(entry, charsmax(entry), "%s: \y%s", g_property2_name[block_type], property);
		
		menu_additem(menu, entry, num);
	}
	else blanks++;
	
	if ( g_property3_name[block_type][0] )
	{
		if ( g_property1_name[block_type][0] && g_property2_name[block_type][0] )
		{
			num = "3";
		}
		else if ( g_property1_name[block_type][0]
		|| g_property2_name[block_type][0] )
		{
			num = "2";
		}
		else
		{
			num = "1";
		}
		
		GetProperty(ent, 3, property);
		
		if ( block_type == BOOTS_OF_SPEED
		|| property[0] != '0' && !( property[0] == '2' && property[1] == '5' && property[2] == '5' ) )
		{
			formatex(entry, charsmax(entry), "%s: \y%s", g_property3_name[block_type], property);
		}
		else
		{
			formatex(entry, charsmax(entry), "%s: \rOff", g_property3_name[block_type]);
		}
		
		menu_additem(menu, entry, num);
	}
	else blanks++;
	
	if ( g_property4_name[block_type][0] )
	{
		if ( g_property1_name[block_type][0] && g_property2_name[block_type][0] && g_property3_name[block_type][0] )
		{
			num = "4";
		}
		else if ( g_property1_name[block_type][0] && g_property2_name[block_type][0]
		|| g_property1_name[block_type][0] && g_property3_name[block_type][0]
		|| g_property2_name[block_type][0] && g_property3_name[block_type][0] )
		{
			num = "3";
		}
		else if ( g_property1_name[block_type][0]
		|| g_property2_name[block_type][0]
		|| g_property3_name[block_type][0] )
		{
			num = "2";
		}
		else
		{
			num = "1";
		}
		
		GetProperty(ent, 4, property);
		
		formatex(entry, charsmax(entry), "%s: %s", g_property4_name[block_type], property[0] == '1' ? "\yYes" : "\rNo");
		
		menu_additem(menu, entry, num);
	}
	else blanks++;
	
	blanks += 5;
	while ( blanks )
	{
		menu_addblank(menu, blanks > 2 ? 1 : 0);
		blanks--;
	}
	
	g_property_info[id][1] = ent;
	
	menu_setprop(menu, MPROP_EXITNAME, "Back");
	menu_display(id, menu);
}
Code:
ToggleProperty(id, property)
{
	new ent = g_property_info[id][1];
	if ( !is_valid_ent(ent) )
	{
		BCM_Print(id, "That block has been deleted!");
		ShowBlockMenu(id);
		g_current_menu[id] = MENU_BLOCK;
		return PLUGIN_HANDLED;
	}
	
	static property_value[5];
	GetProperty(ent, property, property_value);
	
	new block_type = entity_get_int(ent, EV_INT_body);
	if ( block_type == WEAPON && property == 1 )
	{
		new weapon_value = str_to_num(property_value[0]);
		
		if( weapon_value < ( sizeof(g_weapon_names) - 1 ) ) 	formatex(property_value, charsmax(property_value), "%i", weapon_value + 1 );
		else 							copy(property_value, charsmax(property_value), "0" );
	}
	else if ( ( block_type == SLAP || block_type == GRENADE ) && property == 1 )
	{
		if ( property_value[0] == '1' )				copy(property_value, charsmax(property_value), "2");
		else if ( property_value[0] == '2' )			copy(property_value, charsmax(property_value), "3");
		else							copy(property_value, charsmax(property_value), "1");
	}
	else
	{
		if ( property_value[0] == '0' )				copy(property_value, charsmax(property_value), "1");
		else							copy(property_value, charsmax(property_value), "0");
	}
	
	SetProperty(ent, property, property_value);
	
	for ( new i = 1; i <= g_max_players; i++ )
	{
		if ( !g_connected[i]
		|| i == id ) continue;
		
		if ( g_current_menu[i] == MENU_PROP
		&& g_property_info[i][1] == ent )
		{
			ShowPropertiesMenu(i, ent);
			g_current_menu[i] = MENU_PROP;
		}
	}
	
	return PLUGIN_HANDLED;
}
Code:
GetProperty(ent, property, property_value[])
{
	switch ( property )
	{
		case 1: pev(ent, pev_message, property_value, 5);
		case 2: pev(ent, pev_netname, property_value, 5);
		case 3: pev(ent, pev_viewmodel2, property_value, 5);
		case 4: pev(ent, pev_weaponmodel2, property_value, 5);
	}
	
	return (property_value[0] ? 1 : 0);
}

SetProperty(ent, property, const property_value[])
{
	switch ( property )
	{
		case 1: set_pev(ent, pev_message, property_value, 5);
		case 2: set_pev(ent, pev_netname, property_value, 5);
		case 3:
		{
			set_pev(ent, pev_viewmodel2, property_value, 5);
			
			new block_type = entity_get_int(ent, EV_INT_body);
			if ( g_property3_name[block_type][0] && block_type != BOOTS_OF_SPEED )
			{
				new transparency = str_to_num(property_value);
				if ( !transparency
				|| transparency == 255 )
				{
					SetBlockRendering(ent, g_render[block_type], g_red[block_type], g_green[block_type], g_blue[block_type], g_alpha[block_type]);
				}
				else
				{
					SetBlockRendering(ent, TRANSALPHA, 255, 255, 255, transparency);
				}
			}
		}
		case 4: set_pev(ent, pev_weaponmodel2, property_value, 5);
	}

	return 1;
}
So grenade block doesn't matter and it should work like when you land on it it gives you automatically the weapon you set in prop.
mustq is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:41.


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode