Raised This Month: $ Target: $400
 0% 

hero help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
notorious-sk8er
Senior Member
Join Date: Jun 2005
Old 02-11-2006 , 15:21   hero help
Reply With Quote #1

ok i was making w3r3wulfs hero The Boss
i dont know whats wrong can someone help
Code:
//The Boss  from MSG3 /*CVARS - copy and paste to shconfig.cfg //The Boss boss_level 3    //level boss_health 100 //health default 100 boss_speed 500  //speed boss_m249multi 1.15 //m249 damage multi default 1.15 (do nto make any higher than 1.5, or 1 shot kill) boss_invis 65   //default 65 = 25% */ #include <amxmod> #include <vexd_utilities> #include <superheromod> // GLOBAL VARIABLES new gHeroName[]="Boss" new bool:gHasBossPower[SH_MAXSLOTS+1] new gIsInvisible[SH_MAXSLOTS+1] //---------------------------------------------------------------------------------------------- public plugin_init() {     // Plugin Info     register_plugin("SUPERHERO The Boss", "1.0", "sk8er/w3r3wolf")     // DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG     register_cvar("boss_level", "3")     register_cvar("boss_health", "100")     register_cvar("boss_speed", "500")     register_cvar("boss_m249multi", "1.15")     register_cvar("boss_invis", "65")     // FIRE THE EVENT TO CREATE THIS SUPERHERO!     shCreateHero(gHeroName, "The Boss", "Be The Boss and invis/para model", false, "boss_level" )     // REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)     // INIT     register_srvcmd("boss_init", "boss_init")     shRegHeroInit(gHeroName, "boss_init")     register_event("ResetHUD", "newSpawn", "b")     register_event("CurWeapon", "weaponChange", "be", "1=1")     register_event("Damage", "boss_damage", "b", "2!0")     register_event("DeathMsg", "boss_death", "a")     // Let Server know about The Boss' Variables     shSetShieldRestrict(gHeroName)     shSetMaxHealth(gHeroName, "boss_health")     shSetMaxSpeed(gHeroName, "boss_speed", "[0]") } //---------------------------------------------------------------------------------------------- public plugin_precache() {     precache_model("models/shmod/boss_v_m249.mdl")     precache_model("models/shmod/boss_p_m249.mdl") } //---------------------------------------------------------------------------------------------- public boss_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 Boss     read_argv(2,temp,5)     new hasPowers = str_to_num(temp)     gHasBossPower[id] = (hasPowers != 0)     //Reset thier shield restrict status     //Shield restrict MUST be before weapons are given out     shResetShield(id)     if ( is_user_connected(id) ) {         if ( gHasBossPower[id] ) {             boss_weapons(id)             switchmodel(id)         }         else {             engclient_cmd(id, "drop", "weapon_m249")             shRemHealthPower(id)             shRemSpeedPower(id)     if ( !gHasBossPower[id] ) remInvisibility(id)         }     } } //---------------------------------------------------------------------------------------------- public newRound(id) {     remInvisibility(id) } //---------------------------------------------------------------------------------------------- public newSpawn(id) {     if ( gHasBossPower[id] && is_user_alive(id) && shModActive() ) {         set_task(0.1, "boss_weapons", id)         new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)         if (wpnid != CSW_M249 && wpnid > 0) {             new wpn[32]             get_weaponname(wpnid,wpn,31)             engclient_cmd(id,wpn)         }     } } //---------------------------------------------------------------------------------------------- public boss_weapons(id) {     if ( is_user_alive(id) ) {         shGiveWeapon(id,"weapon_m249")     } } //---------------------------------------------------------------------------------------------- public switchmodel(id) {     if ( !is_user_alive(id) || !gHasBossPower[id] ) return     new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)     if (wpnid == CSW_M249) {         Entvars_Set_String(id, EV_SZ_viewmodel, "models/shmod/boss_v_m249.mdl")         Entvars_Set_String(id, EV_SZ_weaponmodel, "models/shmod/boss_p_m249.mdl")     } } //---------------------------------------------------------------------------------------------- public weaponChange(id) {     if ( !gHasBossPower[id] || !shModActive() ) return     new wpnid = read_data(2)     new clip = read_data(3)     if ( wpnid != CSW_M249 ) return     switchmodel(id)     // Unlimited ammo     if ( clip == 0 ) {         shReloadAmmo(id)     } } //---------------------------------------------------------------------------------------------- public boss_damage(id) {     if (!shModActive() || !is_user_alive(id)) return     new damage = read_data(2)     new weapon, bodypart, attacker = get_user_attacker(id, weapon, bodypart)     new headshot = bodypart == 1 ? 1 : 0     if ( attacker <= 0 || attacker > SH_MAXSLOTS ) return     if ( gHasBossPower[attacker] && weapon == CSW_M249 && is_user_alive(id) ) {         // do extra damage         new extraDamage = floatround(damage * get_cvar_float("boss_m249multi") - damage)         if (extraDamage > 0) shExtraDamage( id, attacker, extraDamage, "m249", headshot )     } } //---------------------------------------------------------------------------------------------- public setInvisibility(id, alpha) {     if (alpha < 125) {         set_user_rendering(id,kRenderFxGlowShell,8,8,8,kRenderTransAlpha,alpha)     }     else {         set_user_rendering(id,kRenderFxNone,0,0,0,kRenderTransAlpha,alpha)     } } //---------------------------------------------------------------------------------------------- public remInvisibility(id) {     gStillTime[id] = 0 ;     if (gIsInvisible[id] > 0) {         shUnglow(id)     }     gIsInvisible[id] = 0 } //---------------------------------------------------------------------------------------------- public checkButtons() {     if ( !hasRoundStarted() || !shModActive()) return     new bool:setVisible     new butnprs     for(new id = 1; id <= SH_MAXSLOTS; id++) {         if (!is_user_alive(id) || !gHasBossPower[id]) continue         setVisible = false         butnprs = Entvars_Get_Int(id, EV_INT_button)         //Always check these         if (butnprs&IN_ATTACK || butnprs&IN_ATTACK2 || butnprs&IN_RELOAD || butnprs&IN_USE) setVisible = true         //Only check these if invisman_checkmove is off         //if ( get_cvar_num("invisman_checkmove") ) {             //if (butnprs&IN_JUMP) setVisible = true             //if (butnprs&IN_FORWARD || butnprs&IN_BACK || butnprs&IN_LEFT || butnprs&IN_RIGHT) setVisible = true             //if (butnprs&IN_MOVELEFT || butnprs&IN_MOVERIGHT) setVisible = true         }         if (setVisible) remInvisibility(id)         else {             new sysTime = get_systime()             if ( gStillTime[id] < 0 ) {                 gStillTime[id] = sysTime             }             if ( sysTime - delay >= gStillTime[id] ) {                 gIsInvisible[id] = 100                 setInvisibility(id, get_cvar_num("boss_invis"))             }             else if ( sysTime > gStillTime[id] ) {                 new alpha = get_cvar_num("boss_invis")                 new Float:prcnt =  float(sysTime - gStillTime[id]) / float(delay)                 new rPercent = floatround(prcnt * 100)                 alpha = floatround(255 - ((255 - alpha) * prcnt) )                 gIsInvisible[id] = rPercent                 setInvisibility(id, alpha)             }         }     } } //----------------------------------------------------------------------------------------------
here are the errors
Code:
sh_theboss.sma(65) : warning 219: local variable "id" shadows a variable at a pr
eceding level
sh_theboss.sma(87) : warning 217: loose indentation
sh_theboss.sma(175) : error 017: undefined symbol "gStillTime"
sh_theboss.sma(175) : warning 215: expression has no effect
sh_theboss.sma(175) : error 001: expected token: ";", but found "]"
sh_theboss.sma(175) : error 029: invalid expression, assumed zero
sh_theboss.sma(175) : fatal error 107: too many error messages on one line

Compilation aborted.Small compiler 2.6.0                Copyright (c) 1997-2004,
 ITB CompuPhase


4 Errors.

Press any key to continue . . .
[/small]
notorious-sk8er is offline
.: SlaYeR:. | Ali G Gunz
BANNED
Join Date: Dec 2005
Old 02-12-2006 , 04:19   lol
Reply With Quote #2

Well go in diff heros and look for your self if ( gStillTime[id] < 0 )= { if ( gStillTime[id] < 1 ) { i am not that good to learn but jtp or vittu or emp will help you I am a noob when it comes to scripting
.: SlaYeR:. | Ali G Gunz is offline
Send a message via AIM to .: SlaYeR:. | Ali G Gunz Send a message via MSN to .: SlaYeR:. | Ali G Gunz
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 02-12-2006 , 10:55  
Reply With Quote #3

make a new global variable
Code:
gStillTime[SH_MAXSLOTS+1]
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
notorious-sk8er
Senior Member
Join Date: Jun 2005
Old 02-13-2006 , 17:06  
Reply With Quote #4

ok so i added that but it still had these errors when i compiled it:
Code:
sh_theboss.sma(66) : warning 219: local variable "id" shadows a variable at a
eceding level
sh_theboss.sma(88) : warning 217: loose indentation
sh_theboss.sma(192) : warning 219: local variable "id" shadows a variable at a
receding level
sh_theboss.sma(208) : warning 217: loose indentation
sh_theboss.sma(208) : error 017: undefined symbol "id"
sh_theboss.sma(208 -- 209) : warning 202: number of arguments does not match d
inition
sh_theboss.sma(208 -- 209) : error 001: expected token: ",", but found "else"
sh_theboss.sma(212) : error 017: undefined symbol "id"
sh_theboss.sma(213) : error 017: undefined symbol "id"
sh_theboss.sma(213 -- 214) : warning 215: expression has no effect
sh_theboss.sma(215) : error 017: undefined symbol "delay"
sh_theboss.sma(216) : error 017: undefined symbol "id"
sh_theboss.sma(216 -- 217) : warning 215: expression has no effect
sh_theboss.sma(217) : error 017: undefined symbol "id"
sh_theboss.sma(217) : error 001: expected token: ";", but found ")"
sh_theboss.sma(217) : fatal error 107: too many error messages on one line

Compilation aborted.Small compiler 2.6.0                Copyright (c) 1997-200
 ITB CompuPhase


9 Errors.

Press any key to continue . . .
???? wth
any ideas on this one?
notorious-sk8er is offline
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 01:51.


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