AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   help witch advanced vault system by destro (https://forums.alliedmods.net/showthread.php?t=278163)

ipse 01-26-2016 02:12

help witch advanced vault system by destro
 
Hello.
I'm Russian boy.
Help me, please.

I using Advanced Vault System by Destro v 1.5

How to get the kills and deaths of player?

I adding the number of death and kills for player:

PHP Code:

public HamKilled(iVictimiAttacker) {

    if(!
is_user_connected(iVictim) || !is_user_connected(iAttacker)) {
        return 
HAM_IGNORED
    
}

    if(!
iVictim || !iAttacker || iAttacker == iVictim) {
        return 
HAM_IGNORED
    
}
    
    ++
g_EPlayer[iAttacker][EPlayerKill]
    ++
g_EPlayer[iVictim][EPlayerDeath]
    
    return 
HAM_IGNORED


Result: its ok.
The numbers are stored.

PHP Code:

public test(id) {
        
client_print(idprint_chat"Your kills: %d, deaths: %d"g_EPlayer[id][EPlayerKill], g_EPlayer[id][EPlayerKill])


Result: its not ok...

The numbers are equal to zero.


I'm pro eng, xD. I'm sorry. Thanks for help me.

Craxor 01-26-2016 03:23

Re: help witch advanced vault system by destro
 
Can u attach the whole code?

JoaoVieira 01-26-2016 18:45

Re: help witch advanced vault system by destro
 
try this:

PHP Code:

public HamKilled(iVictimiAttacker) {

    if(!
is_user_connected(iVictim) || !is_user_connected(iAttacker)) {
        return 
HAM_IGNORED
    
}

    if(!
iVictim || !iAttacker || iAttacker == iVictim) {
        return 
HAM_IGNORED
    
}
    
    
get_user_frags(iAttacker)
    
get_user_deaths(iVictim)
    
    return 
HAM_IGNORED


and

PHP Code:

public test(id) {
         
        
client_print(idprint_chat"Your kills: %d, deaths: %d"iAttackeriVictim)


If it doesn't work or if it wasn't what do you wanted , tell me

[PS: Im new on this]

wickedd 01-26-2016 19:23

Re: help witch advanced vault system by destro
 
Quote:

Originally Posted by JoaoVieira (Post 2386871)
PHP Code:

public test(id) {
         
        
client_print(idprint_chat"Your kills: %d, deaths: %d"iAttackeriVictim)


If it doesn't work or if it wasn't what do you wanted , tell me

[PS: Im new on this]

@Joao
That will not work.

JoaoVieira 01-27-2016 07:30

Re: help witch advanced vault system by destro
 
like this?

PHP Code:

public HamKilled(iVictimiAttacker) {

    if(!
is_user_connected(iVictim) || !is_user_connected(iAttacker)) {
        return 
HAM_IGNORED
    
}

    if(!
iVictim || !iAttacker || iAttacker == iVictim) {
        return 
HAM_IGNORED
    
}
   
    new 
Attacker[33] = get_user_frags(iAttackeriAttacker32)
    new 
Victim[32] = get_user_frags(iAttackeriVictim31)
    
    return 
HAM_IGNORED


PHP Code:

public test(id) {
         
        
client_print(idprint_chat"Your kills: %d, deaths: %d"AttackerVictim)



wickedd 01-27-2016 11:11

Re: help witch advanced vault system by destro
 
@Joao No
PHP Code:

new Attacker[33] = get_user_frags(iAttackeriAttacker32)
new 
Victim[32] = get_user_frags(iAttackeriVictim31

:arrow:

PHP Code:

new iFrag get_user_fragsiAttacker )  //Get the killer's frags
new iDeath cs_get_user_deathsiAttacker //Get the killer's deaths] 

PHP Code:

client_print(idprint_chat"Your kills: %d, deaths: %d"AttackerVictim

:arrow:

PHP Code:

client_print(idprint_chat"Your kills: %d, deaths: %d"iFragiDeath //Print them in chat 

Now let the op post his code or ask some questions so we can help him. Because I have no idea why he would get the killer's frags and the victim's deaths.

Edit: @Joao After looking at the op post again, he's not trying to get the victims death you are. So I edited my post


All times are GMT -4. The time now is 09:29.

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