Hi, i tried to make a little plugin that strips terros weapons (primary, secondary, c4) when only 1 CT remains, but it didn't work.
- The Link to the stock i Used :
Strip Primary weapon, secondary, grenades.
- This Code i made :
PHP Code:
#include < amxmodx >
#include < cstrike >
#include < stripweapons >
#define VERSION "1.2"
#define MAX_PLAYERS 32
public plugin_init( )
{
register_plugin( "Strip Weapons Last CT", VERSION, "Imag!ne" )
register_event( "DeathMsg", "Event_DeathMsg", "a" );
}
public Event_DeathMsg( id )
{
new iPlayersCt[ MAX_PLAYERS ], iNumCt;
get_players( iPlayersCt, iNumCt, "ae", "CT" ) ;
if( iNumCt == 1 )
{
StripTerrosWeapons( id );
}
}
public StripTerrosWeapons( id )
{
if( is_user_alive( id ) && cs_get_user_team( id ) == CS_TEAM_T )
{
StripWeapons( id, Primary );
StripWeapons( id, Secondary );
StripWeapons( id, C4 );
}
}
- And The Notable error i got :
Code:
L 07/24/2014 - 19:02:58: [CSTRIKE] Player out of range (0)
Actually, I think the error is that the condition i made will check for a player that is the last CT and Terrorist together, but i really don't know how to do it otherwise.
If someone has the time to help me, i'll be really gratefull.