Raised This Month: $ Target: $400
 0% 

Please delete this post


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 03-20-2006 , 13:53   Please delete this post
Reply With Quote #1

--Edited--
SubStream is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-20-2006 , 13:59  
Reply With Quote #2

yes it's correct, if you want it to execute code when user is none of the options.

lookst btr with
Code:
if ( ! is_user_bot ( id ) && ! is_user_hltv ( id ) ) {         // Your code here }
[ --<-@ ] Black Rose is offline
capndurk
Senior Member
Join Date: Feb 2006
Old 03-20-2006 , 14:52  
Reply With Quote #3

Quote:
Originally Posted by [ --<-@
Black Rose]
Code:
if ( ! is_user_bot ( id ) && ! is_user_hltv ( id ) ) {         // Your code here }
Why is your first { next to the if statement, and not below it? Wouldn't it be easier code to read if it were below it?
capndurk is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-20-2006 , 14:58  
Reply With Quote #4

i personally think it looks ugly when its under.
[ --<-@ ] Black Rose is offline
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 03-20-2006 , 15:30  
Reply With Quote #5

Quote:
Originally Posted by capndurk
Quote:
Originally Posted by [ --<-@
Black Rose]
Code:
if ( ! is_user_bot ( id ) && ! is_user_hltv ( id ) ) {         // Your code here }
Why is your first { next to the if statement, and not below it? Wouldn't it be easier code to read if it were below it?
Everyone has their different style of coding. It all depends on preference.
organizedKaoS is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-20-2006 , 15:35  
Reply With Quote #6

or
Code:
if(is_user_bot(id) || is_user_hltv(id)) {   return; } // main code
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 03-20-2006 , 20:51  
Reply With Quote #7

Also note that if you are using get_players() and then looping through the resultant player array, you can pass a flag to not include bots and (as of AMXX 1.71) include a flag not to include HLTV slots. Doing so, if your code allows it, is more efficient than screening the bad ones out in a loop.
Brad is offline
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 03-20-2006 , 23:32  
Reply With Quote #8

--Edited--
SubStream is offline
LittleDude
Member
Join Date: Dec 2004
Location: Selah, WA
Old 03-21-2006 , 00:08  
Reply With Quote #9

Quote:
Originally Posted by [ --<-@
Black Rose]i personally think it looks ugly when its under.
I agree
__________________
It is stupid to be stupid, and stupid to not be stupid
LittleDude is offline
Send a message via AIM to LittleDude
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 03-21-2006 , 09:07  
Reply With Quote #10

Quote:
Originally Posted by SubStream
is this documentation about the new flags already up somewhere? or can you post where/how to use the flags & which flags = what
Here's the documentation for the function:
http://www.amxmodx.org/funcwiki.php?go=func&id=174

Here's an example to grab all players except bots and HLTV slots:
Code:
new players[32], playerCnt; get_players(players, playerCnt, "ch");
Here's an example that is the same as the one above but won't grab dead players either:
Code:
new players[32], playerCnt; get_players(players, playerCnt, "ach");
Brad 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 16:39.


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