AlliedModders

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

GhostMan 09-14-2012 11:51

strip wepons
 
Whitch way is better to strip t's weapons?

PHP Code:

public round_end()
{
    new 
players[32], inumi    
    get_players
(playersinum"ah")
    
    for (
0inum; ++i)
    {
        if(
cs_get_user_team(players[i]) == CS_TEAM_T)
        {
            
strip_weapons(players[i])
        }
    }


PHP Code:

public round_end(id)
{
    if(
cs_get_user_team(id) == CS_TEAM_T && is_user_alive(id))
    {
        
strip_weapons(id)
    }


Stripping weapons is the only thing why i need to catch T's ids

floatman 09-14-2012 12:03

Re: strip wepons
 
First method is the right one. However, you don't need the h flag and you don't need to check if the player is alive. I rewrote it:
PHP Code:

public round_end()
{
    new 
iPlayers32 ], iNumi;
    
get_playersiPlayersiNum"a""TERRORIST" );

    for( 
0iNumi++ )
        
strip_user_weaponsiPlayers] );



ConnorMcLeod 09-14-2012 12:23

Re: strip wepons
 
PHP Code:

public round_end()
{
    new 
iPlayers32 ], iNum;
    
get_playersiPlayersiNum"ae""TERRORIST" );

    for(--
iNumiNum>=0iNum-- )
        
strip_user_weaponsiPlayersiNum ] );


Fixed get_players missing flag e

floatman 09-14-2012 13:40

Re: strip wepons
 
Quote:

Originally Posted by ConnorMcLeod (Post 1799073)
PHP Code:

public round_end()
{
    new 
iPlayers32 ], iNum;
    
get_playersiPlayersiNum"ae""TERRORIST" );

    for(--
iNumiNum>=0iNum-- )
        
strip_user_weaponsiPlayersiNum ] );


Fixed get_players missing flag e

Ops :shock:


All times are GMT -4. The time now is 08:21.

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