AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Please delete this post (https://forums.alliedmods.net/showthread.php?t=25797)

SubStream 03-20-2006 13:53

Please delete this post
 
--Edited--

[ --<-@ ] Black Rose 03-20-2006 13:59

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 }

capndurk 03-20-2006 14:52

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?

[ --<-@ ] Black Rose 03-20-2006 14:58

i personally think it looks ugly when its under.

organizedKaoS 03-20-2006 15:30

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. :lol: :lol: :lol:

v3x 03-20-2006 15:35

or
Code:
if(is_user_bot(id) || is_user_hltv(id)) {   return; } // main code

Brad 03-20-2006 20:51

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.

SubStream 03-20-2006 23:32

--Edited--

LittleDude 03-21-2006 00:08

Quote:

Originally Posted by [ --<-@
Black Rose]i personally think it looks ugly when its under.

I agree

Brad 03-21-2006 09:07

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");


All times are GMT -4. The time now is 16:40.

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