Member
Join Date: Jan 2006
Location: sweden
|
07-22-2006
, 15:55
SUPER GOHAN
|
#1
|
Hi help me with mine hero plz the hero have 4 errors!!
i don't need help with the other hero SSJGOHAN!!!
admin you can move it to trash!!
here is the erros
Code:
sh_ssjgohan.sma(100) : error 017: undefined symbol "gssjgohanSound"
sh_ssjgohan.sma(629) : error 017: undefined symbol "ssjgohan_sound"
sh_ssjgohan.sma(651) : error 017: undefined symbol "ssjgohan_sound"
sh_ssjgohan.sma(661) : error 054: unmatched closing brace
sh_ssjgohan.sma(673) : error 017: undefined symbol "gHasssjgohanPower"
sh_ssjgohan.sma(673) : warning 215: expression has no effect
sh_ssjgohan.sma(673) : error 001: expected token: ";", but found "]"
sh_ssjgohan.sma(673) : error 029: invalid expression, assumed zero
sh_ssjgohan.sma(673) : fatal error 107: too many error messages on one line
Compilation aborted.
8 Errors.
Could not locate output file compiled\amxx\sh_ssjgohan.amx (compile failed).
Welcome to the AMX Mod X 1.50-300 Compiler.
Copyright (c) 1997-2005 ITB CompuPhase, AMX Mod X Team
here i the code
Code:
// SuperGohan! - from Dragon Ball, Z, GT series.
/* CVARS - copy and paste to shconfig.cfg
//SuperGohan
SuperGohan_level 11
SuperGohan_aps 50 //The amount of AP gained per second (Default 5)
SuperGohan_apl 550 //AP amount multiplied by ssjlevel = AP required for each ssjlevel and cost of ssjlevel power use (Default 250)
SuperGohan_hpl 350 //HP amount multiplied by ssjlevel, ex. 30*ssj2 = +60HP (Default 30)
SuperGohan_hpmax 1400 //Max HP that can be gained (Default 500)
SuperGohan_speedbase 3200 //Initial Speed boost for ssjlevel 1, only sets if you are slower (Default 300)
SuperGohan_speedadd 800 //Speed added to SuperGohan_speedbase every next ssjlevel (Default 25)
*/
#include <amxmod>
#include <Vexd_Utilities>
#include <superheromod>
// GLOBAL VARIBLES
new g_heroName[]="SuperGohan"
new bool:g_hasSuperGohan[SH_MAXSLOTS+1]
new bool:gmorphed[SH_MAXSLOTS+1]
new gTaskID
new bool:g_inStun[SH_MAXSLOTS+1]
new bool:g_betweenRounds
new g_isSaiyanLevel[SH_MAXSLOTS+1]
new g_powerNum[SH_MAXSLOTS+1]
new g_powerID[SH_MAXSLOTS+1]
new g_prevWeapon[SH_MAXSLOTS+1]
new g_ssjLevel[4]
new Float:g_ssjSpeed[4]
new g_armorPts
new g_spritePowerUp
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO SuperGohan", "1.5", "D4W3")
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
register_cvar("SuperGohan_level", "11")
register_cvar("SuperGohan_aps", "50")
register_cvar("SuperGohan_apl", "550")
register_cvar("SuperGohan_hpl", "350")
register_cvar("SuperGohan_hpmax", "1400")
register_cvar("SuperGohan_speedbase", "3200")
register_cvar("SuperGohan_speedadd", "800")
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
shCreateHero(g_heroName, "Super Saiyan Powers", "Generate KI/Armor to transform into Super Saiyan forms.", false, "SuperGohan_level")
// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
// INIT
register_srvcmd("SuperGohan_init", "SuperGohan_init")
shRegHeroInit(g_heroName, "SuperGohan_init")
// EVENTS
register_event("ResetHUD", "newSpawn", "b")
register_event("CurWeapon", "curweapon", "be", "1=1")
register_event("DeathMsg", "santa_death", "a")
// LOG EVENTS
register_logevent("round_start", 2, "1=Round_Start")
register_logevent("round_end", 2, "1=Round_End")
register_logevent("round_end", 2, "1&Restart_Round_")
//Set a random number to the looping task so it can be removed without conflict
gTaskID = random_num(10181, 100000)
// LOOP
set_task(1.0, "SuperGohan_loop", 0, "", 0, "b")
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
precache_sound("shmod/SuperGohan_powerup1.wav")
precache_sound("shmod/SuperGohan_powerup2.wav")
precache_sound("shmod/SuperGohan_powerup3.wav")
precache_sound("shmod/SuperGohan_powerup4.wav")
g_spritePowerUp = precache_model("sprites/shmod/esf_SuperGohan_powerup.spr")
precache_model("models/player/SuperGohan/SuperGohan.mdl")
return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------
public SuperGohan_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 the hero
read_argv(2,temp,5)
new hasPowers = str_to_num(temp)
if ( hasPowers ) {
SuperGohan_setarmor(id)
SuperGohan_tasks(id)
}
//This gets run if they had the power but don't anymore
else if ( !hasPowers && g_hasSuperGohan[id] ) {
SuperGohan_unmorph(id)
shRemArmorPower(id)
shRemSpeedPower(id)
// remove the power if it was used and user dropped hero
if ( g_powerID[id] > 0 ) {
remove_power(id, g_powerID[id])
}
}
// Sets this variable to the current status
g_hasSuperGohan[id] = (hasPowers != 0)
}
//----------------------------------------------------------------------------------------------
public plugin_cfg()
{
loadCVARS()
}
//----------------------------------------------------------------------------------------------
public loadCVARS()
{
// These cvars are checked very often
g_armorPts = get_cvar_num("SuperGohan_aps")
g_ssjLevel[0] = get_cvar_num("SuperGohan_apl")
g_ssjLevel[1] = g_ssjLevel[0] * 2
g_ssjLevel[2] = g_ssjLevel[0] * 3
g_ssjLevel[3] = g_ssjLevel[0] * 4
g_ssjSpeed[0] = get_cvar_float("SuperGohan_speedbase")
g_ssjSpeed[1] = g_ssjSpeed[0] + get_cvar_float("SuperGohan_speedadd")
g_ssjSpeed[2] = g_ssjSpeed[1] + get_cvar_float("SuperGohan_speedadd")
g_ssjSpeed[3] = g_ssjSpeed[2] + get_cvar_float("SuperGohan_speedadd")
}
//----------------------------------------------------------------------------------------------
public newSpawn(id)
{
g_inStun[id] = false
if ( shModActive() && g_hasSuperGohan[id] && is_user_alive(id) ) {
// Set armor in x seconds to avoid breaking max ap settings in other heroes
set_task(0.5, "SuperGohan_setarmor", id)
SuperGohan_tasks(id)
g_isSaiyanLevel[id] = 0
}
}
//----------------------------------------------------------------------------------------------
public SuperGohan_setarmor(id)
{
if ( is_user_alive(id) ) {
// Start a SuperGohan off with 100 AP, even if user has more from other heroes
give_item(id, "item_assaultsuit")
set_user_armor(id, 100)
}
}
//----------------------------------------------------------------------------------------------
public remove_power(id, powerID)
{
new Float:fl_vOrigin[3]
Entvars_Get_Vector(powerID, EV_VEC_origin, fl_vOrigin)
// Create an effect of kamehameha being removed
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(14) //TE_IMPLOSION
write_coord(floatround(fl_vOrigin[0]))
write_coord(floatround(fl_vOrigin[1]))
write_coord(floatround(fl_vOrigin[2]))
write_byte(200) // radius
write_byte(40) // count
write_byte(45) // life in 0.1's
message_end()
g_powerNum[id] = 0
g_powerID[id] = 0
RemoveEntity(powerID)
}
//----------------------------------------------------------------------------------------------
public SuperGohan_loop()
{
if ( !shModActive() || g_betweenRounds ) return
new players[SH_MAXSLOTS], pnum, id
get_players(players, pnum, "a")
for (new i = 0; i < pnum; i++) {
id = players[i]
if ( g_hasSuperGohan[id] && is_user_alive(id) ) {
new userArmor = get_user_armor(id)
// Give him armor
if ( userArmor < g_ssjLevel[3] ) {
if ( userArmor + g_armorPts > g_ssjLevel[3] ) {
set_user_armor(id, g_ssjLevel[3])
}
else {
// Give the armor item if armor is 0 so CS knows the player has armor
if ( userArmor <= 0 ) give_item(id, "item_assaultsuit")
set_user_armor(id, userArmor + g_armorPts)
}
}
// Check armor again after it's been set
userArmor = get_user_armor(id)
if ( userArmor < g_ssjLevel[0] ) {
// run it this way so it doesn't check all the elses
if ( g_isSaiyanLevel[id] > 0 ) {
shResetSpeed(id)
g_isSaiyanLevel[id] = 0
}
}
else if ( userArmor >= g_ssjLevel[0] && userArmor < g_ssjLevel[1] ) {
// Set these items only once when armor is ssjlevel 1
if ( g_isSaiyanLevel[id] < 1 ) {
new parm[2]
parm[0] = id
parm[1] = 5
powerup_effect(parm)
set_task(0.1, "powerup_effect", 0, parm, 2, "a", 19)
set_hudmessage(255, 255, 100, -1.0, 0.25, 0, 0.25, 3.0, 0.0, 0.0, 84)
show_hudmessage(id, "SuperGohan - You've turned Super Saiyan")
emit_sound(id, CHAN_STATIC, "shmod/SuperGohan_powerup1.wav", 0.8, ATTN_NORM, 0, PITCH_NORM)
g_isSaiyanLevel[id] = 1
ssj_boost(id)
}
}
else if ( userArmor >= g_ssjLevel[1] && userArmor < g_ssjLevel[2] ) {
// Set these items only once when armor is ssjlevel 2
if ( g_isSaiyanLevel[id] < 2 ) {
new parm[2]
parm[0] = id
parm[1] = 7
powerup_effect(parm)
set_task(0.1, "powerup_effect", 0, parm, 2, "a", 39)
set_hudmessage(222, 226, 0, -1.0, 0.25, 0, 0.25, 3.0, 0.0, 0.0, 84)
show_hudmessage(id, "SuperGohan - You've turned Super Saiyan 2")
emit_sound(id, CHAN_STATIC, "shmod/SuperGohan_powerup2.wav", 0.8, ATTN_NORM, 0, PITCH_NORM)
g_isSaiyanLevel[id] = 2
ssj_boost(id)
}
}
else if ( userArmor >= g_ssjLevel[2] && userArmor < g_ssjLevel[3] ) {
// Set these items only once when armor is ssjlevel 3
if ( g_isSaiyanLevel[id] < 3 ) {
new parm[2]
parm[0] = id
parm[1] = 9
powerup_effect(parm)
set_task(0.1, "powerup_effect", 0, parm, 2, "a", 59)
set_hudmessage(248, 220, 117, -1.0, 0.25, 0, 0.25, 3.0, 0.0, 0.0, 84)
show_hudmessage(id, "SuperGohan - You've turned Super Saiyan 3")
emit_sound(id, CHAN_STATIC, "shmod/SuperGohan_powerup3.wav", 0.8, ATTN_NORM, 0, PITCH_NORM)
g_isSaiyanLevel[id] = 3
ssj_boost(id)
}
}
else if ( userArmor >= g_ssjLevel[3] ) {
// SSJ4 glows red
shGlow(id, 196, 000, 000)
// Set these items only once when armor is ssjlevel 4
if ( g_isSaiyanLevel[id] < 4 ) {
new parm[2]
parm[0] = id
parm[1] = 11
powerup_effect(parm)
set_task(0.1, "powerup_effect", 0, parm, 2, "a", 79)
set_hudmessage(196, 0, 0, -1.0, 0.25, 0, 0.25, 3.0, 0.0, 0.0, 84)
show_hudmessage(id, "SuperGohan - You've turned Super Saiyan 4")
emit_sound(id, CHAN_STATIC, "shmod/SuperGohan_powerup4.wav", 0.8, ATTN_NORM, 0, PITCH_NORM)
g_isSaiyanLevel[id] = 4
shake_n_stun(id)
ssj_boost(id)
}
}
}
}
}
//----------------------------------------------------------------------------------------------
public ssj_boost(id)
{
if ( !shModActive() || !g_hasSuperGohan[id] || !is_user_alive(id) || g_betweenRounds ) return
if ( !g_isSaiyanLevel[id] ) return
// Speed Boost
new speedNum = g_isSaiyanLevel[id] - 1
if ( get_user_maxspeed(id) < g_ssjSpeed[speedNum] && !g_inStun[id] ) {
set_user_maxspeed(id, g_ssjSpeed[speedNum])
}
// HP boost
new userHealth = get_user_health(id)
if ( userHealth < get_cvar_num("SuperGohan_hpmax") ) {
new addHP = get_cvar_num("SuperGohan_hpl") * g_isSaiyanLevel[id]
if ( userHealth + addHP > get_cvar_num("SuperGohan_hpmax") ) {
set_user_health(id, get_cvar_num("SuperGohan_hpmax") )
}
else {
set_user_health(id, userHealth + addHP)
}
}
}
//----------------------------------------------------------------------------------------------
public curweapon(id)
{
if ( !shModActive() || !g_hasSuperGohan[id] || !is_user_alive(id) || g_betweenRounds ) return
if ( !g_isSaiyanLevel[id] || g_inStun[id] ) return
new wpnid = read_data(2)
if ( g_prevWeapon[id] != wpnid ) {
switch(g_isSaiyanLevel[id]) {
case 1: if ( get_user_maxspeed(id) < g_ssjSpeed[0] ) set_user_maxspeed(id, g_ssjSpeed[0])
case 2: if ( get_user_maxspeed(id) < g_ssjSpeed[1] ) set_user_maxspeed(id, g_ssjSpeed[1])
case 3: if ( get_user_maxspeed(id) < g_ssjSpeed[2] ) set_user_maxspeed(id, g_ssjSpeed[2])
case 4: if ( get_user_maxspeed(id) < g_ssjSpeed[3] ) set_user_maxspeed(id, g_ssjSpeed[3])
}
}
g_prevWeapon[id] = wpnid
}
//----------------------------------------------------------------------------------------------
public shake_n_stun(id)
{
new idOrigin[3], vicOrigin[3]
new players[SH_MAXSLOTS], pnum, vic
get_user_origin(id, idOrigin)
get_players(players, pnum, "a")
// Shake and Stun all alive users in radius inluding self
for (new i = 0; i < pnum; i++) {
vic = players[i]
if ( !is_user_alive(vic) ) continue
get_user_origin(vic, vicOrigin)
new distance = get_distance(idOrigin, vicOrigin)
if ( distance <= get_cvar_num("SuperGohan_radius4") ) {
sh_screenShake(vic, 14, 14, 14)
g_inStun[vic] = true
shStun(vic, 5)
set_user_maxspeed(vic, 150.0)
set_task(5.0, "reset_instun", vic)
if ( vic == id ) continue
// Let them know why they get shaken and stunned, except the person that leveled
new SuperGohanName[32]
get_user_name(id, SuperGohanName, 31)
set_hudmessage(196, 0, 0, -1.0, 0.20, 0, 0.25, 3.0, 0.0, 0.0, 84)
show_hudmessage(vic, "SuperGohan - %s has turned Super Saiyan 4", SuperGohanName)
}
}
}
//----------------------------------------------------------------------------------------------
public reset_instun(id)
{
g_inStun[id] = false
if ( !shModActive() || !g_hasSuperGohan[id] || !is_user_alive(id) ) return
switch(g_isSaiyanLevel[id]) {
case 1: if ( get_user_maxspeed(id) < g_ssjSpeed[0] ) set_user_maxspeed(id, g_ssjSpeed[0])
case 2: if ( get_user_maxspeed(id) < g_ssjSpeed[1] ) set_user_maxspeed(id, g_ssjSpeed[1])
case 3: if ( get_user_maxspeed(id) < g_ssjSpeed[2] ) set_user_maxspeed(id, g_ssjSpeed[2])
case 4: if ( get_user_maxspeed(id) < g_ssjSpeed[3] ) set_user_maxspeed(id, g_ssjSpeed[3])
}
}
//----------------------------------------------------------------------------------------------
public powerup_effect(parm[])
{
if ( !shModActive() || g_betweenRounds ) return
new id = parm[0]
if ( !is_user_alive(id) ) return
new Size = parm[1]
new players[SH_MAXSLOTS], pnum
new idOthers, Origin[3]
get_players(players, pnum, "a")
// Show a powerup to all alive players except the one being powered up.
for (new i = 0; i < pnum; i++) {
idOthers = players[i]
if ( !is_user_alive(idOthers) || idOthers == id ) continue
get_user_origin(id, Origin)
// power up sprite - additive sprite, plays 1 cycle
message_begin(MSG_ONE, SVC_TEMPENTITY, Origin, idOthers)
write_byte(17) // TE_SPRITE
write_coord(Origin[0]) // center position
write_coord(Origin[1])
write_coord(Origin[2]+20)
write_short(g_spritePowerUp) // sprite index
write_byte(Size) // scale in 0.1's
write_byte(50) // brightness
message_end()
// power up sprite - additive sprite, plays 1 cycle
message_begin(MSG_ONE, SVC_TEMPENTITY, Origin, idOthers)
write_byte(17) // TE_SPRITE
write_coord(Origin[0]+5) // center position
write_coord(Origin[1])
write_coord(Origin[2]+20)
write_short(g_spritePowerUp) // sprite index
write_byte(Size) // scale in 0.1's
write_byte(50) // brightness
message_end()
// power up sprite - additive sprite, plays 1 cycle
message_begin(MSG_ONE, SVC_TEMPENTITY, Origin, idOthers)
write_byte(17) // TE_SPRITE
write_coord(Origin[0]-5) // center position
write_coord(Origin[1])
write_coord(Origin[2]+20)
write_short(g_spritePowerUp) // sprite index
write_byte(Size) // scale in 0.1's
write_byte(50) // brightness
message_end()
// power up sprite - additive sprite, plays 1 cycle
message_begin(MSG_ONE, SVC_TEMPENTITY, Origin, idOthers)
write_byte(17) // TE_SPRITE
write_coord(Origin[0]) // center position
write_coord(Origin[1]+5)
write_coord(Origin[2]+10)
write_short(g_spritePowerUp) // sprite index
write_byte(Size) // scale in 0.1's
write_byte(50) // brightness
message_end()
// power up sprite - additive sprite, plays 1 cycle
message_begin(MSG_ONE, SVC_TEMPENTITY, Origin, idOthers)
write_byte(17) // TE_SPRITE
write_coord(Origin[0]) // center position
write_coord(Origin[1]-5)
write_coord(Origin[2]+10)
write_short(g_spritePowerUp) // sprite index
write_byte(Size) // scale in 0.1's
write_byte(50) // brightness
message_end()
}
}
//----------------------------------------------------------------------------------------------
public SuperGohan_tasks(id)
{
set_task(1.0, "SuperGohan_morph", id)
if( get_cvar_num("SuperGohan_teamglow") ){
set_task(1.0, "SuperGohan_glow", id+gTaskID, "", 0, "b" )
}
}
//----------------------------------------------------------------------------------------------
public SuperGohan_morph(id)
{
if ( gmorphed[id] || !is_user_alive(id) ) return
#if defined AMXX_VERSION
cs_set_user_model(id, "SuperGohan")
#else
CS_SetModel(id, "SuperGohan")
#endif
// Message
set_hudmessage(50, 205, 50, -1.0, 0.40, 2, 0.02, 4.0, 0.01, 0.1, 7)
show_hudmessage(id, "SuperGohan - Reporting for duty")
gmorphed[id] = true
}
//----------------------------------------------------------------------------------------------
public SuperGohan_unmorph(id)
{
if ( gmorphed[id] ) {
// Message
set_hudmessage(50, 205, 50, -1.0, 0.40, 2, 0.02, 4.0, 0.01, 0.1, 7)
show_hudmessage(id, "SuperGohan -you returned to normal self.")
#if defined AMXX_VERSION
cs_reset_user_model(id)
#else
CS_ClearModel(id)
#endif
gmorphed[id] = false
if ( get_cvar_num("SuperGohan_teamglow") ) {
remove_task(id+gTaskID)
set_user_rendering(id)
}
}
}
//----------------------------------------------------------------------------------------------
public SuperGohan_glow(id)
{
id -= gTaskID
if ( !is_user_connected(id) ) {
//Don't want any left over residuals
remove_task(id+gTaskID)
return
}
if ( gHasSuperGohanPower[id] && is_user_alive(id)) {
if ( get_user_team(id) == 1 ) {
shGlow(id, 255, 0, 0)
}
else {
shGlow(id, 0, 0, 255)
}
}
}
//----------------------------------------------------------------------------------------------
public SuperGohan_death()
{
new id = read_data(2)
SuperGohan_unmorph(id)
}
//----------------------------------------------------------------------------------------------
public round_end()
{
g_betweenRounds = true
for (new id=1; id <= SH_MAXSLOTS; id++) {
if ( g_hasSuperGohan[id] ) {
g_isSaiyanLevel[id] = 0
shResetSpeed(id)
if ( g_powerID[id] > 0 ) {
remove_power(id, g_powerID[id])
}
}
}
}
//----------------------------------------------------------------------------------------------
public round_start()
{
g_betweenRounds = false
}
//----------------------------------------------------------------------------------------------
public client_connect(id)
{
gmorphed[id] = false
}
//----------------------------------------------------------------------------------------------
public client_disconnect(id)
{
if( g_hasSuperGohan[id] && g_powerID[id] > 0 ) {
remove_power(id, g_powerID[id])
}
}
//----------------------------------------------------------------------------------------------
|
|