Raised This Month: $ Target: $400
 0% 

Checking for number of kills


Post New Thread Reply   
 
Thread Tools Display Modes
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-15-2011 , 09:47   Re: Checking for number of kills
Reply With Quote #11

Quote:
Originally Posted by Erox902 View Post
so I could do if(contain(weapon, "knfe") then?
Just check if the string is equal.

Quote:
Originally Posted by matsi View Post
Won't work for grenade kills.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 06-15-2011 , 11:01   Re: Checking for number of kills
Reply With Quote #12

Quote:
Originally Posted by Exolent[jNr] View Post
Just check if the string is equal.



Won't work for grenade kills.
You're right, but what does this topic have to do with grenades? He asked for knife kills?
matsi is offline
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 06-15-2011 , 14:10   Re: Checking for number of kills
Reply With Quote #13

Quote:
Originally Posted by matsi View Post
You're right, but what does this topic have to do with grenades? He asked for knife kills?
Well nothing but still better if he knows that from the beginning
Erox902 is offline
dreamedward
Senior Member
Join Date: Aug 2010
Location: ZombieWorld
Old 06-15-2011 , 16:29   Re: Checking for number of kills
Reply With Quote #14

Quote:
Originally Posted by Erox902 View Post
Code:
#include <amxmodx>
#include <amxmisc>

new KnifeKills[33]

public plugin_init()
{
    register_plugin("KnifeCount" ,"0,1", " AUTHOR")
    register_event("event_DeathMsg", "eventDeath", "a")
}

public eventDeath()
{
    new iAtkr = read_data(1)
    static weapon[20]
    read_data(4, weapon, charsmax(weapon))
    
    if(weapon[iAtkr] == CSW_KNIFE)
    {        KnifeKills[iAtkr] ++
        if(KnifeKills[iAtkr] == 2)
        {
            //do your function
        }
    }
    else
    {
        return PLUGIN_CONTINUE;
    }
    return PLUGIN_HANDLED;
}
Something like this I believe he ment
So this won't work?
dreamedward is offline
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 06-15-2011 , 17:28   Re: Checking for number of kills
Reply With Quote #15

Quote:
Originally Posted by dreamedward View Post
So this won't work?
nope
Quote:
Originally Posted by Exolent[jNr] View Post
Completely wrong.

weapon is a string containing the weapon name.
It is not an array that you would index by a player's index to get the weapon index.

You would need to check if the string is "knife".
ok so I did this and tested:
Code:
static weapon[20] read_data(4, weapon, charsmax(weapon)) if(equal(weapon, "knife"))

but tried to just send a client_print chat msg but it did'nt work :S

Last edited by Erox902; 06-15-2011 at 17:30.
Erox902 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 09:11.


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