AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED]how to do anything on player without checking... (https://forums.alliedmods.net/showthread.php?t=106521)

One 10-16-2009 06:30

[SOLVED]how to do anything on player without checking...
 
how can i change players team without
if(is_user_alive(id)) ?

i tried this but i got error :

PHP Code:

for ( new iiNumi++ )
{

      
cs_set_user_team(i,CS_TEAM_T)      



but maybe i want to transfer the dead players too oO is there no way?

xPaw 10-16-2009 06:35

Re: how to do anything on player without checking...
 
more code... if you have get_players there, it should be like players[ i ]

One 10-16-2009 06:41

Re: how to do anything on player without checking...
 
nope. i dont. i just want to transfer all players(dead or alive) to T.but when i check if is user alive,my dead players will not transfered and when i dont check, nobody willbe tranfered.
& sorry forget my first code. this is my right code :

PHP Code:

for(1<= g_MaxPlayersi++)    
{         
cs_set_user_team(i,CS_TEAM_T)    



xPaw 10-16-2009 06:43

Re: how to do anything on player without checking...
 
is_user_connected ? :|

One 10-16-2009 06:49

Re: how to do anything on player without checking...
 
huh? sry but i learned to ask ever if is user alive. this is new for me. when you say that this works, then works too.
ty

Jon 10-16-2009 07:12

Re: [SOLVED]how to do anything on player without checking...
 
If you want to include dead players, use is_user_connected, if only want to include alive, use is_user_alive?

Alka 10-16-2009 10:04

Re: how to do anything on player without checking...
 
Quote:

Originally Posted by One (Post 963637)
huh? sry but i learned to ask ever if is user alive. this is new for me. when you say that this works, then works too.
ty

lol'd.

One 10-16-2009 10:15

Re: [SOLVED]how to do anything on player without checking...
 
yea sry that i never this in c# :)
i can search for my old threads in which anyone writed that i have ever check if is player alived :) all what i know about amxx , is that what users say or what i saw to learn oO
lol?

vitorrd 10-16-2009 12:58

Re: [SOLVED]how to do anything on player without checking...
 
I told you more than once to look at the funcwiki, haven't I? You can answer 99% of your question simply looking at the wiki with the right keywords.

ConnorMcLeod 10-16-2009 13:03

Re: [SOLVED]how to do anything on player without checking...
 
You should reconsider get_players.

Anyway :

( Check if player is CT prevent the plugin from switchng spec and to set again Ts )

PHP Code:

for(id 1id <= g_MaxPlayersid++)    
{
    if( 
is_user_connected(id) && cs_get_user_team(id) == CS_TEAM_CT )
    {     
        
cs_set_user_team(idCS_TEAM_T)
    }  




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

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