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

[REQ] Problem with Point Mod


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SXJ Team.
Junior Member
Join Date: Jun 2014
Old 09-25-2014 , 17:42   [REQ] Problem with Point Mod
Reply With Quote #1

I have problem, If player suicide, plugin calculate Deaths(Killed) too..

PHP Code:
public DeathMsg()
{
    new 
Killer read_data(1);
    new 
Victim read_data(2);
    
    static 
weapon[20];
    
read_data(4weaponsizeof(weapon) - 1);

    if (
g_Authorized[Killer] && Killer != Victim)
    {
        
g_Data[Killer][Data_Kills]++;
        
g_Data[Killer][Data_Points] += get_pcvar_num(cvar_kill);
        
ColorChat(KillerRED"^4[tExp]^3 Kill^4 +%d"get_pcvar_num(cvar_kill));
        
        if(
read_data(3)) {
            
g_Data[Killer][Data_Points] += get_pcvar_num(cvar_headshot);
            
ColorChat(KillerRED"^4[tExp]^3 HeadShot^4 +%d"get_pcvar_num(cvar_headshot));
        }    
        
g_Sort true;

        
UpdateRank(Killerfalse);
    }
    if (
g_Authorized[Victim])
    {
        
g_Data[Victim][Data_Deaths]++;
        
g_Data[Victim][Data_Points] -= get_pcvar_num(cvar_death);
        
        
ColorChat(VictimRED"^4[tExp]^3 Killed^4 -%d"get_pcvar_num(cvar_death));
        
        
g_Sort true;

        
UpdateRank(Victimfalse);
    }    
        
        if( !
Killer && equalweapon"world") ) {
         
g_Data[Victim][Data_Suicides]++;
        
g_Data[Victim][Data_Points] -= get_pcvar_num(cvar_suicides);
        
        
ColorChat(VictimRED"^4[tExp]^3 Suicide^4 -%d"get_pcvar_num(cvar_suicides));
        
g_Sort true;
        
        
UpdateRank(Victimfalse);
    }    
    
    if( 
contain(weapon"grenade") >= ) {
        
g_Data[Killer][Data_Kills]++;
        
g_Data[Killer][Data_Points] += get_pcvar_num(cvar_smoke);
        
        
ColorChat(KillerRED"^4[tExp]^3 Smoke Kill^4 +%d"get_pcvar_num(cvar_smoke));
        
        
g_Sort true;
        
        
UpdateRank(Killerfalse);
    }

How i can fix this?

Last edited by SXJ Team.; 09-25-2014 at 17:45.
SXJ Team. is offline
Eviatar Mor
Senior Member
Join Date: Jun 2014
Location: israel
Old 09-25-2014 , 17:59   Re: [REQ] Problem with Point Mod
Reply With Quote #2

Quote:
Originally Posted by SXJ Team. View Post
I have problem, If player suicide, plugin calculate Deaths(Killed) too..

PHP Code:
public DeathMsg()
{
    new 
Killer read_data(1);
    new 
Victim read_data(2);
    
    static 
weapon[20];
    
read_data(4weaponsizeof(weapon) - 1);

    if (
g_Authorized[Killer] && Killer != Victim)
    {
        
g_Data[Killer][Data_Kills]++;
        
g_Data[Killer][Data_Points] += get_pcvar_num(cvar_kill);
        
ColorChat(KillerRED"^4[tExp]^3 Kill^4 +%d"get_pcvar_num(cvar_kill));
        
        if(
read_data(3)) {
            
g_Data[Killer][Data_Points] += get_pcvar_num(cvar_headshot);
            
ColorChat(KillerRED"^4[tExp]^3 HeadShot^4 +%d"get_pcvar_num(cvar_headshot));
        }    
        
g_Sort true;

        
UpdateRank(Killerfalse);
    }
    if (
g_Authorized[Victim])
    {
        
g_Data[Victim][Data_Deaths]++;
        
g_Data[Victim][Data_Points] -= get_pcvar_num(cvar_death);
        
        
ColorChat(VictimRED"^4[tExp]^3 Killed^4 -%d"get_pcvar_num(cvar_death));
        
        
g_Sort true;

        
UpdateRank(Victimfalse);
    }    
        
        if( !
Killer && equalweapon"world") ) {
         
g_Data[Victim][Data_Suicides]++;
        
g_Data[Victim][Data_Points] -= get_pcvar_num(cvar_suicides);
        
        
ColorChat(VictimRED"^4[tExp]^3 Suicide^4 -%d"get_pcvar_num(cvar_suicides));
        
g_Sort true;
        
        
UpdateRank(Victimfalse);
    }    
    
    if( 
contain(weapon"grenade") >= ) {
        
g_Data[Killer][Data_Kills]++;
        
g_Data[Killer][Data_Points] += get_pcvar_num(cvar_smoke);
        
        
ColorChat(KillerRED"^4[tExp]^3 Smoke Kill^4 +%d"get_pcvar_num(cvar_smoke));
        
        
g_Sort true;
        
        
UpdateRank(Killerfalse);
    }

How i can fix this?
Please post all the plugin !
Eviatar Mor is offline
SXJ Team.
Junior Member
Join Date: Jun 2014
Old 09-25-2014 , 18:28   Re: [REQ] Problem with Point Mod
Reply With Quote #3

No Needed.
SXJ Team. is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 09-25-2014 , 18:33   Re: [REQ] Problem with Point Mod
Reply With Quote #4

You know enough about coding that you can pull the death event and say we don't need the full code but not enough to change the code itself?
Change the block of code that adds deaths to suicide to not subtract for it. (though I don't see why it matters. If you die by an enemy or you kill yourself, it is still a death and should count.)

PHP Code:
   if( !Killer && equalweapon"world") ) {
         
g_Data[Victim][Data_Suicides]++;
        
g_Data[Victim][Data_Points] -= get_pcvar_num(cvar_suicides);
        
        
ColorChat(VictimRED"^4[tExp]^3 Suicide^4 -%d"get_pcvar_num(cvar_suicides));
        
g_Sort true;
        
        
UpdateRank(Victimfalse); 
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
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:21.


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