AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [help] Kill counting problem (https://forums.alliedmods.net/showthread.php?t=173028)

WeeD1986 11-29-2011 07:15

[help] Kill counting problem
 
Hi... I am new to pawn and I have a little problem. The function should take a picture to a blinded player after the 3rd frag done while he was blinded. The thing is that it does not work. Can somebody help me?

PHP Code:

new bool:g_bBlind[33]
new 
gFrags33 ];

public 
hook_death()
{
new 
killer read_data(1);
gFragskiller ]++;

new 
numeserver [64], numeadmin[32],  numeblindat[32], ipcodat [32], admini[33], inummessage[552]


get_user_name(admin[killer], numeadmin31)
get_user_name(killernumeblindat31)
get_user_ip(killeripcodat311)
get_cvar_string("hostname",numeserver,63)

if(
g_bBlind[killer])
{
if (
gFragskiller ] == 3){
    for (new 
0inum; ++i)
    {
        if ( 
access(admini[i],ADMIN_CHAT) )
        {
            
client_print(admini[i],print_chat,"Jucatorul %s a facut 3 fraguri dupa blind-ul dat de %s",killer,admin[killer])
        }
             
        
client_print(killerprint_chat"* Poza facuta pe : %s",numeserver
        
client_print(killerprint_chat"* Nume codat:  ^"%s^" cu IP: %s",numeblindat,ipcodat
        
client_print(killerprint_chat"* Nume admin: ^"%s^"",numeadmin)
        
client_print(killerprint_chat"* Viziteaza %s pentru a face o cerere de UNBAN."poza
        
        
client_cmd(killer,"wait;snapshot"


tuty 11-29-2011 08:45

Re: [help] Kill counting problem
 
try this one [not sure but should work]

PHP Code:


new bool:g_bBlind[33]
new 
gFrags33 ];

public 
hook_death()
{
    new 
killer read_data(1);
    
    if( 
g_bBlind[killer] == true )
    {
        if( ++
gFragskiller ] >= )
        {
            new 
numeserver [64], numeadmin[32],  numeblindat[32], ipcodat [32], admini[33], inummessage[552]
            
            
get_user_name(admin[killer], numeadmincharsmax(numeadmin))
            
get_user_name(killernumeblindatcharsmax(numeblindat))
            
get_user_ip(killeripcodatcharsmax(ipcodat), 1)
            
get_cvar_string("hostname",numeserver,63)
            
            for (new 
0inum; ++i)
            {
                if( 
access(admini[i],ADMIN_CHAT) )
                {
                    
client_print(admini[i],print_chat,"Jucatorul %s a facut 3 fraguri dupa blind-ul dat de %s",killer,admin[killer])
                }
            }
            
            
client_print(killerprint_chat"* Poza facuta pe : %s",numeserver
            
client_print(killerprint_chat"* Nume codat:  ^"%s^" cu IP: %s",numeblindat,ipcodat
            
client_print(killerprint_chat"* Nume admin: ^"%s^"",numeadmin)
            
client_print(killerprint_chat"* Viziteaza %s pentru a face o cerere de UNBAN."poza
                
            
client_cmd(killer,"wait;snapshot");
        }
    }



claudiuhks 11-29-2011 09:14

Re: [help] Kill counting problem
 
You can't make sure a player is blind until he did three kills. Maybe other screen fade will overwrite the currently set one. Or maybe the ResetHUD event.

The screen fades for Half-Life 1 games has other purposes. Don't use them for check the players for hacking.

tuty 11-29-2011 11:24

Re: [help] Kill counting problem
 
Quote:

Originally Posted by claudiuhks (Post 1604622)
You can't make sure a player is blind until he did three kills. Maybe other screen fade will overwrite the currently set one. Or maybe the ResetHUD event.

The screen fades for Half-Life 1 games has other purposes. Don't use them for check the players for hacking.


if it's set to FFADE_MODULATE the screenfade isn't replaced by other screenfade messages, and you see in the code it's a global variable and it's checked when player used blind command, i'm pretty sure this will work 70% :)

and with that variable, you can set it to true, on player spawn, or resethud, until you execute unblind on player and set it to false :)
i'm trying to help :)

WeeD1986 11-29-2011 13:28

Re: [help] Kill counting problem
 
Thank you tuty for helping me! The plugin works great. Glad you're back :D


All times are GMT -4. The time now is 08:33.

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