AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Why doesn't this work? (https://forums.alliedmods.net/showthread.php?t=187448)

Napoleon_be 06-13-2012 08:44

Why doesn't this work?
 
if(iWeapon == CSW_HEGRENADE) {
iAchLevel[read_data(1)][GRENADE]++
}

new iClip, iAmmo, iWeapon = get_user_weapon(read_data(1), iClip, iAmmo)

Arkshine 06-13-2012 09:36

Re: Why doesn't this work?
 
Could explain what it doesn't work and giving the context (more code) ? People are not clairvoyant.

claudiuhks 06-13-2012 10:00

Re: Why doesn't this work?
 
Eh... it should work...

Napoleon_be 06-13-2012 10:53

Re: Why doesn't this work?
 
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


Arkshine 06-13-2012 11:32

Re: Why doesn't this work?
 
You don't explain what is the problem.

Liverwiz 06-13-2012 11:58

Re: Why doesn't this work?
 
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()
:P

Exolent[jNr] 06-13-2012 12:01

Re: Why doesn't this work?
 
Quote:

Originally Posted by Liverwiz (Post 1728028)
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.

Napoleon_be 06-13-2012 12:54

Re: Why doesn't this work?
 
If i kill someone with a HE GRENADE it's not counting up my achievement. I'm using DeathMsg Event

<VeCo> 06-13-2012 12:56

Re: Why doesn't this work?
 
Show your function code.

Napoleon_be 06-13-2012 12:57

Re: Why doesn't this work?
 
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]++




All times are GMT -4. The time now is 06:16.

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