Raised This Month: $ Target: $400
 0% 

Help my friends =0 ?


Post New Thread Reply   
 
Thread Tools Display Modes
TribalBlood
Member
Join Date: Oct 2020
Location: Defqon.1
Old 07-19-2022 , 20:53   Re: Help my friends =0 ?
Reply With Quote #11

Solved by menkisa.
__________________

Last edited by TribalBlood; 07-19-2022 at 20:58.
TribalBlood is offline
C0DY2K
Junior Member
Join Date: Jul 2022
Old 07-20-2022 , 19:00   Re: Help my friends =0 ?
Reply With Quote #12

Thank you all, Tribal Blood, menkisa, I am very grateful to you.

=))
C0DY2K is offline
C0DY2K
Junior Member
Join Date: Jul 2022
Old 07-20-2022 , 20:02   Re: Help my friends =0 ?
Reply With Quote #13

Quote:
Originally Posted by menkisa View Post
Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>
#include <hamsandwich>
#include <cstrike>

#define TASK_TRAIL 3214
#define ID_TRAIL (taskid - TASK_TRAIL)

new const g_szGodSound[] = "buttons/blip2.wav";
new Trail, p_attacker_kills[33];


public plugin_precache()
{
    register_event("DeathMsg", "Kill_Handler", "a");
    RegisterHam(Ham_Spawn, "player", "Reset_Kills", 1);
    Trail = precache_model("sprites/lgtning.spr");
    precache_sound(g_szGodSound);
}

public Reset_Kills(id)
{
    if(is_user_alive(id))
    {
        p_attacker_kills[id] = 0;
        set_user_godmode(id, 0);
        set_user_rendering(id);
        Kill_Trail(id);
        remove_task(id+TASK_TRAIL);
    }
}

public Kill_Handler()
{
    new Attacker = read_data(1), Victim = read_data(2);

    p_attacker_kills[Attacker] += 1;

    if(p_attacker_kills[Attacker] >= 3)
    {
        p_attacker_kills[Attacker] = 0;
        set_user_godmode(Attacker, 1);
        switch(cs_get_user_team(Attacker))
        {
            case CS_TEAM_CT:
            {
                set_user_rendering(Attacker, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 1);
            }
            case CS_TEAM_T:
            {
                set_user_rendering(Attacker, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 1);
            }
        }
        client_print(Attacker, print_center, "You received invincible powers.");
        emit_sound(Attacker, CHAN_AUTO, g_szGodSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
        set_task(0.1, "Make_Trail", Attacker+TASK_TRAIL, _, _, "b");
        set_task(10.0, "Remove_Trail", Attacker);
    }

    if(task_exists(Victim+TASK_TRAIL))
    {
        Remove_Trail(Victim);
    }
}

public Make_Trail(taskid)
{
    message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
    write_byte(22);
    write_short(ID_TRAIL);
    write_short(Trail);
    write_byte(5);
    write_byte(3);
    write_byte(random_num(1, 255));
    write_byte(random_num(1, 255));
    write_byte(random_num(1, 255));
    write_byte(255);
    message_end();
}

public Remove_Trail(Attacker)
{
    remove_task(Attacker+TASK_TRAIL);
    Kill_Trail(Attacker);
    set_user_godmode(Attacker, 0);
    set_user_rendering(Attacker);
}

public Kill_Trail(Attacker)
{
    message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
    write_byte(99);
    write_short(Attacker);
    message_end();
}

could you make a correction?

Can you activate the plugin only when the player kills 3 with a knife?

it is activating when it kills in the weapon.
C0DY2K is offline
menkisa
Junior Member
Join Date: Sep 2011
Old 07-20-2022 , 21:00   Re: Help my friends =0 ?
Reply With Quote #14

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>
#include <hamsandwich>
#include <cstrike>

#define TASK_TRAIL 3214
#define ID_TRAIL (taskid - TASK_TRAIL)

new const g_szGodSound[] = "buttons/blip2.wav";
new 
Trailp_attacker_kills[33];


public 
plugin_precache()
{
    
register_event("DeathMsg""Kill_Handler""a");
    
RegisterHam(Ham_Spawn"player""Reset_Kills"1);
    
Trail precache_model("sprites/lgtning.spr");
    
precache_sound(g_szGodSound);
}

public 
Reset_Kills(id)
{
    if(
is_user_alive(id))
    {
        
p_attacker_kills[id] = 0;
        
set_user_godmode(id0);
        
set_user_rendering(id);
        
Kill_Trail(id);
        
remove_task(id+TASK_TRAIL);
    }
}

public 
Kill_Handler()
{
    new 
Attacker read_data(1), Victim read_data(2), szWeapon[12];
    
read_data(4szWeaponcharsmax(szWeapon));
    new 
iWeaponId get_weaponid(szWeapon)

    if(
iWeaponId == CSW_KNIFE)
        
p_attacker_kills[Attacker] += 1;

    if(
p_attacker_kills[Attacker] >= 3)
    {
        
p_attacker_kills[Attacker] = 0;
        
set_user_godmode(Attacker1);
        switch(
cs_get_user_team(Attacker))
        {
            case 
CS_TEAM_CT:
            {
                
set_user_rendering(AttackerkRenderFxGlowShell00255kRenderNormal1);
            }
            case 
CS_TEAM_T:
            {
                
set_user_rendering(AttackerkRenderFxGlowShell25500kRenderNormal1);
            }
        }
        
client_print(Attackerprint_center"You received invincible powers.");
        
emit_sound(AttackerCHAN_AUTOg_szGodSoundVOL_NORMATTN_NORM0PITCH_NORM);
        
set_task(0.1"Make_Trail"Attacker+TASK_TRAIL__"b");
        
set_task(10.0"Remove_Trail"Attacker);
    }

    if(
task_exists(Victim+TASK_TRAIL))
    {
        
Remove_Trail(Victim);
    }
}

public 
Make_Trail(taskid)
{
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
    
write_byte(22);
    
write_short(ID_TRAIL);
    
write_short(Trail);
    
write_byte(5);
    
write_byte(3);
    
write_byte(random_num(1255));
    
write_byte(random_num(1255));
    
write_byte(random_num(1255));
    
write_byte(255);
    
message_end();
}

public 
Remove_Trail(Attacker)
{
    
remove_task(Attacker+TASK_TRAIL);
    
Kill_Trail(Attacker);
    
set_user_godmode(Attacker0);
    
set_user_rendering(Attacker);
}

public 
Kill_Trail(Attacker)
{
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
    
write_byte(99);
    
write_short(Attacker);
    
message_end();

Here you go
menkisa is offline
C0DY2K
Junior Member
Join Date: Jul 2022
Old 07-21-2022 , 07:33   Re: Help my friends =0 ?
Reply With Quote #15

Quote:
Originally Posted by menkisa View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>
#include <hamsandwich>
#include <cstrike>

#define TASK_TRAIL 3214
#define ID_TRAIL (taskid - TASK_TRAIL)

new const g_szGodSound[] = "buttons/blip2.wav";
new 
Trailp_attacker_kills[33];


public 
plugin_precache()
{
    
register_event("DeathMsg""Kill_Handler""a");
    
RegisterHam(Ham_Spawn"player""Reset_Kills"1);
    
Trail precache_model("sprites/lgtning.spr");
    
precache_sound(g_szGodSound);
}

public 
Reset_Kills(id)
{
    if(
is_user_alive(id))
    {
        
p_attacker_kills[id] = 0;
        
set_user_godmode(id0);
        
set_user_rendering(id);
        
Kill_Trail(id);
        
remove_task(id+TASK_TRAIL);
    }
}

public 
Kill_Handler()
{
    new 
Attacker read_data(1), Victim read_data(2), szWeapon[12];
    
read_data(4szWeaponcharsmax(szWeapon));
    new 
iWeaponId get_weaponid(szWeapon)

    if(
iWeaponId == CSW_KNIFE)
        
p_attacker_kills[Attacker] += 1;

    if(
p_attacker_kills[Attacker] >= 3)
    {
        
p_attacker_kills[Attacker] = 0;
        
set_user_godmode(Attacker1);
        switch(
cs_get_user_team(Attacker))
        {
            case 
CS_TEAM_CT:
            {
                
set_user_rendering(AttackerkRenderFxGlowShell00255kRenderNormal1);
            }
            case 
CS_TEAM_T:
            {
                
set_user_rendering(AttackerkRenderFxGlowShell25500kRenderNormal1);
            }
        }
        
client_print(Attackerprint_center"You received invincible powers.");
        
emit_sound(AttackerCHAN_AUTOg_szGodSoundVOL_NORMATTN_NORM0PITCH_NORM);
        
set_task(0.1"Make_Trail"Attacker+TASK_TRAIL__"b");
        
set_task(10.0"Remove_Trail"Attacker);
    }

    if(
task_exists(Victim+TASK_TRAIL))
    {
        
Remove_Trail(Victim);
    }
}

public 
Make_Trail(taskid)
{
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
    
write_byte(22);
    
write_short(ID_TRAIL);
    
write_short(Trail);
    
write_byte(5);
    
write_byte(3);
    
write_byte(random_num(1255));
    
write_byte(random_num(1255));
    
write_byte(random_num(1255));
    
write_byte(255);
    
message_end();
}

public 
Remove_Trail(Attacker)
{
    
remove_task(Attacker+TASK_TRAIL);
    
Kill_Trail(Attacker);
    
set_user_godmode(Attacker0);
    
set_user_rendering(Attacker);
}

public 
Kill_Trail(Attacker)
{
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
    
write_byte(99);
    
write_short(Attacker);
    
message_end();

Here you go
Thank you menkisa, congratulations =)

can you answer my last request ^^

If possible, once the plugin is activated, the player will be faster than usual.

You can ?
C0DY2K is offline
Reply


Thread Tools
Display Modes

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 11:06.


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