Raised This Month: $12 Target: $400
 3% 

[INC] NS Team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mevrael
Junior Member
Join Date: Jul 2008
Location: Riga, Latvia
Old 06-14-2010 , 09:49   [INC] NS Team
Reply With Quote #1

Mod: Natural-Selection 3.2

Description:

Those functions provides a simple manipulation with NS (MvA) teams:
1) Check if player is in team
2) Change player team
3) Count players in team
4) Get players ID and count in team

Usage:
1) Download nsteam.inc and place to your addons/amxmodx/scripting/include folder.
2) Include it in your plugins (#include <nsteam>) and go on.

Stocks:
nst_is_readyroom(index) - return true if player is in readyroom.
nst_is_spectate(index) - return true if player is in spectatorteam.
nst_is_marine(index) - return true if player is in marine team.
nst_is_alien(index) - return true if player is in alien team.

nst_readyroom(index) - send a player to readyroom if he isn't already in readyroom.
nst_readyroomall() - send all players to readyroom.
nst_spectate(index) - send a player to spectatorteam.
nst_marine(index) - send a player to marine team.
nst_alien(index) - send a player to alien team.

nst_readyroom_count() - return a number of players in readyroom.
nst_spectate_count() - return a number of players in spectatorteam.
nst_marine_count() - return a number of players in marine team.
nst_alien_count() - return a number of players in alien team.

Those functions return an array with 33 elements. 1-32 are player indexes and 0 - player count in this team:

nst_get_readyroom() - get readyroom players.
nst_get_spectate() - get spectators.
nst_get_marine() - get marines.
nst_get_alien() - get aliens.

Example: client_print to all marines
PHP Code:
new marines[33], i
marines 
nst_get_marine()
for (
i=1i<=marines[0]; i++)
{
     
client_print(marines[i], print_chat"You are marine!")

Attached Files
File Type: inc nsteam.inc (5.1 KB, 301 views)

Last edited by Mevrael; 06-16-2010 at 03:39.
Mevrael is offline
Send a message via ICQ to Mevrael
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 06-14-2010 , 12:35   Re: [INC] NS Team
Reply With Quote #2

Instead of using equal( ) all the time you can simply do (obviously talking about single-char comparisions):
PHP Code:
if ( team] == 'm' )
{
    
// Code

__________________
"There is no knowledge, that is not power"
fezh is offline
Mevrael
Junior Member
Join Date: Jul 2008
Location: Riga, Latvia
Old 06-14-2010 , 14:09   Re: [INC] NS Team
Reply With Quote #3

Yes, it's better. Thank you

File updated.

Last edited by Mevrael; 06-14-2010 at 14:28.
Mevrael is offline
Send a message via ICQ to Mevrael
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 15:48.


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