I put all files and everything in the right places but then there's an error
Code:
#include <amxmod>
#include <fun>
#include <superheromod>
#include <Vexd_utilities>
/****************************************
*
* Modified by Batman
* Made UltimateGoku to have laser penetrate through EVERYTHING including walls. Added aura to UltimateGoku
* to make it more like DBZ. Included a charge timer to further make it more like DBZ.
* Made it so that UltimateGoku can fire 8 automatic blasts after he charges up.
*
*****************************************/
// UltimateGoku - Kamehameha! Created by Mr Sparkle
// Based on Cyclops Hero
// CVARS PASTE THIS IN SHCONFIG.CFG
// UltimateGoku_level
// UltimateGoku_laser_ammo 512
// UltimateGoku_laser_burndecals 1
// UltimateGoku_cooldown 20.0
// UltimateGoku_chargetime 12
// UltimateGoku_aura 15
// UltimateGoku_ammo 8
// UltimateGoku_maxdamage 1000
// UltimateGoku_radius 400
// VARIABLES
new gHeroName[]="Ultimate Goku"
new bool:g_HasUltimateGokuPower[SH_MAXSLOTS+1]
new gLastWeapon[SH_MAXSLOTS+1]
new g_chargeTimer[SH_MAXSLOTS+1]
new numOfShots[SH_MAXSLOTS+1]
//new bool:g_morphed[SH_MAXSLOTS+1]
// VARIABLES
new smoke
new laser
new explosion
new laser_shots[33]
//Colors To Pick From ***DO NOT MODIFY***
#define CUSTOM 0
#define RED 1
#define GREEN 2
#define BLUE 3
#define LTBLUE 4
#define YELLOW 5
#define PURPLE 6
#define ORANGE 7
//Color Settings ***CHANGE COLOR HERE***
#define BEAM_COLOR CUSTOM // Set beam color here, use color names from above (Default GREEN)
#define BEAM_ALPHA 255 // alpha value, visibility from 0-255 (Default 200)
//Color definitions
new BeamColors[8][3] = {
{255, 255, 255}, // Custom, edit this one for a custom rgb value
{255, 0, 0}, // Red
{0, 255, 0}, // Green
{0, 0, 255}, // Blue
{0, 255, 255}, // Light Blue
{255, 255, 0}, // Yellow
{255, 0, 255}, // Purple
{255, 128, 0} // Orange
}
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO UltimateGoku","1.0","Mr Sparkle")
//THE EVENT TO CREATE THIS SUPERHERO!
if ( isDebugOn() ) server_print("Attempting to create UltimateGoku Hero")
register_cvar("UltimateGoku_level", "8" )
shCreateHero(gHeroName, "SHL's Goku", "Press your Power key to Launch a Super Kamehameha!", true, "UltimateGoku_level" )
// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
// INIT
register_srvcmd("UltimateGoku_init", "UltimateGoku_init")
shRegHeroInit(gHeroName, "UltimateGoku_init")
register_event("ResetHUD","newRound","b")
// DEFAULT THE CVARS
// Let Server know about UltimateGoku 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
shSetMaxSpeed(gHeroName, "UltimateGoku_speed", "[0]" )
// KEY DOWN
register_srvcmd("UltimateGoku_kd", "UltimateGoku_kd")
shRegKeyDown(gHeroName, "UltimateGoku_kd")
register_srvcmd("UltimateGoku_ku", "UltimateGoku_ku")
shRegKeyUp(gHeroName, "UltimateGoku_ku")
// Laser
register_cvar("UltimateGoku_laser_ammo", "512") // total # of shots...
register_cvar("UltimateGoku_laser_burndecals", "1")
register_cvar("UltimateGoku_cooldown", "20.0" )
register_cvar("UltimateGoku_chargetime", "12") //This is how long he has to charge up before he fires his beam.
register_cvar("UltimateGoku_radius", "400")
register_cvar("UltimateGoku_maxdamage", "1000")
register_cvar("UltimateGoku_ammo", "8") //How many Kamehameha he can fire before he has to charge again.
//Aura
register_cvar("UltimateGoku_aura", "15")
//LOOP
set_task(1.0, "UltimateGoku_loop", 0, "", 0, "b")
for(new id = 1; id <= SH_MAXSLOTS; id++)
g_chargeTimer[id] = -1
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
smoke = precache_model("sprites/steam1.spr")
laser = precache_model("sprites/laserbeam.spr")
explosion = precache_model("sprites/zerogxplode.spr")
precache_sound("shmod/UltimateGoku1.wav") //This is the new sound for UltimateGoku.
precache_sound("weapons/xbow_hitbod2.wav")
precache_sound("weapons/explode3.wav")
}
//----------------------------------------------------------------------------------------------
public UltimateGoku_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 UltimateGoku
read_argv(2,temp,5)
new hasPowers=str_to_num(temp)
g_HasUltimateGokuPower[id]=(hasPowers!=0)
if(hasPowers){
//set_task(1.0, "UltimateGoku_morph", id)
}
// Got to slow down a UltimateGoku that lost his powers...
if ( !hasPowers && is_user_connected(id) )
{
shRemSpeedPower(id)
//UltimateGoku_unmorph(id)
//g_HasChargeTimer[id] = false
}
}
//----------------------------------------------------------------------------------------------
/*public UltimateGoku_morph(id)
{
if(g_morphed[id] == true || !is_user_alive(id))
return
#if defined AMXX_VERSION
cs_set_user_model("UltimateGoku")
#else
CS_SetModel("UltimateGoku")
#endif
g_morphed[id] = true
}
//----------------------------------------------------------------------------------------------
public UltimateGoku_unmorph(id)
{
if(g_morphed[id] == true){
#if defined AMXX_VERSION
cs_reset_user_model(id)
#else
CS_ClearModel(id)
#endif
g_morphed[id] = false
}
}*/
//----------------------------------------------------------------------------------------------
public newRound(id)
{
if(g_HasUltimateGokuPower[id]){
laser_shots[id] = get_cvar_num("UltimateGoku_laser_ammo")
//set_user_rendering(id,kRenderGlow,0,128,0,kRenderFxNone,255)
gPlayerUltimateUsed[id]=false
g_chargeTimer[id] = -1
set_cvar_num("UltimateGoku_ammo", 8)
//set_task(1.0, "UltimateGoku_morph", id)
//remove_task(id)
}
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
// RESPOND TO KEYDOWN
public UltimateGoku_kd()
{
new temp[6]
if ( !hasRoundStarted() ) return PLUGIN_HANDLED
// First Argument is an id with UltimateGoku Powers!
read_argv(1,temp,5)
new id=str_to_num(temp)
if ( !is_user_alive(id) ) return PLUGIN_HANDLED
//This is incase someone presses the key down while UltimateGoku is still charging.
if(gPlayerUltimateUsed[id] || g_chargeTimer[id] > -1){
playSoundDenySelect(id)
return PLUGIN_HANDLED
}
g_chargeTimer[id] = get_cvar_num("UltimateGoku_chargetime") //This defines how much time he has for charging, 12 seconds
numOfShots[id] = get_cvar_num("UltimateGoku_ammo")
// Remember this weapon...
new clip,ammo,weaponID=get_user_weapon(id,clip,ammo);
gLastWeapon[id]=weaponID
//The line below activates the sound for UltimateGoku.
emit_sound(id,CHAN_VOICE, "shmod/UltimateGoku1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
//THIS LINE IS TO START UP CHARGING TIME (DO NOT CHANGE THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING!)
//if(g_HasChargeTimer[id] == false){
//set_task(1.0, "UltimateGoku_loop", 0, "", 0, "b")
//g_HasChargeTimer[id] = true
//}
if(get_cvar_float("UltimateGoku_cooldown") > 0.0){
ultimateTimer(id, get_cvar_num("UltimateGoku_cooldown") * 1.0) //This is the cooldown time until user can fire the beam again.
}
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public UltimateGoku_loop() //This is total rip from nightcrawler loop, except some editing has been done to it.
{
for ( new id = 1; id <= SH_MAXSLOTS; id++ ) {
if ( g_HasUltimateGokuPower[id] && is_user_alive(id) ) {
if ( g_chargeTimer[id] > 0 ) {
if(numOfShots[id] > 0){
new message[128]
format(message, 127, "%d seconds left of Charging up.", g_chargeTimer[id] )
set_hudmessage(255,0,0,-1.0,0.3,0,1.0,1.2,0.0,0.0,87)
show_hudmessage( id, message)
}
set_user_rendering(id, kRenderFxGlowShell, get_cvar_num("UltimateGoku_aura"), get_cvar_num("UltimateGoku_aura"), 0, kRenderNormal, 16) //makes user glow yellow.
if(get_cvar_num("UltimateGoku_aura") < 255){
set_cvar_num("UltimateGoku_aura", get_cvar_num("UltimateGoku_aura") + 20) //This line will intensify the brightness of the user.
}
g_chargeTimer[id]--
}
else if ( g_chargeTimer[id] == 0) {
set_user_rendering(id, kRenderFxGlowShell, 255, 255, 0, kRenderNormal, 16) //makes user shine bright yellow
if(get_cvar_num("UltimateGoku_ammo") > 0){
new message[128]
format(message, 127, "SUPER KAMEHAMEHA!!!")
set_hudmessage(255,0,0,-1.0,0.3,0,1.0,1.2,0.0,0.0,87)
show_hudmessage(id, message)
}
if(numOfShots[id] > 0){
fire_laser(id)
g_chargeTimer[id] = 3
numOfShots[id]--
}
else{
g_chargeTimer[id]--
numOfShots[id] = get_cvar_num("UltimateGoku_ammo")
break
}
}
}
}
}
//----------------------------------------------------------------------------------------------
public UltimateGoku_ku()
{
new temp[6]
// First Argument is an id with UltimateGoku Powers!
read_argv(1,temp,5)
new id=str_to_num(temp)
if(g_chargeTimer[id] < 0)
remove_task(id)
// Switch back to previous weapon...
if ( gLastWeapon[id]!=CSW_KNIFE ) shSwitchWeaponID( id, gLastWeapon[id])
}
//----------------------------------------------------------------------------------------------
public laserEffects(id, aimvec[3] )
{
new choose_decal,decal_id
choose_decal = random_num(0,2)
switch(choose_decal)
{
case 0: decal_id = 46 //28
case 1: decal_id = 47 //103
case 2: decal_id = 48 //198
case 3: decal_id = 30 //199
}
new origin[3]
get_user_origin(id, origin, 1)
new colornum = BEAM_COLOR
new colors[3]
if (colornum < 0 || colornum >= 8) {
//If invalid value set it to default light blue
colornum = 4
}
colors = BeamColors[colornum]
// DELIGHT
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(27)
write_coord(origin[0]) //pos
write_coord(origin[1])
write_coord(origin[2])
write_byte(10)
write_byte(255) // r, g, b (red)
write_byte(255) // r, g, b (green)
write_byte(255) // r, g, b (blue)
write_byte(10) // life
write_byte(5) // decay
message_end()
//BEAMENTPOINTS
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte ( 0 ) //TE_BEAMENTPOINTS 0
write_coord(origin[0])
write_coord(origin[1])
write_coord(origin[2])
write_coord(aimvec[0])
write_coord(aimvec[1])
write_coord(aimvec[2])
write_short(laser)
write_byte(1) // framestart
write_byte(5) // framerate
write_byte(10) // life
write_byte(255) // width
write_byte(0) // noise
write_byte(255) // r, g, b (red)
write_byte(255) // r, g, b (green)
write_byte(255) // r, g, b (blue)
write_byte(BEAM_ALPHA) // brightness
write_byte(1) // speed
message_end()
//Sparks
message_begin( MSG_PVS, SVC_TEMPENTITY)
write_byte(9)
write_coord(aimvec[0])
write_coord(aimvec[1])
write_coord(aimvec[2])
message_end()
//Smoke
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(5) // 5
write_coord(aimvec[0]) //position
write_coord(aimvec[1])
write_coord(aimvec[2])
write_short(smoke)
write_byte(22) // 10
write_byte(10) // 10
message_end()
emit_sound(id, CHAN_ITEM, "weapons/explode3.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
//Explosion
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(3)
write_coord(aimvec[0])
write_coord(aimvec[1])
write_coord(aimvec[2])
write_short(explosion)
write_byte(200) //This will make the explosion big
write_byte(20) //The framerate
write_byte(0) //The flag, 0 makes default half-life explosions
message_end()
if(get_cvar_num("UltimateGoku_laser_burndecals") == 1)
{
//TE_GUNSHOTDECAL
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte( 109 ) // decal and ricochet sound
write_coord(aimvec[0]) //pos
write_coord(aimvec[1])
write_coord(aimvec[2])
write_short (0) // I have no idea what thats supposed to be
write_byte (decal_id) //decal
message_end()
}
}
//----------------------------------------------------------------------------------------------
public fire_laser(id)
{
new aimvec[3]
new FFOn = get_cvar_num("mp_friendlyfire")
new Float:damageRatio, damage, distance
new damageRadius = get_cvar_num("UltimateGoku_radius")
new maximumDamage = get_cvar_num("UltimateGoku_maxdamage")
if(!is_user_alive(id) ) return
get_user_origin(id, aimvec, 3)
laserEffects(id, aimvec)
for(new vic = 1; vic <= SH_MAXSLOTS; vic++){
if(is_user_alive(vic) && (get_user_team(id) != get_user_team(vic) || FFOn || vic == id) ){
new origin[3]
get_user_origin(vic, origin, 0)
distance = get_distance(aimvec, origin)
if(distance < damageRadius){
damageRatio = float(distance)/float(damageRadius)
damage = maximumDamage - floatround(maximumDamage * damageRatio)
if(vic == id) damage = floatround(damage/2.0)
shExtraDamage(vic, id, damage, "Super Kamehameha!")
}
}
}
}
//----------------------------------------------------------------------------------------------
public client_disconnect(id)
{
// stupid check but lets see
if ( id <=0 || id>32 ) return PLUGIN_CONTINUE
// Yeah don't want any left over residuals
remove_task(id)
return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------