Raised This Month: $ Target: $400
 0% 

Why doesn't this work?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-13-2012 , 08:44   Why doesn't this work?
Reply With Quote #1

if(iWeapon == CSW_HEGRENADE) {
iAchLevel[read_data(1)][GRENADE]++
}

new iClip, iAmmo, iWeapon = get_user_weapon(read_data(1), iClip, iAmmo)
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-13-2012 , 09:36   Re: Why doesn't this work?
Reply With Quote #2

Could explain what it doesn't work and giving the context (more code) ? People are not clairvoyant.
__________________
Arkshine is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 06-13-2012 , 10:00   Re: Why doesn't this work?
Reply With Quote #3

Eh... it should work...
__________________
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-13-2012 , 10:53   Re: Why doesn't this work?
Reply With Quote #4

PHP Code:
enum _:iAchCount {
    
DIES,
    
SPRAYS,
    
KILLS,
    
CONNECT,
    
HEADSHOT,
    
KNIFE,
    
DISTANCE,
    
SURVIVE,
    
GRENADE,
    
USP,
    
GLOCK,
    
SNEAKY
}

new const 
iAchPoints[iAchCount] = {
    
500,
    
1000,
    
1000,
    
500,
    
500,
    
100,
    
3,
    
100,
    
50,
    
250,
    
250,
    
100

PHP Code:
new iAchLevel[MaxPlayers][iAchCount
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-13-2012 , 11:32   Re: Why doesn't this work?
Reply With Quote #5

You don't explain what is the problem.
__________________
Arkshine is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 06-13-2012 , 11:58   Re: Why doesn't this work?
Reply With Quote #6

IIRC 'nades are handled differently as weapons than others. They are thrown, damage dealing, entities. And should be treated as such. unless that's just hamsandwich....

EDIT: You're missing plugin_init()
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 06-13-2012 at 12:20.
Liverwiz is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-13-2012 , 12:01   Re: Why doesn't this work?
Reply With Quote #7

Quote:
Originally Posted by Liverwiz View Post
IIRC 'nades are handled differently as weapons than others. They are thrown, damage dealing, entities. And should be treated as such. unless that's just hamsandwich....
It depends what grenade entity you are talking about.
And that doesn't have anything to do with the CSW_HEGRENADE constant.
OP has not given enough information to know what the problem is about.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-13-2012 , 12:54   Re: Why doesn't this work?
Reply With Quote #8

If i kill someone with a HE GRENADE it's not counting up my achievement. I'm using DeathMsg Event
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 06-13-2012 , 12:56   Re: Why doesn't this work?
Reply With Quote #9

Show your function code.
__________________
<VeCo> is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-13-2012 , 12:57   Re: Why doesn't this work?
Reply With Quote #10

PHP Code:
public eDeath() {
    new 
iClipiAmmoiWeapon get_user_weapon(read_data(1), iClipiAmmo)
    
    if(
is_user_alive(read_data(1))) {
        
iAchLevel[read_data(1)][KILLS]++
    }
    
    if(
read_data(3)) {
        
iAchLevel[read_data(1)][HEADSHOT]++
    }
    
    if(
iWeapon == CSW_KNIFE) {
        
iAchLevel[read_data(1)][KNIFE]++
    }
    
    if(
iWeapon == CSW_HEGRENADE) {
        
iAchLevel[read_data(1)][GRENADE]++
    }
    
    if(
iWeapon == CSW_USP) {
        
iAchLevel[read_data(1)][USP]++
    }
    
    if(
iWeapon == CSW_GLOCK18) {
        
iAchLevel[read_data(1)][GLOCK]++
    }
    
    if(
get_user_weapon(read_data(2)) == CSW_AWP && iWeapon == CSW_KNIFE) {
        
iAchLevel[read_data(1)][SNEAKY]++
    }
    
    
iAchLevel[read_data(2)][DIES]++

__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 06:16.


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