AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   HELP. (https://forums.alliedmods.net/showthread.php?t=98994)

lolzin123 07-31-2009 13:41

HELP.
 
How i edit this:
PHP Code:

if( get_user_team(plr) == 

to user team 1 or 3... like if is tr or spec...

biscuit628 07-31-2009 16:47

Re: HELP.
 
Quote:

Originally Posted by lolzin123 (Post 886734)
How i edit this:
PHP Code:

if( get_user_team(plr) == 

to user team 1 or 3... like if is tr or spec...

get_user_team(index) ==1 //ts
get_user_team(index) ==2 //ct
get_user_team(index) ==3 //spec
get_user_team(index) == 0 // unnasigned

zacky 07-31-2009 16:51

Re: HELP.
 
You should use cs_get_user_team. Much better to use.

Usage:
PHP Code:

if (cs_get_user_team(plr) == CS_TEAM_T) {
      
// Player is a terrorist
}

if (
cs_get_user_team(plr) == CS_TEAM_CT) {
      
// Player is a CT
}

if (
cs_get_user_team(plr) == CS_TEAM_SPECTATOR) {
      
// Player is a spectator
}

if (
cs_get_user_team(plr) == CS_TEAM_UNASSIGNED) {
      
// Player is unassigned



xPaw 07-31-2009 17:05

Re: HELP.
 
switch will be better

zacky 07-31-2009 17:12

Re: HELP.
 
Quote:

Originally Posted by xPaw (Post 886893)
switch will be better

I only showed how to use xD.

Maybe he will use 1 of my ifs :P

Brad 07-31-2009 18:58

Re: HELP.
 
Next time you post, do not use all caps in your thread title and do not use something as generic as "help" as the title.

This is per the forum rules.

Edit this thread and change the title, or else it will be trashed.


All times are GMT -4. The time now is 18:27.

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