Raised This Month: $ Target: $400
 0% 

percent & fix the hitboxs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 08-10-2009 , 14:11   percent & fix the hitboxs
Reply With Quote #1

i need help to make an if more then 40% of all users are dead , do just a print.

somthing like this im not good in mathematics

& how can i edit the hitboxs. my problem is my model is bigger the players hitboxs & when i please is realy near to a wall, he can watch the other site of map.
Attached Thumbnails
Click image for larger version

Name:	1111.jpg
Views:	153
Size:	98.6 KB
ID:	47210  
__________________

Last edited by One; 08-10-2009 at 14:58.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-10-2009 , 15:01   Re: percent & fix the hitboxs
Reply With Quote #2

PHP Code:
new iPlayers32 ], iNumiDead;
get_playersiPlayersiNum"h" );

for( new 
iiNumi++ )
    if( !
is_user_aliveiPlayers] ) )
        
iDead++;

if( ( ( 
iDead iNum ) * 100 ) >= 40 ) {
    
// blubb

Mhh even kids knows how to get percents
__________________
xPaw is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 08-10-2009 , 15:02   Re: percent & fix the hitboxs
Reply With Quote #3

ty



Quote:
im not good in mathematics
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-11-2009 , 00:17   Re: percent & fix the hitboxs
Reply With Quote #4

Replace

( ( iDead / iNum ) * 100 )

with

( ( iDead * 100 ) / iNum )
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 08-11-2009 , 02:24   Re: percent & fix the hitboxs
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
Replace

( ( iDead / iNum ) * 100 )

with

( ( iDead * 100 ) / iNum )
ty connor

Quote:
Mhh even kids knows how to get percents
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 08-11-2009 , 07:38   Re: percent & fix the hitboxs
Reply With Quote #6

Quote:
Originally Posted by xPaw View Post
PHP Code:
new iPlayers32 ], iNumiDead;
get_playersiPlayersiNum"h" );

for( new 
iiNumi++ )
    if( !
is_user_aliveiPlayers] ) )
        
iDead++;

if( ( ( 
iDead iNum ) * 100 ) >= 40 ) {
    
// blubb

Mhh even kids knows how to get percents
They also know how to make a simple player loop.

If you really need to use get_players(), you should use this.
Quote:
Originally Posted by Function defenition of get_players()
"b" - Don't return alive players

Either way works. I would use the first option. The second looks better though. If it weren't for that useless Players array I would've used that.
PHP Code:
// in plugin_init().
g_MaxPlayers get_maxplayers();

// ...

new iDead;
for ( new 
<= g_MaxPlayers i++ ) {
   if ( 
is_user_connected(i) && ! is_user_alive(i) )
      
iDead++;
}

if ( ( 
iDead 100 ) /  get_playersnum() >= 40 )
   
// 40% or more is dead. 
PHP Code:
new iPlayers[32], iNum;
get_players(iPlayersiNum"bh");

if ( ( 
iNum 100 ) /  get_playersnum() >= 40 )
    
// 40% or more is dead. 

Last edited by [ --<-@ ] Black Rose; 08-12-2009 at 09:32.
[ --<-@ ] Black Rose is offline
LaineN
Veteran Member
Join Date: Mar 2008
Location: Sweden
Old 08-11-2009 , 11:15   Re: percent & fix the hitboxs
Reply With Quote #7

Quote:
Originally Posted by Superiority View Post
Code:
if ( is_user_connected(i) || ! is_user_alive(i) )
Wrong.
Should be:
Code:
if ( is_user_connected(i) && !is_user_alive(i) )
__________________
Bollnas Team - HideNSeek

See all of Bollnas Team's HideNSeek
servers at
http://bollnasteam.se/!

LaineN is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 08-11-2009 , 13:21   Re: percent & fix the hitboxs
Reply With Quote #8

My bad, originally the code was like this:

if ( ! is_user_connected(i) || is_user_alive(i) )
continue;

I forgot to edit that.
[ --<-@ ] Black Rose is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-11-2009 , 17:01   Re: percent & fix the hitboxs
Reply With Quote #9

I think get_playersnum returns HLTVs.
xPaw's way then is better than yours.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-11-2009 at 17:05.
ConnorMcLeod is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 08-11-2009 , 18:52   Re: percent & fix the hitboxs
Reply With Quote #10

Quote:
Originally Posted by ConnorMcLeod View Post
I think get_playersnum returns HLTVs.
xPaw's way then is better than yours.
No. A better way would be to use the first version and add a HLTV count.
[ --<-@ ] Black Rose 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 04:20.


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