|
Author
|
Message
|
|
Member
|

01-06-2005
, 05:30
superhero help
|
#1
|
i have make a superhero but when i compile it it dont work
Quote:
// vegeta-power up
//created for by funniest
copy and paste in shconfig.ini
//vegeta
vegeta_level 10 //what level is he avalible
vegeta_heal 2000 //how much he heal
vegeta_gravity 0 //how much the gravity is for him
#include <amxmodx>
#include <xtrafun>
#include <vexd_utilities>
#include <superheromod.ini>
// VARIABLES
new gheroname[]="vegeta"
new ghasvegetapower[SH_MAXSLOTS+1]
new bool:gcanheal[SH_MAXSLOTS+1]
new bool:gcangravity[SH_MAXSLOTS+1]
//--------------------------------------
public plugin_init()
{
// Plugin info
register_plugin("SUPERHERO VEGETA","1.6","funniest")
// DO NOT EDIT THIS FILE CVARS, USE THE SHCONFI:GHF
register_cvar("vegeta_level", "10")
register_cvar("vegeta_heal", "2000")
register_cvar("vegeta_gravity", "0")
// fire the event to create this hero!
shCreatehero(gheroname, "vegeta_heal", "you dont need to do something!", false; "vegeta_level10")
// register events this hero will respond to! (and server commands)
// INIT
register_srvcmd("vegeta_init", "vegeta_init")
shregheroInit(gheroname, "vegeta_init")
//new round
register_event("resethud","newround","b"
// vegeta_heal
set_task(0.1,"vegeta_loop",0,"",0,"b" )
}
//-------------------------------------------------------------------------------
public vegeta_init()
{
// first argument is an id
new temp[6]
read_argv(1,temp,5)
new id=str_to_num(temp)
// 2nd argument is 0 or 1 depending on whether the id has vegeta
read_argv(2,temp,5)
new haspowers=str_to_num(temp)
ghasvegetapower[id]=!0)
gheal[id]=true
}
//-------------------------------------------------------------------------------
public newround(id)
{
gheal[id]=true
}
//-------------------------------------------------------------------------------
public_vegeta_loop()
{
// first argument is an id with vegeta powers!
new temp[6]
read_argv(1,temp,5)
new id=str_to_num(temp)
new float:velocity[3]
if ( !is_user_alive(id) || !ghasvegetapower[id] ) return plugin_handled
Entvars_get_vector(id, EV_VEC_Velocity, Vlocity)
if ( ( velocity[2] >= -10.0 && velocity[2] <=10.0 ) ) {
gheal[id]=true
}
if ( gheal[id] ) {
Entvars_Get_Vector(id, EV_VEC_velocity, velocity)
if ( (Entvars_Get_Int(id,EV_INT_button)&IN_JUMP) && (velocity[2] < -10.0 || velocity[2] > 10.0) ) {
velocity[2]=velocity[2] + get_cvar_float("vegeta_heal")
Entvars_Set_Vector(id, EV_VEC_velocity, velocity)
gheal[id]=false
}
}
return PLUGIN_HANDLED
}
//-----------------------------------------------------------------------
it only stand 1 error
|
__________________
|
|
|
|