Raised This Month: $51 Target: $400
 12% 

Increased Gravity Hero


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
notusian
Junior Member
Join Date: Dec 2004
Location: CA
Old 04-30-2011 , 17:31   Increased Gravity Hero
Reply With Quote #1

Trying to rip superman for a hero which increases gravity. However, in game the gravity is not increased. Am I doing something just plain wrong or is there some property of gravity I don't know about?

Code:
#include <superheromod>

public plugin_init()
{
	// Plugin Info
	register_plugin("SUPERHERO Heavy", "1.0", "Superman rip")

	new pcvarLevel = register_cvar("heavy_level", "8")
	new pcvarArmor = register_cvar("heavy_armor", "130")
	new pcvarHealth = register_cvar("heavy_health", "130")
	new pcvarGravity = register_cvar("heavy_gravity", "1.5")

	new heroID = sh_create_hero("Heavy", pcvarLevel)
	sh_set_hero_info(heroID, "Health/Armor/Gravity", "More HP & Armor, Increased Gravity")
	sh_set_hero_hpap(heroID, pcvarHealth, pcvarArmor)
	sh_set_hero_grav(heroID, pcvarGravity)
	
}
notusian is offline
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 04-30-2011 , 17:48   Re: Increased Gravity Hero
Reply With Quote #2

I guess you mean decrease?


Oh please excuse me but are you stupid? A gravity value above 1.0 will be ignored as lower gravity is set by values under 1.0..
__________________
The Art of War is offline
notusian
Junior Member
Join Date: Dec 2004
Location: CA
Old 04-30-2011 , 17:52   Re: Increased Gravity Hero
Reply With Quote #3

I am trying to make a user "heavier" so assigning them a value of something like 1000 or 1200 gravity as opposed to 800. Does sh_set_hero_grav() not do that?

Last edited by notusian; 04-30-2011 at 17:54.
notusian is offline
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 04-30-2011 , 18:02   Re: Increased Gravity Hero
Reply With Quote #4

That is impossible without modifying the core if Im correct, you should probably use the AMXMODX native instead (search).
__________________
The Art of War is offline
notusian
Junior Member
Join Date: Dec 2004
Location: CA
Old 04-30-2011 , 18:08   Re: Increased Gravity Hero
Reply With Quote #5

Yeah, looked at http://www.amxmodx.org/funcwiki.php?go=func&id=125 which led me to believe it was possible.

For the sake of trying to compile I tried the following:
Code:
#include <superheromod>

public plugin_init()
{
	// Plugin Info
	register_plugin("SUPERHERO Heavy", "1.0", "Superman rip")

	new pcvarLevel = register_cvar("heavy_level", "8")
	new pcvarArmor = register_cvar("heavy_armor", "128")
	new pcvarHealth = register_cvar("heavy_health", "128")
	new pcvarGravity = register_cvar("heavy_gravity", "1.2")

	new heroID = sh_create_hero("Heavy", pcvarLevel)
	sh_set_hero_info(heroID, "Health/Armor/Gravity", "More HP & Armor, Increased Gravity")
	sh_set_hero_hpap(heroID, pcvarHealth, pcvarArmor)
	set_user_gravity(heroID, pcvarGravity)//line 19
	
}
however i get:
sh_heavy.sma(19) : warning 213 : tag mismatch

The plugin runs when I use the .amxx with the above compilation, however the hero does not get loaded properly.
notusian is offline
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 04-30-2011 , 18:48   Re: Increased Gravity Hero
Reply With Quote #6

Im pretty sure you cant use heroID as the index... Anyways use this instead:


PHP Code:
public sh_client_spawn(id)
{
    if ( 
gHasHero[id] ) set_user_gravity(idget_pcvar_float(pcvarGravity))

then change the "gHasHero" Hero part to whatever you're using, and remember to register the pcvar for pcvarGravity globally and set it like

Code:
pcvarGravity = register_cvar("whatever_hero", "whatever_value")
in public plugin_init() ( dont use "new" in the plugin_init, set it globally).
__________________

Last edited by The Art of War; 04-30-2011 at 18:51. Reason: I fail
The Art of War is offline
notusian
Junior Member
Join Date: Dec 2004
Location: CA
Old 04-30-2011 , 20:07   Re: Increased Gravity Hero
Reply With Quote #7

yup, that got it working, thanks for your help
notusian is offline
Reply



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 03:13.


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