AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Money for kill a NPC depend on Team (CT, T) (https://forums.alliedmods.net/showthread.php?t=83686)

Rirre 01-13-2009 15:21

Money for kill a NPC depend on Team (CT, T)
 
Hi,
This works, but there is one problem.
Example:
If im a CT i gain the plusMoney sometimes, and minusMoney with T.

I don't really know the problem...
I want T to gain the plusMoney and CT gain the minusMoney, always to be so.
PHP Code:

new plusMoneyminusMoney

public plugin_init()
{
    
register_plugin("Money for kill NPC""1.0""Rirre")

    
minusMoney register_cvar("amx_minus_money""-100")
    
plusMoney register_cvar("amx_plus_money""100")

    
RegisterHam(Ham_Killed"func_wall""killed")
}

public 
killed(thisididattacker)
{
    new 
players[32], pnumid
    get_players
(playerspnum)
    if (
is_user_connected(id))
    {
        if(!
pev_valid(this))
            return 
HAM_IGNORED

        
new npc[31]
        new 
money

        
if(equal(npc"models/npc.mdl")) {

            for(new 
i=0i<pnumi++) {
            
id players[i]

            if(
cs_get_user_team(id) == CS_TEAM_CT) {
                
money get_pcvar_num(minusMoney)
            }

            if(
cs_get_user_team(id) == CS_TEAM_T) {
                
money get_pcvar_num(plusMoney)
            }
        }
        else
            return 
HAM_HANDLED

        
new attacker[31]
        
get_user_name(idattackerattacker30)
        new 
newmoney cs_get_user_money(idattacker) + money
        cs_set_user_money
(idattackernewmoney1)
    }
    return 
HAM_HANDLED



cs1.7 06-22-2009 15:39

Re: Money for kill a NPC depend on Team (CT, T)
 
interesting ! can someone make this work? cool wit monster mod!:D


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

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