AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [....] (https://forums.alliedmods.net/showthread.php?t=163311)

Erdener 07-29-2011 01:31

[....]
 
[....]

Doc-Holiday 07-29-2011 01:41

Re: This Code Not Work :(
 
PHP Code:

#pragma semicolon 1

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )

new g_iMaxPlayers;

public 
plugin_init( )
{
    
register_plugin"No Knife Damage""0.0.1""SavSin" );
    
    
RegisterHamHam_TakeDamage"player""PlayerHurt");
    
    
g_iMaxPlayers get_maxplayers();
}

public 
PlayerHurt(iVictimiInflictoriAttackerFloat:fDamageiDmgbits)
{
    if(!
IsPlayer(iAttacker))
        return 
HAM_IGNORED;
        
    if(
cs_get_user_team(iAttacker) != CS_TEAM_CT)
        return 
HAM_IGNORED;
        
    if(
cs_get_user_team(iVictim) == cs_get_user_team(iAttacker))
        return 
HAM_IGNORED;
    
    if(
get_user_weapon(iAttacker) != CSW_KNIFE)
        return 
HAM_IGNORED;
    
    
SetHamParamFloat(40.0);
    
    return 
HAM_OVERRIDE;


Should work just fine havnt tested.

Changed the get user team so that it would only work if victim is a ct and not a teammate.


All times are GMT -4. The time now is 01:11.

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