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-21-2006 , 09:11  
Reply With Quote #1

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

"if ( ! statement )" is the same as "if ( statement == 0 )"
[ --<-@ ] Black Rose is offline
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 03-21-2006 , 11:02  
Reply With Quote #3

--Edited--
SubStream is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-21-2006 , 11:07  
Reply With Quote #4

Quote:
Originally Posted by SubStream
oh ok... ty for clearing that up... I read it as if ! statement meaning if NOT statement and also assumed that the statement could be 0 or 1... but what you are saying is that is_user_bot ( id ) = 1 automatically right???
Code:
if(is_user_bot(id)) {   // player is a bot ( = 1 ) } if(!is_user_bot(id)) {   // player is not a bot ( = 0 ) }
__________________
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
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 03-21-2006 , 11:51  
Reply With Quote #5

--Edited--
SubStream is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 03-21-2006 , 11:53  
Reply With Quote #6

Quote:
Originally Posted by SubStream
Also ty for the reference Brad... but I have a question...
Code:
     get_players ( players[32], &num, const flags = )
you put variable playercnt... does that = # of players found and players represents the players in the server right?
The players array holds the player ids for each player returned.

Quote:
Originally Posted by SubStream
So lets say I was doing one client_cmd on all the players... is this a correct example of how to use this
Code:
new s_players[32]
new i_playercnt
new i_playernum

public client_putinserver ()
{
          get_players ( s_players, i_playercnt, "ch" )

          for ( i_playernum = 0; i_playernum <= i_playercnt; i_playernum++ )
          {
                    new s_player = s_players[i_playernum]

                    client_cmd ( s_player, "say hello" )
          }

          RETURN PLUGIN_HANDLED
}
Is that the correct way to get all players to say hello?
No, it isn't the correct way. The following would work.
Code:
new i_players[32] new i_playercnt new i_playernum new i_playerID public client_putinserver () {           get_players ( i_players, i_playercnt, "ch" )           for ( i_playernum = 0; i_playernum < i_playercnt; i_playernum++ )           {                     i_playerID = i_players[i_playernum]                     client_cmd ( i_playerID, "say hello" )           }           RETURN PLUGIN_HANDLED }
Brad 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 16:40.


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