Raised This Month: $32 Target: $400
 8% 

I'll plant the bomb on... 2.3.0 - Let your team know where you'll plant


Post New Thread Reply   
 
Thread Tools Display Modes
Kidev
Veteran Member
Join Date: Jun 2010
Location: France
Old 06-14-2011 , 13:02   Re: I'll plant the bomb on...
Reply With Quote #11

And how can I count the number of bomb site without i?
__________________
Kidev is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-14-2011 , 13:03   Re: I'll plant the bomb on...
Reply With Quote #12

You use it ?

Right, you use it to format menu, so then you need to make 2 while loops.


You have 1 global variable i, and a local i variable, for readability you should rename global var to something like BombSiteNum, g_iBombSiteNum or whatever.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 06-14-2011 at 13:06.
ConnorMcLeod is offline
Kidev
Veteran Member
Join Date: Jun 2010
Location: France
Old 06-14-2011 , 13:05   Re: I'll plant the bomb on...
Reply With Quote #13

Yeah, in the array:
PHP Code:
new const bombsite[ ][ ] = {
    
"A",
    
"B",
    
"C",
    
"D",
    
"E"
}; 
==>
PHP Code:
public plugin_init( ) {
    
register_plugin"I'll plant the bomb on...""1.3""Kid" );
    
    new 
target = -1classnames[ ][ ] = { "func_bomb_target""info_bomb_target" };

    while( ( ( 
target find_ent_by_classtargetclassnames[0] ) ) || ( target find_ent_by_classtargetclassnames[1] ) ) ) && )
        
i++;

    if( !
) {
        
pause("a");
    }
    
register_logevent"eventSpawnedWithBomb"3"2=Spawned_With_The_Bomb" );
    
register_dictionary"illplanton.txt" );
    
printmode register_cvar"ipo_print_mode""2" );
    
useradcmd register_cvar"ipo_use_rad_cmd""1" );

    return 
PLUGIN_CONTINUE;

?

Quote:
Originally Posted by ConnorMcLeod View Post
You use it to format menu, so then you need to make 2 while loops.


You have 1 global variable i, and a local i variable, for readability you should rename global var to something like BombSiteNum, g_iBombSiteNum or whatever.
==> OK
__________________
Kidev is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-14-2011 , 13:07   Re: I'll plant the bomb on...
Reply With Quote #14

And don't forget to reset target to -1 or 0 before the 2nd loop
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Kidev
Veteran Member
Join Date: Jun 2010
Location: France
Old 06-14-2011 , 13:08   Re: I'll plant the bomb on...
Reply With Quote #15

Quote:
Originally Posted by ConnorMcLeod View Post
And don't forget to reset target to -1 or 0 before the 2nd loop
Ok ok, thank you

Done, update v1.4.
__________________

Last edited by Kidev; 06-14-2011 at 13:24.
Kidev is offline
Dolph_Ziggler
BANNED
Join Date: Jun 2011
Old 06-14-2011 , 14:04   Re: I'll plant the bomb on...
Reply With Quote #16

nice
Dolph_Ziggler is offline
Send a message via MSN to Dolph_Ziggler
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 06-14-2011 , 14:24   Re: I'll plant the bomb on...
Reply With Quote #17

mmm... add a cvar:
only on round startup player (spawned with C4) have a menu with choose a bombplace
or
each player, which got the bomb during the game process.
__________________
sorry my bad english...
alonelive is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-14-2011 , 14:33   Re: I'll plant the bomb on...
Reply With Quote #18

Lol, you doesn't seem to understand, or all i said made you confused.

PHP Code:
    new target = -1;

    if( !
find_ent_by_class( -1"func_bomb_target" ) && !find_ent_by_class( -1"info_bomb_target" ) )
        
pause("a");

    
target = -1;

    while( ( ( 
target find_ent_by_classtarget"func_bomb_target" ) ) || ( target find_ent_by_classtarget"info_bomb_target" ) ) ) && bombsitenum )
        
bombsitenum++; 
1st check is useless since you need to count sites.
while loop has the same error i pointed, you have to separate each classname into 2 while loops.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Kidev
Veteran Member
Join Date: Jun 2010
Location: France
Old 06-14-2011 , 14:37   Re: I'll plant the bomb on...
Reply With Quote #19

Like this?
PHP Code:
    new target = -1;

    if( !
find_ent_by_class( -1"func_bomb_target" ) && !find_ent_by_class( -1"info_bomb_target" ) )
        
pause("a");

    
target = -1;

    while( ( 
target find_ent_by_classtarget"func_bomb_target" ) ) && bombsitenum )
        
bombsitenum++; 
        
    while( ( 
target find_ent_by_classtarget"info_bomb_target" ) ) && bombsitenum )
        
bombsitenum++; 
__________________
Kidev is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-14-2011 , 14:44   Re: I'll plant the bomb on...
Reply With Quote #20

Remove :

if( !find_ent_by_class( -1, "func_bomb_target" ) && !find_ent_by_class( -1, "info_bomb_target" ) )
pause("a");

And do how you did previously by checking if bombsitenum is not null.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply


Thread Tools
Display Modes

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 05:08.


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