Raised This Month: $ Target: $400
 0% 

as used cs_get_user_team???


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
larito
Veteran Member
Join Date: Nov 2008
Location: Argentina- Mendoza
Old 02-15-2009 , 09:20   as used cs_get_user_team???
Reply With Quote #1

I'm working in a scripting, make when start round say hudmessage if team Human "umbrella needs your help" and if team T "destroy umbrella". But I don not as differentiate the team, I will do so to speak for all.Why would I want to learn how to read it in one team and another team something else


sorry for my inglish
I use traductor
__________________
Facebook: Ariel Berardi
larito is offline
Send a message via MSN to larito
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-15-2009 , 12:49   Re: as used cs_get_user_team???
Reply With Quote #2

Using a for loop and maxplayers / get_players (not indicated)
__________________

anakin_cstrike is offline
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 02-15-2009 , 14:04   Re: as used cs_get_user_team???
Reply With Quote #3

PHP Code:
new players[32], pnumid

get_players
(playerspnum);
        
        for( new 
i=0i<pnumi++ ){
            
id   players[i];

if(
get_user_team(id) == 1){
 
//code team TT   
            
}

else if(
get_user_team(id) == 2){
    
//code team CT
            
}
   } 
__________________
Find my plugins here..

Ex - Spanish Moderator.
Starsailor is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-15-2009 , 14:12   Re: as used cs_get_user_team???
Reply With Quote #4

PHP Code:
new players[32], pnumidiTeam

get_players
(playerspnum);

for( new 
1pnumi++ ) {
    
id players];
    
    
iTeam get_user_teamid );
    
    if( 
iTeam == ) {
        
// Terrorist team..
    
}
    else if( 
iTeam == ) {
        
// CT Team..
    
}

get team just once, insead of getting it twice.
__________________
xPaw is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-15-2009 , 14:18   Re: as used cs_get_user_team???
Reply With Quote #5

Code:
for( new i; i < pnum; i++ ) {     switch ( get_user_team( players[ i ] ) )     {         case 1 : // Terrorist team..         case 2 : // CT Team..     } }
Arkshine is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-15-2009 , 14:30   Re: as used cs_get_user_team???
Reply With Quote #6

thats better
__________________
xPaw is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-15-2009 , 16:10   Re: as used cs_get_user_team???
Reply With Quote #7

Neah ^^
Code:
for( new i; i < pnum; i++ ) {     switch ( get_user_team( players[ i ] ) )     {         case 1 : // Terrorist team..         case 2 : // CT Team...         default: continue; // skip spectators     } }
__________________

anakin_cstrike is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-15-2009 , 16:43   Re: as used cs_get_user_team???
Reply With Quote #8

Pointless, there is no code after the switch, so if it's not 1 or 2, it will continue.
Arkshine is offline
larito
Veteran Member
Join Date: Nov 2008
Location: Argentina- Mendoza
Old 02-15-2009 , 19:42   Re: as used cs_get_user_team???
Reply With Quote #9

Quote:
Originally Posted by Starsailor View Post
PHP Code:
new players[32], pnumid

get_players
(playerspnum);
        
        for( new 
i=0i<pnumi++ ){
            
id   players[i];

if(
get_user_team(id) == 1){
 
//code team TT   
            
}

else if(
get_user_team(id) == 2){
    
//code team CT
            
}
   } 
+karma for you worked perfect thanks!
__________________
Facebook: Ariel Berardi
larito is offline
Send a message via MSN to larito
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 02-15-2009 , 19:45   Re: as used cs_get_user_team???
Reply With Quote #10

Quote:
Originally Posted by larito View Post
+karma for you worked perfect thanks!
Why did you choose the worst code in the thread?
__________________
hleV 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 17:05.


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