Raised This Month: $51 Target: $400
 12% 

[SOLVED] Needed better Idea for getting attacker weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 01-02-2014 , 07:06   [SOLVED] Needed better Idea for getting attacker weapon
Reply With Quote #1

hii all, i need some good suggestions & better way or new idea.... as i m wanted to give points as per specific weapon kills...

sooo is there any new idea to detect weapons....soo plugin can use low cpu usage...

if simple lang i dont want to use if that attacker has this or that weapon..


PHP Code:
public Event_Dead()
{
    new 
iKiller read_data(1);
    new 
iVictim read_data(2);
    new 
iHskill read_data(3);
    new 
weaponHitPoint get_user_attacker(iVictimweaponHitPoint);
    
    if(
weapon == CSW_KNIFE)
    {
        
// my points
    
}
    
    if(
weapon == CSW_M4A1)
    {
        if(
iHskill)
        {
            
// my points
        
}
        else
        {
            
// my points
        
}
    }
    
    if(
weapon == CSW_AK47)
    {
        if(
iHskill)
        {
            
// my points
        
}
        else
        {
            
// my points
        
}
    }
    
    if(
weapon == CSW_AWP)
    {
        if(
iHskill)
        {
            
// my points
        
}
        else
        {
            
// my points
        
}
    }
    
    if(
weapon == CSW_SCOUT)
    {
        if(
iHskill)
        {
            
// my points
        
}
        else
        {
            
// my points
        
}
    }
    
    if(
weapon == CSW_DEAGLE)
    {
        if(
iHskill)
        {
            
// my points
        
}
        else
        {
            
// my points
        
}
    }

__________________
All my work is here

Last edited by xxxperts; 01-27-2014 at 10:27.
xxxperts is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 01-02-2014 , 07:43   Re: Needed better Idea for getting attacker weapon
Reply With Quote #2

You can check the victim was killed by weapon of the attacker like this:

PHP Code:
new iWeapon[32]
read_data(4iWeaponsizeof iWeapon)

client_print(iKillerprint_chat"%s"iWeapon
__________________
What are you looking for here?
DavidJr is offline
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 01-02-2014 , 07:57   Re: Needed better Idea for getting attacker weapon
Reply With Quote #3

bro i wanted to give points on that weapon then how...???
__________________
All my work is here
xxxperts is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 01-02-2014 , 09:19   Re: Needed better Idea for getting attacker weapon
Reply With Quote #4

What do you mean points for weapon?
__________________
What are you looking for here?
DavidJr is offline
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 01-02-2014 , 11:49   Re: Needed better Idea for getting attacker weapon
Reply With Quote #5

i am creating xp / points system plugin ... i want to give points on specific weapons i had used that above give my code but i need better one..
__________________
All my work is here
xxxperts is offline
BlueGaming
BANNED
Join Date: Nov 2013
Old 01-03-2014 , 05:47   Re: Needed better Idea for getting attacker weapon
Reply With Quote #6

Show here code
BlueGaming is offline
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 01-03-2014 , 05:57   Re: Needed better Idea for getting attacker weapon
Reply With Quote #7

code is show above ....
__________________
All my work is here
xxxperts is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 01-03-2014 , 18:45   Re: Needed better Idea for getting attacker weapon
Reply With Quote #8

Store your preset points for kills in an array ( corresponding with the CSW constants ), then retrieve the used weapon's name with read_data( 4 ), formatting it and converting it back to it's CSW constant, and then get the points value from the array.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 01-04-2014 , 00:44   Re: Needed better Idea for getting attacker weapon
Reply With Quote #9

i didn't got this can show one example...plz
__________________
All my work is here
xxxperts is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-04-2014 , 07:00   Re: Needed better Idea for getting attacker weapon
Reply With Quote #10

long way without csx


easy way with csx module (RECOMMANDED)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 18:14.


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