Raised This Month: $ Target: $400
 0% 

someone help >_<


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Om3gA
Veteran Member
Join Date: Feb 2005
Old 09-05-2005 , 13:09   someone help >_<
Reply With Quote #1

ok well first i need to know how to set the players velocity so it simulates that he is walking on a was so this means that i want thim to go forwards when he jumps or walks on to a wall


and the seccond thing is when i pres the bindet key i wanna set the players vector angels so it looks like he is walking on a wall like i show on this pic
[img]http://img390.**************/img390/4909/dedust00073vu.jpg[/img]
but when i go to teh other side off the wall i want it to look teh same as i showed in that other pic but it looks like this
[img]http://img237.**************/img237/9840/dedust00088qv.jpg[/img]


and i want to add to things to this plugin :
the first one is that when he touches the ground his vector angels are set to normal .
and the seccond thing is that when he walks on the wall and presses the button again you jump off the wall.. like a little jump ^_^

and here is what i have like now:
Code:
// Trinity!

/* CVARS - copy and paste to shconfig.cfg

//credit to the author off scarlet spider he was like my base ^_^

//Trinity
Trinity_level 6
Trinity_wspeed 250.0				//speed she Walks on The walls

*/

#include <amxmodx>
#include <Vexd_Utilities>
#include <shero>

#if !defined AMX_NEW
#include <xtrafun>  //Only for the constants, doesn't use any functions
#endif

new g_heroName[]="Trinity"
new g_heroID
new bool:g_hasTrinityPower[SH_MAXSLOTS+1]
new bool:g_canWalk[SH_MAXSLOTS+1]

public plugin_init() {
	// Plugin Info
	register_plugin("SUPERHERO Trinity","1.0","Om3gA")
	
	// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
	register_cvar("Trinity_level", "0")
	register_cvar("Trinity_wspeed", "250.0")
	
	// FIRE THE EVENT TO CREATE THIS SUPERHERO!
	g_heroID = sh_create_hero(g_heroName)
	sh_hero_info(g_heroID, "Walk On Walls", "Press the bound key and jump/run into a wall to Run on it!")
	sh_hero_bind(g_heroID, true)
	sh_hero_level(g_heroID, get_cvar_num("Trinity_level"))
	
}
public sh_hero_init(id, heroID, mode)
{
	if ( g_heroID == heroID )
	{
		g_hasTrinityPower[id] = (mode != 0)
	}
}
public wall_walk(id) {
	if ( is_user_alive(id) && g_hasTrinityPower[id] && g_canWalk[id]) {
		
		new Float:velocity[3]
		Entvars_Get_Vector(id, EV_VEC_velocity, velocity)
		if ( (Entvars_Get_Int(id,EV_INT_button)&IN_FORWARD) ) {
			velocity[0]=get_cvar_float("trinity_wspeed")
			velocity[2]=80.0
			Entvars_Set_Vector(id, EV_VEC_velocity, velocity)
			
			//THX To Kleenex
			new Float:angles[3]
			entity_get_vector(id, EV_VEC_angles, angles)
			
			angles[2] += 90.0 // Change this to the rotation you want
			entity_set_vector(id, EV_VEC_angles, angles)
			
			entity_set_int(id, EV_INT_fixangle,1)
		}
	}
}

// RESPOND TO KEYDOWN
public sh_hero_key(id, heroID, key)
{
	if ( g_heroID != heroID ) return PLUGIN_HANDLED

	if ( key == SH_KEYDOWN )
	{
	if ( !g_canWalk[id] ) {
		g_canWalk[id]=true
		set_task(0.1,"wall_walk",id,"",0,"b")
		set_hudmessage(20, 255, 20, -1.0, 0.25, 0, 1.0, 1.2, 0.4, 0.4, 95)
		show_hudmessage(id, "You can now walk On walls!")
		return PLUGIN_HANDLED
	}
	if ( !g_canWalk[id] )
		g_canWalk[id]=false
	set_task(0.1,"no_walk",id,"",0,"b")
	remove_task(id)
	set_hudmessage(20, 255, 20, -1.0, 0.25, 0, 1.0, 1.2, 0.4, 0.4, 95)
	show_hudmessage(id, "You canĀ“t walk on walls anymore.")
	
	}
	return PLUGIN_HANDLED
}

public no_walk(id){
	if ( is_user_alive(id) && g_hasTrinityPower[id] && !g_canWalk[id]) {
		
		//THX To Kleenex
		new Float:angles[3]
		entity_get_vector(id, EV_VEC_angles, angles)
		
		angles[2] = 0.0 // Change this to the rotation you want
		entity_set_vector(id, EV_VEC_angles, angles)
		
		entity_set_int(id, EV_INT_fixangle,1)
	}
}
public client_disconnect(id) {
	remove_task(id)
}
public sh_new_spawn(id) {
	g_canWalk[id]=false
}
and yes i know there is allready one trinity hero but this is better coz this aint just morpheus with changet name and mdl O.o
__________________
Om3gA is offline
Send a message via AIM to Om3gA Send a message via MSN to Om3gA Send a message via Yahoo to Om3gA Send a message via Skype™ to Om3gA
yang
Veteran Member
Join Date: May 2005
Location: galoreservers.net
Old 09-05-2005 , 13:18  
Reply With Quote #2

You need to get the FOV (field of view) degrees and say that if it is within certain degree, you would set the vector this way, then the other way if its the other degrees.

As for checking the ground its ez,

for instance this:

Code:
 new flags = Entvars_Get_Int(id, EV_INT_flags)
 if (!flags&(1<<9))
 {
    //code when the person is not on ground
 }
good fight o.O
__________________
yang is offline
Send a message via AIM to yang
Om3gA
Veteran Member
Join Date: Feb 2005
Old 09-05-2005 , 14:15  
Reply With Quote #3

Quote:
Originally Posted by rockell
You need to get the FOV (field of view) degrees and say that if it is within certain degree, you would set the vector this way, then the other way if its the other degrees.
i didnt underestand that like good aite hehe

and here is what i have now ^_^

Code:
// Trinity!

//credit to the author off scarlet spider he was like my base and rockell as usualy Lol

/* CVARS - copy and paste to shconfig.cfg

//Trinity
Trinity_level 6
Trinity_wspeed 250.0				//speed she Walks on The walls

*/

#include <amxmodx>
#include <Vexd_Utilities>
#include <shero>

#if !defined AMX_NEW
#include <xtrafun>  //Only for the constants, doesn't use any functions
#endif

new g_heroName[]="Trinity"
new g_heroID
new bool:g_hasTrinityPower[SH_MAXSLOTS+1]
new bool:g_canWalk[SH_MAXSLOTS+1]

public plugin_init() {
	// Plugin Info
	register_plugin("SUPERHERO Trinity","1.0","Om3gA")
	
	// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
	register_cvar("Trinity_level", "0")
	register_cvar("Trinity_wspeed", "250.0")
	
	// FIRE THE EVENT TO CREATE THIS SUPERHERO!
	g_heroID = sh_create_hero(g_heroName)
	sh_hero_info(g_heroID, "Walk On Walls", "Press the bound key and jump/run into a wall to Run on it and if ya perss it again you jump off the wall!")
	sh_hero_bind(g_heroID, true)
	sh_hero_level(g_heroID, get_cvar_num("Trinity_level"))
	
}
public sh_hero_init(id, heroID, mode)
{
	if ( g_heroID == heroID )
	{
		g_hasTrinityPower[id] = (mode != 0)
	}
}
public wall_walk(id) {
	if ( is_user_alive(id) && g_hasTrinityPower[id] && g_canWalk[id]) {
		
		new Float:velocity[3]
		Entvars_Get_Vector(id, EV_VEC_velocity, velocity)
		if ( (Entvars_Get_Int(id,EV_INT_button)&IN_FORWARD) ) {
			velocity[0]=get_cvar_float("trinity_wspeed")
			velocity[2]=80.0
			Entvars_Set_Vector(id, EV_VEC_velocity, velocity)
			
			//THX To Kleenex
			new Float:angles[3]
			entity_get_vector(id, EV_VEC_angles, angles)
			
			angles[2] += 90.0 // Change this to the rotation you want
			entity_set_vector(id, EV_VEC_angles, angles)
			
			entity_set_int(id, EV_INT_fixangle,1)
		}
	}
}

// RESPOND TO KEYDOWN
public sh_hero_key(id, heroID, key)
{
	if ( g_heroID != heroID ) return PLUGIN_HANDLED

	if ( key == SH_KEYDOWN )
	{
	if ( !g_canWalk[id] ) {
		g_canWalk[id]=true
		set_task(0.1,"wall_walk",id,"",0,"b")
		set_hudmessage(20, 255, 20, -1.0, 0.25, 0, 1.0, 1.2, 0.4, 0.4, 95)
		show_hudmessage(id, "You can now walk On walls!")
		return PLUGIN_HANDLED
	}
	if ( !g_canWalk[id] )
		g_canWalk[id]=false
	set_task(0.1,"jump_off",id,"",0,"b")
	remove_task(id)
	
	}
	return PLUGIN_HANDLED
}
 new flags = Entvars_Get_Int(id, EV_INT_flags) 
 if (!flags&(1<<9)) 
 { 	 
	//THX To Kleenex
	new Float:angles[3]
	entity_get_vector(id, EV_VEC_angles, angles)
		
	angles[2] = 0.0 // Change this to the rotation you want
	entity_set_vector(id, EV_VEC_angles, angles)
		
	entity_set_int(id, EV_INT_fixangle,1)
   
 } 
public jump_off(id){
	if ( is_user_alive(id) && !g_canWalk[id]) {
		
      // here teh code for teh jump
	}
}
public client_disconnect(id) {
	remove_task(id)
}
public sh_new_spawn(id) {
	g_canWalk[id]=false
}

btw thx for your fast help ^_^
__________________
Om3gA is offline
Send a message via AIM to Om3gA Send a message via MSN to Om3gA Send a message via Yahoo to Om3gA Send a message via Skype™ to Om3gA
yang
Veteran Member
Join Date: May 2005
Location: galoreservers.net
Old 09-05-2005 , 14:49  
Reply With Quote #4

field of view is your vision view

take your clone trooper for an example, you shoot lasers with it. U never notice when u turn your field of view (screen) 180degree, the laser come from a different angle? you need to make it so if angle say is greater than 135degree you will turn ur vector angles -90 degree, and if its within 135 degree u turn it 90 degree angle o.O
__________________
yang is offline
Send a message via AIM to yang
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:07.


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