Raised This Month: $ Target: $400
 0% 

help with invisman for noobs only


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sai402
Member
Join Date: Sep 2005
Old 12-26-2004 , 16:41   help with invisman for noobs only
Reply With Quote #1

ok my forum specialist has tried to modify the hero. he script the changes and added some other to it, it compile just fine with no errors but it was supposed to be level 7 the maxlevel they can use it at, but i was lvl 14 and can still use it. can anyone find the error in the script? we are not goin to get credit for this and all the credit goes to the original creator. here is the new script:

Code:
#include <amxmod> #include <amxmisc> #include <superheromod.inc> #include <Vexd_Utilities> #include <VexdUM_stock> // The Invisible Man - Well Duh try guessing his power :p // CVARS // invisman_level        - what level must they be for The Invisible Man's powers? // invisman_maxlvl   - The max level the skill will work at. // invisman_invisibility - how invisible is he? 0 = completely invis 255 = completly solid // invisman_clockedmove  - is he invisible while moving too? // VARIABLES new gHeroName[]="The Invisble Man" new gHasInvisPower[SH_MAXSLOTS+1] //---------------------------------------------------------------------------------------------- public plugin_init() {   // Plugin Info   register_plugin("SUPERHERO The Invisible Man","1.0","AssKicR")   // FIRE THE EVENT TO CREATE THIS SUPERHERO!   if ( isDebugOn() ) server_print("Attempting to create Invisble Man Hero")   if ( !cvar_exists("invisman_level") ) register_cvar("invisman_level", "0")   if ( !cvar_exists("invisman_maxlvl") ) register_cvar("invisman_maxlvl", "7")   shCreateHero(gHeroName, "Invisble", "Makes you less visible/Harder to see... Only works while standing/not shooting and not zooming...", false, "invisman_level" )   // REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)   register_event("ResetHUD","newRound","b")   // INIT   register_srvcmd("invisman_init", "invisman_init")   shRegHeroInit(gHeroName, "invisman_init")   // CHECK SOME BUTTONS   set_task(0.01,"check_attack",0,"",0,"b")   set_task(0.01,"check_two_buttons",0,"",0,"b")   set_task(0.01,"check_move_buttons",0,"",0,"b")   // DEFAULT THE CVARS   register_cvar("invisman_invisibility", "0")   register_cvar("invisman_clockedmove", "10")   } //---------------------------------------------------------------------------------------------- public invisman_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 flash   read_argv(2,temp,5)   new hasPowers=str_to_num(temp)   gHasInvisPower[id]=(hasPowers!=0)     // Got to remove the powers if he is not The Invisible Man   if ( !hasPowers )     uninvis(id)     // THIS IS OUR BULLSHIT ATTEMPT TO CHANGE THIS    ATTENTION !!!                        LuKa and PidG30n   if ( gHasInvisPower[id] >= get_cvar_num("invisman_maxlvl") )     uninvis(id)   //Give Powers to the Invisible Man   if ( hasPowers )     invis(id) } public newRound(id) {   if ( is_user_alive(id) && gHasInvisPower[id]) {   invis(id)   } } public invis(id) {     set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,get_cvar_num("invisman_invisiblility")) } public uninvis(id) {     set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,255) } public check_attack() {   for(new i = 1; i <= get_maxplayers(); ++i) {     if (is_user_alive(i)) {       if ((get_user_button(i)&IN_ATTACK) && gHasInvisPower[i]) {         uninvis(i)       }        else if (!(get_user_button(i)&IN_ATTACK) && gHasInvisPower[i]) {         invis(i)     }   }   }   return PLUGIN_CONTINUE } public check_two_buttons() {   for(new i = 1; i <= get_maxplayers(); ++i) {     if (is_user_alive(i)) {       if ((get_user_button(i)&IN_USE) && gHasInvisPower[i]) {         uninvis(i)       }       if ((get_user_button(i)&IN_ATTACK2) && gHasInvisPower[i]) {         uninvis(i)       }   }   }   return PLUGIN_CONTINUE } public check_move_buttons() {   if (get_cvar_num("invisman_clockedmove")==1) return PLUGIN_HANDLED   for(new i = 1; i <= get_maxplayers(); ++i) {     if (is_user_alive(i)) {       if ((get_user_button(i)&IN_BACK) && gHasInvisPower[i]) {         uninvis(i)     }       if ((get_user_button(i)&IN_MOVELEFT) && gHasInvisPower[i]) {     uninvis(i)       }       if ((get_user_button(i)&IN_MOVERIGHT) && gHasInvisPower[i]) {         uninvis(i)       }       if ((get_user_button(i)&IN_FORWARD) && gHasInvisPower[i]) {         uninvis(i)       }       if ((get_user_button(i)&IN_RUN) && gHasInvisPower[i]) {         uninvis(i)       }   }   }   return PLUGIN_CONTINUE }
sai402 is offline
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 12-26-2004 , 19:13  
Reply With Quote #2

gHasInvisPower is not the level a person is at, but rather a true or false (1 or 0) if the person has the invisible man hero selected... so your equation wont work for what you are trying to do...


next time use the Small bbCode tag for posting the code or just attach the sma... (changed it for you)
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
sai402
Member
Join Date: Sep 2005
Old 12-26-2004 , 22:38  
Reply With Quote #3

ok sorry, i never posted anything like this before. thanks for telling me. i'll remember next time. i'll get back to you on that changes.
sai402 is offline
Prowler
Senior Member
Join Date: Nov 2004
Old 12-27-2004 , 00:57  
Reply With Quote #4

try this (untested)
Code:
#include <amxmod> #include <amxmisc> #include <superheromod> #include <vexd_utilities> #if defined AMX_NEW   stock get_user_button(id)   {    return entity_get_int(id, EV_INT_button)   } #endif #if defined AMXX_VERSION   #include <engine> #endif #if !defined AMXX_VERSION && !defined AMX_NEW   #include <xtrafun> #endif // The Invisible Man - Well Duh try guessing his power :p // CVARS // invisman_level        - what level must they be for The Invisible Man's powers? // VARIABLES new gHeroName[]="The Invisble Man" new gHasInvisPower[SH_MAXSLOTS+1] new gPlayerLevels[SH_MAXSLOTS+1] //---------------------------------------------------------------------------------------------- public plugin_init() {   // Plugin Info   register_plugin("SUPERHERO The Invisible Man","1.0","AssKicR")   // FIRE THE EVENT TO CREATE THIS SUPERHERO!   if ( isDebugOn() ) server_print("Attempting to create Invisble Man Hero")   if ( !cvar_exists("invisman_level") ) register_cvar("invisman_level", "0")   shCreateHero(gHeroName, "Invisble", "Makes you less visible/Harder to see... Only works while standing/not shooting and not zooming...", false, "invisman_level" )   // REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)   register_event("ResetHUD","newRound","b")   // INIT   register_srvcmd("invisman_init", "invisman_init")   shRegHeroInit(gHeroName, "invisman_init")   // LEVELS   register_srvcmd("invisman_levels", "invisman_levels")   shRegLevels(gHeroName,"invisman_levels")   // CHECK SOME BUTTONS   set_task(0.01,"check_attack",0,"",0,"b")   set_task(0.01,"check_two_buttons",0,"",0,"b")   set_task(0.01,"check_move_buttons",0,"",0,"b")   // DEFAULT THE CVARS   register_cvar("invisman_invisibility", "60")   register_cvar("invisman_clockedmove", "0")   register_cvar("invisman_maxlevel", "7")   } //---------------------------------------------------------------------------------------------- public invisman_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 flash   read_argv(2,temp,5)   new hasPowers=str_to_num(temp)   gHasInvisPower[id]=(hasPowers!=0)     // Got to remove the powers if he is not The Invisible Man   if ( !hasPowers )     uninvis(id)   //Give Powers to the Invisible Man   if ( hasPowers )   {     if (gPlayerLevels[id] > get_cvar_num("invisman_maxlevel"))         client_print(id,print_center, "The Invisible Man will not work as you are higher than the max level")     else         invis(id)   } } //---------------------------------------------------------------------------------------------- public newRound(id) {   if ( is_user_alive(id) && gHasInvisPower[id]) {     if (gPlayerLevels[id] > get_cvar_num("invisman_maxlevel"))         client_print(id,print_center, "The Invisible Man will not work as you are higher than the max level")     else         invis(id)   } } //---------------------------------------------------------------------------------------------- public invis(id) {     if (gPlayerLevels[id] > get_cvar_num("invisman_maxlevel")) return     else set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,get_cvar_num("invisman_invisiblility")) } public uninvis(id) {     set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,255) } //---------------------------------------------------------------------------------------------- public check_attack() {   for(new i = 1; i <= get_maxplayers(); ++i) {     if (is_user_alive(i)) {       if ((get_user_button(i)&IN_ATTACK) && gHasInvisPower[i]) {         uninvis(i)       }        else if (!(get_user_button(i)&IN_ATTACK) && gHasInvisPower[i]) {         invis(i)     }   }   }   return PLUGIN_CONTINUE } //---------------------------------------------------------------------------------------------- public check_two_buttons() {   for(new i = 1; i <= get_maxplayers(); ++i) {     if (is_user_alive(i)) {       if ((get_user_button(i)&IN_USE) && gHasInvisPower[i]) {         uninvis(i)       }       if ((get_user_button(i)&IN_ATTACK2) && gHasInvisPower[i]) {         uninvis(i)       }   }   }   return PLUGIN_CONTINUE } //---------------------------------------------------------------------------------------------- public check_move_buttons() {   if (get_cvar_num("invisman_clockedmove")==1) return PLUGIN_HANDLED   for(new i = 1; i <= get_maxplayers(); ++i) {     if (is_user_alive(i)) {       if ((get_user_button(i)&IN_BACK) && gHasInvisPower[i]) {         uninvis(i)     }       if ((get_user_button(i)&IN_MOVELEFT) && gHasInvisPower[i]) {     uninvis(i)       }       if ((get_user_button(i)&IN_MOVERIGHT) && gHasInvisPower[i]) {         uninvis(i)       }       if ((get_user_button(i)&IN_FORWARD) && gHasInvisPower[i]) {         uninvis(i)       }       if ((get_user_button(i)&IN_RUN) && gHasInvisPower[i]) {         uninvis(i)       }   }   }   return PLUGIN_CONTINUE } //---------------------------------------------------------------------------------------------- public invisman_levels() {   new id[5]   new lev[5]   read_argv(1,id,4)   read_argv(2,lev,4)   gPlayerLevels[str_to_num(id)] = str_to_num(lev) }
Prowler is offline
sai402
Member
Join Date: Sep 2005
Old 12-27-2004 , 13:25  
Reply With Quote #5

thanks vittu and prowler, its working like a charm
sai402 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 16:26.


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