AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Fix one small xp bug (https://forums.alliedmods.net/showthread.php?t=114046)

~Ice*shOt 01-01-2010 14:19

Fix one small xp bug
 
if player is commit suicide this get xp. Why is this bug ?? and what i can fix it ?? plz help :(

xPaw 01-01-2010 14:25

Re: Fix one small xp bug
 
Post all your plugins, will see. =D

matsi 01-01-2010 15:06

Re: Fix one small xp bug
 
Code:
if( killer == victim ) return; //suicide :o

grimvh2 01-01-2010 16:20

Re: Fix one small xp bug
 
or if(!killer) ...

~Ice*shOt 01-01-2010 16:44

Re: Fix one small xp bug
 
i using this:
PHP Code:

if (g_attacker != g_victim


~Ice*shOt 01-03-2010 04:00

Re: Fix one small xp bug
 
who can help me ???!

Doc-Holiday 01-03-2010 04:06

Re: Fix one small xp bug
 
Quote:

Originally Posted by ~Ice*shOt (Post 1041057)
who can help me ???!


Show us your code and we will help ya.

~Ice*shOt 01-03-2010 06:08

Re: Fix one small xp bug
 
I say i using this:

if (g_attacker != g_victim)

grimvh2 01-03-2010 06:25

Re: Fix one small xp bug
 
Just give us the whole code, if you don't want to then don't ask for help.

~Ice*shOt 01-03-2010 09:42

Re: Fix one small xp bug
 
i can post:
PHP Code:

public Ev_DeathMsg()
{
    new 
g_attacker read_data(1)
    new 
g_victim read_data(2)

    if (
g_attacker != g_victim)
    {
        new 
XPGain
        
if (PlayerLevel[g_attacker] < 1)
        {
            
XPGain get_pcvar_num(xp_per_kill)
        }

        else 
        {
            
XPGain get_pcvar_num(xp_per_kill) * PlayerLevel[g_attacker]
        }
        
set_hudmessage(2550500.500.3312.02.0)
        
show_hudmessage(g_attacker"+%i Experience For Kill!"XPGain)
        
PlayerXP[g_attacker] += XPGain
    
}

    if (
get_user_team(g_attacker) == 2)
    {
        
PlayerZombieDeaths[g_victim] += 1
        PlayerZombieKills
[g_attacker] += 1
    
}

    if (
get_user_team(g_attacker) == 1)
    {
        
PlayerHumanDeaths[g_victim] += 1
        PlayerHumanKills
[g_attacker] += 1
    
}
    
LevelUP(g_attacker)




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

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