AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   function get_players error (https://forums.alliedmods.net/showthread.php?t=102442)

MasterKy 09-02-2009 13:56

function get_players error
 
PHP Code:

public ultimoPlayer(){
    
server_cmd("amx_execall spk misc/roaring")
    
get_players gi_playersgi_playercnt"a")
    
    for ( 
gi_playernum 0gi_playernum gi_playercntgi_playernum++ )
    {
        
gi_playerID gi_players[gi_playernum]
        
        
set_user_health(gi_playerID,100)
        
set_user_godmode(gi_playerID,0)
        
visivel(gi_playerID)
    }
}

public 
ultimoPlayerSetModel(){
        
get_players gi_playersgi_playercnt"ah""CS_TEAM_T" )
    
    for ( 
gi_playernum 0gi_playernum 1gi_playernum++ )
    {
        
gi_playerID gi_players[gi_playernum]
        
        
cs_set_user_model(gi_playerID,"gign")
client_print(0,print_chat"O ultimo TR agora esta com roupa de CT! Cuidado!!")
        
    }


this dont work, only the
server_cmd("amx_execall spk misc/roaring")

what is the error in this? :|
thanks!!

xPaw 09-02-2009 14:11

Re: function get_players error
 
Code:
public ultimoPlayer( ) {     server_cmd("amx_execall spk misc/roaring");         new iPlayers[ 32 ], iCount, id;     get_players( iPlayers, iCount, "a" );         for( new i = 0; i < iCount; i++ ) {         id = iPlayers[ i ];                 set_user_health( id, 100 );         set_user_godmode( id, 0 );         visivel( id );     } }

And Change "CS_TEAM_T" to "CT"

MasterKy 09-03-2009 11:54

Re: function get_players error
 
oh ok but and the ultimoPlayerSetModel()?? this dont work too

Exolent[jNr] 09-03-2009 12:12

Re: function get_players error
 
PHP Code:

public ultimoPlayerSetModel( ) {
    new 
iPlayers32 ], iCountid;
    
get_playersiPlayersiCount"a" );
    new 
bool:bTerr false;
    for( new 
0iCounti++ ) {
        
id iPlayers];
        if( 
cs_get_user_teamid ) == CS_TEAM_T ) {
            
cs_set_user_modelid"gign" );
            if( !
bTerr ) {
                
bTerr true;
                
client_print0print_chat"O ultimo TR agora esta com roupa de CT! Cuidado!!" );
            }
        }
    }




All times are GMT -4. The time now is 14:59.

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