AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Kill people by touching them (with rankstats-support) (https://forums.alliedmods.net/showthread.php?t=92364)

Pinatz 05-14-2009 10:44

Kill people by touching them (with rankstats-support)
 
Hey guys,
I´m having a problem with the statsx-plugin.
I want to get a touch added as a knife kill in the stats from amx.

So actually statsx uses a query like this to see who killed somebody :
PHP Code:

public client_death(killervictimwpnindexhitplaceTK)
{
    
// Bail out if no killer.
    
if (!killer)
        return 
PLUGIN_CONTINUE

    
if (killer != victim)
    { ....... 

Actually the method I use to let people die by touch is not compatible with it because I use user_silentkill and then create a deathmessage.

PHP Code:

public touch(pToucherpTouched) {
    if(
enable && !wait) {
        if(
pToucher && pToucher 33 && is_user_alive(pToucher) && team[pToucher-1] == 1) {
            if (
pTouched && pTouched 33 && is_user_alive(pTouched) && team[pTouched-1] == 0) {
                
score[pToucher-1][0]++
                
score[pToucher-1][1]++
                
score[pTouched-1][2]++
                
                new 
team get_user_team(pToucher)
                if(
team == 1)
                    
points[0]++
                else
                    
points[1]++
                
//set_user_frags(pToucher,get_user_frags(pToucher)+1)
                //cs_set_user_deaths(pTouched,cs_get_user_deaths(pTouched)+1)
                
                
set_msg_block(deathMsg,BLOCK_ONCE
                
set_msg_block(scoreMsg,BLOCK_ONCE)
                
user_silentkill(pTouched)
                
make_deathmsg(pToucher,pTouched,0,"knife")
                
                
entity_set_float(pToucher,EV_FL_frags,float(score[pToucher-1][0]+(score[pToucher-1][3]*UEBERLEBEN)))    
                
apply_scoreboard(pToucher)
                
apply_scoreboard(pTouched)
                
                
update_teamscore()
                
                if(
other_num() == 1)
                    
speed()
            }
        }
    }


Maybe somebody can tell me how I can fix the issue. I appreciate any help :)


Edit :
Maybe "client_damage ( attacker, victim, damage, wpnindex, hitplace, TA )" could help me out of this issue, right?
I could just give 100 dmg and then it should work. I'll try this out :) What´s TA for?
Ah.. its just to query... I cant "give" damage with this :>

The easiest way would be to give 100 dmg from pToucher to pTouched but is there a command to do this?

Pinatz 05-18-2009 04:54

Re: Kill people by touching them (with rankstats-support)
 
Sorry for the double post but is there a way to give 100 dmg with a weapon from one player to the other?
Like a simulated knife-kill. Else the stats won`t work :/
Or maybe a little stats script with a top 15? I need just some routines to save the stats and an snippet that shows how to edit the stats.

Pinatz 05-27-2009 06:01

Re: Kill people by touching them (with rankstats-support)
 
Somebody omniscient here? :>
To write a whole new ranksystem is a little bit too much work if it can be solved as easy as the way would be :grrr:


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

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