hi,
ich hab emir einen Helden gebastelt, aber irgendwie will er die Rakete nicht starten, die er starten müsste
hier die sma
Code:
#include <amxmod>
#include <amxmisc>
#include <Vexd_Utilities>
#include <xtrafun>
#include <superheromod>
new beam, boom
new gHeroName[]="Goku"
new bool:g_hasGokuPower[SH_MAXSLOTS+1]
new smoke, fire
public plugin_init(){
register_plugin("SUPERHERO Son-Goku","1.1","Greenberet/AssKicR")
register_clcmd("goku_kd","Vexd_CreateRocket",ADMIN_KICK)
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
if (!cvar_exists("goku_level")) register_cvar("goku_level", "10" )
shCreateHero(gHeroName, "Sajajin power", "More HP and AP, Kamehameha, very fast, and fly(work in progress)", true, "goku_level" )
// KEY DOWN
register_srvcmd("goku_kd", "goku_kd")
shRegKeyDown(gHeroName, "goku_kd")
// INIT
register_srvcmd("goku_init", "goku_init")
shRegHeroInit(gHeroName, "goku_init")
//Cvars
register_cvar("goku_level", "10" )
register_cvar("goku_armor", "700" )
register_cvar("goku_health", "500" )
register_cvar("goku_speed", "600" )
register_cvar("goku_radius", "75" )
register_cvar("goku_maxdamage", "200" )
// Let Server know about Som-Gokus Variable
// It is possible that another hero has more hps, less gravity, or more armor
// so rather than just setting these - let the superhero module decide each round
shSetMaxHealth(gHeroName, "goku_health" )
shSetMaxArmor(gHeroName, "goku_armor" )
shSetMaxSpeed(gHeroName, "goku_speed", "[0]" )
}
public goku_init()
{
new temp[128]
// First Argument is an id
read_argv(1,temp,5)
new id=str_to_num(temp)
// 2nd Argument is 0 or 1 depending on whether the id has Som-Gokus powers
read_argv(2,temp,5)
new hasPowers=str_to_num(temp)
g_hasGokuPower[id]=(hasPowers != 0)
if (!g_hasGokuPower[id])
{
shRemHealthPower(id)
shRemArmorPower(id)
shRemSpeedPower(id)
}
}
public vexd_pfntouch(pToucher, pTouched) {
new szClassName[32]
Entvars_Get_String(pToucher, EV_SZ_classname, szClassName, 32);
if(equal(szClassName, "vexd_rocket")) {
emit_sound(pToucher, CHAN_WEAPON, "vox/_period.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
emit_sound(pToucher, CHAN_VOICE, "vox/_period.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
new iOwner
iOwner = Entvars_Get_Edict(pToucher, EV_ENT_owner)
new Float:vExplodeAt[3]
Entvars_Get_Vector(pToucher, EV_VEC_origin, vExplodeAt)
blowUp( iOwner, vExplodeAt )
//RadiusDamage(vExplodeAt, 1, 50)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(3)
write_coord(floatround(vExplodeAt[0]))
write_coord(floatround(vExplodeAt[1]))
write_coord(floatround(vExplodeAt[2]))
write_short(boom)
write_byte(50)
write_byte(15)
write_byte(0)
message_end()
AttachView(iOwner, iOwner) //Resets rocket owner's view (in case of vrocket).
RemoveEntity(pToucher)
}
return 1;
}
public Vexd_CreateVRocket(id,level,cid){
if (!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED
new Float:vOrigin[3]
new Float:vAngles[3]
Entvars_Get_Vector(id, EV_VEC_origin, vOrigin)
Entvars_Get_Vector(id, EV_VEC_v_angle, vAngles)
new NewEnt
NewEnt = CreateEntity("info_target")
if(NewEnt == 0) {
return PLUGIN_HANDLED_MAIN
}
Entvars_Set_String(NewEnt, EV_SZ_classname, "vexd_rocket")
ENT_SetModel(NewEnt, "models/rpgrocket.mdl")
new Float:MinBox[3]
new Float:MaxBox[3]
MinBox[0] = -1.0
MinBox[1] = -1.0
MinBox[2] = -1.0
MaxBox[0] = 1.0
MaxBox[1] = 1.0
MaxBox[2] = 1.0
Entvars_Set_Vector(NewEnt, EV_VEC_mins, MinBox)
Entvars_Set_Vector(NewEnt, EV_VEC_maxs, MaxBox)
ENT_SetOrigin(NewEnt, vOrigin)
Entvars_Set_Vector(NewEnt, EV_VEC_angles, vAngles)
Entvars_Set_Int(NewEnt, EV_INT_effects, 64) //64 = EF_LIGHT, rocket glow. 64??
Entvars_Set_Int(NewEnt, EV_INT_solid, 2) //2 = Solid bbox. (const.h)
Entvars_Set_Int(NewEnt, EV_INT_movetype, 5) //5 = movetype_fly, No grav, but collides.
Entvars_Set_Edict(NewEnt, EV_ENT_owner, id)
new Float:fNewVelocity[3]
VelocityByAim(id, 400, fNewVelocity)
Entvars_Set_Vector(NewEnt, EV_VEC_velocity, fNewVelocity)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(22)
write_short(NewEnt)
write_short(beam)
write_byte(45)
write_byte(4)
write_byte(255)
write_byte(0)
write_byte(0)
write_byte(128)
message_end()
emit_sound(NewEnt, CHAN_WEAPON, "weapons/qkame.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
emit_sound(NewEnt, CHAN_VOICE, "weapons/attackfly.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
return PLUGIN_HANDLED_MAIN
}
public plugin_precache() {
precache_sound("vox/_period.wav")
precache_sound("weapons/qkame.wav")
precache_sound("weapons/attackfly.wav")
precache_model("models/rpgrocket.mdl")
beam = precache_model("sprites/laserbeam.spr")
boom = precache_model("sprites/zerogxplode.spr")
smoke = precache_model("sprites/steam1.spr")
fire = precache_model("sprites/explode1.spr")
return PLUGIN_CONTINUE
}
public blowUp( id, Float:vExplodeAt[3] )
{
new distanceBetween
new damage, multiplier
new name[32]
get_user_name(id,name,31)
set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
new FFOn= get_cvar_num("mp_friendlyfire")
new origin[3]
origin[0]=floatround(vExplodeAt[0])
origin[1]=floatround(vExplodeAt[1])
origin[2]=floatround(vExplodeAt[2])+37
explode(origin) // blowup even if dead
for(new a = 1; a <= SH_MAXSLOTS; a++)
{
if( is_user_alive(a) && ( get_user_team(id) != get_user_team(a) || FFOn != 0 || a==id ) )
{
new origin1[3]
get_user_origin(a,origin1)
distanceBetween = get_distance(origin, origin1 )
if( distanceBetween < get_cvar_num("goku_radius") )
{
multiplier=(get_cvar_num("goku_maxdamage")*get_cvar_num("goku_maxdamage"))/get_cvar_num("goku_radius")
damage=(get_cvar_num("goku_radius")-distanceBetween)*multiplier
damage=sqrt(damage)
shExtraDamage(a, id, damage, "Kamehameha")
} // distance
} // alive target...
} // loop
}
//----------------------------------------------------------------------------------------------
public explode( vec1[3] )
{
//Explosion2
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte( 12 )
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_byte( 188 ) // byte (scale in 0.1's) 188
write_byte( 10 ) // byte (framerate)
message_end()
//TE_Explosion
message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
write_byte( 3 )
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_short( fire )
write_byte( 60 ) // byte (scale in 0.1's) 188
write_byte( 10 ) // byte (framerate)
write_byte( 0 ) // byte flags
message_end()
//Smoke
message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
write_byte( 5 ) // 5
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_short( smoke )
write_byte( 10 ) // 2
write_byte( 10 ) // 10
message_end()
}
//----------------------------------------------------------------------------------------------
weiß jemand wo der Fehler ist?