View Single Post
Headshot Deluxe
Member
Join Date: Jul 2005
Location: United States
Old 07-24-2005 , 23:07  
Reply With Quote #30

Freecode said:
Quote:
make a bool and set it to true when he gets the c4 set it to false on a new round
Is this correct?

Code:
// TERRORIST /* CVARS - copy and paste to shconfig.cfg //Terrorist terrorist_level 0 terrorist_c4cooldown 600 */ #include <amxmod> #include <vexd_utilities> #include <superheromod> #define CSW_C4  6 // GLOBAL VARIABLES new gHeroName[]="Terrorist" new bool:gHasTerroristPower[SH_MAXSLOTS+1] //---------------------------------------------------------------------------------------------- public plugin_init() {     // Plugin Info     register_plugin("SUPERHERO Terrorist", "1.0", "Headshot Deluxe")     // DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG     register_cvar("terrorist_level", "0")     register_cvar("terrorist_c4cooldown", "600")     // FIRE THE EVENT TO CREATE THIS SUPERHERO!     shCreateHero(gHeroName, "Terrorist", "Plant the bomb more than once.", false, "terrorist_level" )     // REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)     // INIT     register_srvcmd("terrorist_init", "terrorist_init")     shRegHeroInit(gHeroName, "terrorist_init")     register_event("ResetHUD", "newRound", "b") } //---------------------------------------------------------------------------------------------- public terrorist_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 (!is_user_connected(id)) return     gHasTerroristPower[id] = (hasPowers != 0)     //Reset thier shield restrict status     //Shield restrict MUST be before weapons are given out     shResetShield(id)     if ( is_user_alive(id) ) {         if ( hasPowers ) {             terrorist_giveweapons(id)         }         else if ( !hasPowers && gHasTerroristPower[id] ) {             engclient_cmd(id, "drop", "weapon_c4")         }     }     gHasTerroristPower[id] = (hasPowers != 0) } //---------------------------------------------------------------------------------------------- public newRound(id) {     if ( gHasTerroristPower[id] && is_user_alive(id) && shModActive() ) {         set_task(0.1, "terrorist_giveweapons", id)         gHasTerroristPower[id] = false         new clip, ammo, wpnid = get_user_weapon(id, clip, ammo)         if (wpnid != CSW_AK47 && wpnid > 0) {             new wpn[32]             get_weaponname(wpnid, wpn, 31)             engclient_cmd(id, wpn)         }     } } //---------------------------------------------------------------------------------------------- public terrorist_giveweapons(id) {     if ( gHasTerroristPower[id] && is_user_alive(id) && shModActive() ) {           if ( get_user_team(id) == 1 ) shGiveWeapon(id,"weapon_c4")           gHasTerroristPower[id] = true     } } //-----------------------------------------------------------------
__________________

Friend's Ultimate WC3 Server - 82.165.253.69:27015
=\
Headshot Deluxe is offline
Send a message via ICQ to Headshot Deluxe Send a message via AIM to Headshot Deluxe Send a message via MSN to Headshot Deluxe Send a message via Yahoo to Headshot Deluxe