Raised This Month: $ Target: $400
 0% 

API Scripting Help What Im I doing wrong? (zombies explode/gib on death)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SyluxLockjaw100
Senior Member
Join Date: Jul 2010
Location: Novaya Russia
Old 10-13-2011 , 03:34   What Im I doing wrong? (zombies explode/gib on death)
Reply With Quote #1

Code:
#include <amxmodx>
#include <hamsandwich>
#include <zp50_core>
    
    
    public plugin_init ()
    {
        register_plugin( "Zombie gib on death", "1.0.0", "SyluxLockjaw100" );
        RegisterHam( Ham_Killed, "player", "Event_PlayerKilled" );
    }   
    
    public fw_PlayerKilled(victim, attacker, shouldgib)
    {
        if (!zp_core_is_zombie(victim))
        SetHamParamInteger(3, 2) // Zombie explodes to gibs
    }
Ok so I want zombies to explode/gib on death,it compiled with no errors and warnings but it doesn't work in game....I'm 100% positive I'm coding it right,can anyone help?

Last edited by MeRcyLeZZ; 10-16-2011 at 17:04. Reason: Use descriptive thread titles...
SyluxLockjaw100 is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 10-13-2011 , 04:31   Re: What Im I doing wrong?
Reply With Quote #2

According to your code, you want to gib everyone who is not a zombie.

Code:
#include <amxmodx> 
#include <hamsandwich> 
#include <zp50_core> 

public plugin_init ()     
{         
       register_plugin( "Zombie gib on death", "1.0.0", "SyluxLockjaw100" );         
       RegisterHam( Ham_Killed, "player", "Event_PlayerKilled" ); 
}             

public fw_PlayerKilled(victim, attacker, shouldgib)     
{         
       if (zp_core_is_zombie(victim))         
             SetHamParamInteger(3, 2) // Zombie explodes to gibs     
}
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
SyluxLockjaw100
Senior Member
Join Date: Jul 2010
Location: Novaya Russia
Old 10-13-2011 , 06:44   Re: What Im I doing wrong?
Reply With Quote #3

Quote:
Originally Posted by NiHiLaNTh View Post
According to your code, you want to gib everyone who is not a zombie.

Code:
#include <amxmodx> 
#include <hamsandwich> 
#include <zp50_core> 

public plugin_init ()     
{         
       register_plugin( "Zombie gib on death", "1.0.0", "SyluxLockjaw100" );         
       RegisterHam( Ham_Killed, "player", "Event_PlayerKilled" ); 
}             

public fw_PlayerKilled(victim, attacker, shouldgib)     
{         
       if (zp_core_is_zombie(victim))         
             SetHamParamInteger(3, 2) // Zombie explodes to gibs     
}
Well really? I want zombies to gib when they die not players who are not zombies,this is weird.

Last edited by SyluxLockjaw100; 10-14-2011 at 22:40.
SyluxLockjaw100 is offline
XINLEI
me too
Join Date: Jun 2011
Location: Colombian Coffee storage
Old 10-13-2011 , 15:28   Re: What Im I doing wrong?
Reply With Quote #4

When you put a "!" at the side of a function you are denying the expression.

if(eat(you)) //if you eat

if(! eat(you)) //if you don't eat
XINLEI 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 00:37.


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