Raised This Month: $ Target: $400
 0% 

strip wepons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GhostMan
Senior Member
Join Date: Jun 2012
Old 09-14-2012 , 11:51   strip wepons
Reply With Quote #1

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
GhostMan is offline
floatman
Senior Member
Join Date: Oct 2009
Location: nowhere.
Old 09-14-2012 , 12:03   Re: strip wepons
Reply With Quote #2

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] );

__________________

floatman is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-14-2012 , 12:23   Re: strip wepons
Reply With Quote #3

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

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

Fixed get_players missing flag e
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
floatman
Senior Member
Join Date: Oct 2009
Location: nowhere.
Old 09-14-2012 , 13:40   Re: strip wepons
Reply With Quote #4

Quote:
Originally Posted by ConnorMcLeod View Post
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
__________________

floatman 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 08:21.


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