Raised This Month: $ Target: $400
 0% 

hero help


Post New Thread Reply   
 
Thread Tools Display Modes
Om3gA
Veteran Member
Join Date: Feb 2005
Old 09-05-2005 , 11:28  
Reply With Quote #21

Code:
//Mafia!  //NOTE: THIS HERO IS JUST MASTERCHIEF!!! and bill gates  //Keep This hero for your self thx  /* CVARS copy and paste to shconfig.cfg  //Mafia  mafia_level 10 // Level where this hero can be choosen  mafia_galilmult 3.0 // His Galil Mult  mafia_knifemult 3.0 // His Knife  mafia_armor 150 // His body protection  mafia_money 50000  // amout of money mafia starts with  */  #include <amxmod>  #include <Vexd_Utilities>  #include <superheromod>  //Global Variables  new gHeroName[]="Mafia"  new bool:gHasmafiaPower[SH_MAXSLOTS+1]  new bool:gmorphed[SH_MAXSLOTS+1]  //----------------------------------------------------------------------------------------------  public plugin_init()  {     //Plugin Info     register_plugin("SUPERHERO Mafia","1.0","mega")     //DO NOT EDIT THESE CVARS. USE shconfig.cfg     register_cvar("mafia_level", "10")     register_cvar("mafia_galilmult", "3.0")     register_cvar("mafia_knifemult", "3.0")     register_cvar("mafia_armor","150")     register_cvar("mafia_money","50000")     //FIRE THIS EVENT TO CREATE THIS HERO     shCreateHero(gHeroName, "Mafia", "Get a tommygun, a knife, and get $50.000", false, "mafia_level")     // REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS     register_srvcmd("mafia_init", "mafia_init")     shRegHeroInit(gHeroName, "mafia_init")     //EVENTS     register_event("ResetHUD", "newSpawn","b")     register_event("CurWeapon", "weaponChange","be","1=1")     register_event("Damage", "mafia_damage", "b","2!0")     register_event("DeathMsg", "mafia_death", "a")     // MAFIA'S VARIABLE     shSetMaxArmor(gHeroName, "mafia_armor" )  }  //----------------------------------------------------------------------------------------------  public mafia_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 Mafia     read_argv(2,temp,5)     new hasPowers = str_to_num(temp)     //Reset thier shield restrict status     //Shield restrict MUST be before weapons are given out     shResetShield(id)     if ( is_user_alive(id) ) {         if ( hasPowers ) {             mafia_weapons(id)             switchmodel(id)             mafia_tasks(id)         }         //This gets run if they had the power but don't anymore         else if ( !hasPowers && gHasmafiaPower[id] ) {             engclient_cmd(id, "drop", "weapon_galil")         }     }     //Sets this variable to the current status     gHasmafiaPower[id] = (hasPowers != 0)  }  //----------------------------------------------------------------------------------------------  public plugin_precache()  {     precache_model("models/shmod/mafia_galil.mdl")     precache_model("models/shmod/mafia_knife.mdl")     precache_model("models/player/mafia/mafia.mdl")  }  //----------------------------------------------------------------------------------------------  public newSpawn(id)  {     if ( gHasmafiaPower[id] && is_user_alive(id) && shModActive() ) {         set_task(0.1, "mafia_weapons", id)         mafia_tasks(id)         new money         money=cs_get_user_money(id)         new addmoney=floatround(money * 0.1)         money+=addmoney         cs_set_user_money( id, money, 1 )         cs_set_user_money(id,get_cvar_num("mafia_money"))         new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)         if (wpnid != CSW_GALIL && wpnid > 0) {             new wpn[32]             get_weaponname(wpnid,wpn,31)             engclient_cmd(id,wpn)         }     }  }  //----------------------------------------------------------------------------------------------  public mafia_tasks(id)  {     set_task(1.0, "mafia_morph", id)  }  //----------------------------------------------------------------------------------------------  public Money(id,num) // check money  {     new userMoney = cs_get_user_money(id)     if (userMoney < 0)     {         client_print(id,print_center,"You have insufficient funds!")         return false     }     cs_set_user_money(id,userMoney)     return true  }  //----------------------------------------------------------------------------------------------  public mafia_weapons(id)  {     if ( is_user_alive(id) && shModActive() ) {         shGiveWeapon(id,"weapon_galil")     }  }  //----------------------------------------------------------------------------------------------  public switchmodel(id)  {     if ( !is_user_alive(id) || !gHasmafiaPower[id] ) return     new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)     if (wpnid == CSW_GALIL) {         // Weapon Model change thanks to [CCC]Taz-Devil         Entvars_Set_String(id, EV_SZ_viewmodel, "models/shmod/mafia_galil.mdl")     } else     if (wpnid == CSW_KNIFE) {         // Weapon Model change thanks to [CCC]Taz-Devil         Entvars_Set_String(id, EV_SZ_viewmodel, "models/shmod/mafia_knife.mdl")     }  }  //----------------------------------------------------------------------------------------------  public weaponChange(id)  {     if ( !gHasmafiaPower[id] || !shModActive() ) return     new wpnid = read_data(2)     new clip = read_data(3)     if ( wpnid != CSW_GALIL) return     if ( wpnid != CSW_KNIFE)     switchmodel(id)     // Never Run Out of Ammo!     if ( clip == 0 ) {         shReloadAmmo(id)     }  }  //----------------------------------------------------------------------------------------------  public mafia_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 ( gHasmafiaPower[attacker] && weapon == CSW_GALIL && is_user_alive(id) ) {         // do extra damage         new extraDamage = floatround(damage * get_cvar_float("mafia_galilmult") - damage)         if (extraDamage > 0) shExtraDamage( id, attacker, extraDamage, "galil", headshot )     } else     if ( gHasmafiaPower[attacker] && weapon == CSW_KNIFE && is_user_alive(id) ) {         new extraDamage = floatround(damage * get_cvar_float("mafia_knifemult") - damage)         if (extraDamage > 0) shExtraDamage( id, attacker, extraDamage, "knife", headshot )     }  }  //----------------------------------------------------------------------------------------------  public mafia_morph(id)  {     if ( gmorphed[id] || !is_user_alive(id) ) return     #if defined AMXX_VERSION     cs_set_user_model(id, "mafia")     #else     CS_SetModel(id, "mafia")     #endif     // Message     set_hudmessage(50, 205, 50, -1.0, 0.40, 2, 0.02, 4.0, 0.01, 0.1, 7)     show_hudmessage(id, "Lol whrite here what ever ya want O.o")     gmorphed[id] = true  }  //----------------------------------------------------------------------------------------------  public mafia_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, "Lol whrite here what ever ya want O.o")         #if defined AMXX_VERSION         cs_reset_user_model(id)         #else         CS_ClearModel(id)         #endif         gmorphed[id] = false     }  }  //----------------------------------------------------------------------------------------------  public mafia_death()  {     new id = read_data(2)     if ( !gHasmafiaPower[id] ) return     mafia_unmorph(id)  }  //----------------------------------------------------------------------------------------------  public client_connect(id)  {     gmorphed[id] = false  }  //----------------------------------------------------------------------------------------------
__________________
Om3gA is offline
Send a message via AIM to Om3gA Send a message via MSN to Om3gA Send a message via Yahoo to Om3gA Send a message via Skype™ to Om3gA
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 19:51.


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