Raised This Month: $51 Target: $400
 12% 

cooldown add help


Post New Thread Reply   
 
Thread Tools Display Modes
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 07-24-2005 , 16:09  
Reply With Quote #21

Quote:
Originally Posted by Headshot Deluxe
What function do I add to terrorist to add a check so then wheen people drop terrorist they wont be able to get the bomb again, because ppl have been stacking the c4 on top so noone can defuse it
Before u give the c4's or w/e u give just add a check like this
Code:
if ( gHasTerroristPower[id] && is_user_alive(id) && shModActive() ) {      .....      .... }
Freecode is offline
Headshot Deluxe
Member
Join Date: Jul 2005
Location: United States
Old 07-24-2005 , 16:15  
Reply With Quote #22

Is this function correct?

Code:
public terrorist_giveweapons(id) {     if ( gHasTerroristPower[id] && is_user_alive(id) && shModActive() ) {         if ( get_user_team(id) == 1 ) shGiveWeapon(id,"weapon_c4") {     } }
__________________

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
Om3gA
Veteran Member
Join Date: Feb 2005
Old 07-24-2005 , 16:48  
Reply With Quote #23

no like this
Code:
//---------------------------------------------------------------------------------------------- public terrorist_giveweapons(id) {  if ( gHasTerroristPower[id] && is_user_alive(id) && shModActive() ) {      if ( get_user_team(id) == 1 ) shGiveWeapon(id,"weapon_c4")                } } //-----------------------------------------------------------------
__________________
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
guy
Senior Member
Join Date: Apr 2005
Old 07-24-2005 , 17:47  
Reply With Quote #24

Quote:
Originally Posted by Om3g[A
]no like this
Code:
//---------------------------------------------------------------------------------------------- public terrorist_giveweapons(id) {  if ( gHasTerroristPower[id] && is_user_alive(id) && shModActive() ) {      if ( get_user_team(id) == 1 ) shGiveWeapon(id,"weapon_c4")                } } //-----------------------------------------------------------------
Om3ga that's exactly the same as what headshot did just some spacing...
__________________
Call it, friendo.
guy is offline
Om3gA
Veteran Member
Join Date: Feb 2005
Old 07-24-2005 , 17:49  
Reply With Quote #25

so... at least this one gets complined
__________________
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
guy
Senior Member
Join Date: Apr 2005
Old 07-24-2005 , 17:54  
Reply With Quote #26

It's been stated before spacing does jack shit, just makes it easier to read.
__________________
Call it, friendo.
guy is offline
Om3gA
Veteran Member
Join Date: Feb 2005
Old 07-24-2005 , 18:27  
Reply With Quote #27

no look at this
his
Code:
public terrorist_giveweapons(id) 
{ 
    if ( gHasTerroristPower[id] && is_user_alive(id) && shModActive() ) { 
        if ( get_user_team(id) == 1 ) shGiveWeapon(id,"weapon_c4") { <--- wrong place
    } 
}
my

Code:
public terrorist_giveweapons(id) 
{ 
    if ( gHasTerroristPower[id] && is_user_alive(id) && shModActive() ) { 

        if ( get_user_team(id) == 1 ) shGiveWeapon(id,"weapon_c4") <---- right one do not need an extra } there 
    } 
}
__________________
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
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 07-24-2005 , 19:02  
Reply With Quote #28

headshots had 2 extra brackets. omegas didnt. Omegas was the right 1
Freecode is offline
Headshot Deluxe
Member
Join Date: Jul 2005
Location: United States
Old 07-24-2005 , 19:18  
Reply With Quote #29

Okay, now is this when i drop terrorist and re choose him again, i still get the c4, i dont think my coding is right can u plz check?

Code:
// TERRORIST #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", "Terrorist", 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)         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")      } } //-----------------------------------------------------------------
__________________

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
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
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 23:42.


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