Raised This Month: $32 Target: $400
 8% 

Solved [L4D2] Tank Spawn Announcement with sound (versus)


Post New Thread Reply   
 
Thread Tools Display Modes
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 01-29-2021 , 13:02   Re: [L4D2] Tank Spawn Announcement with sound (versus)
Reply With Quote #11

Yeah what I mean is that if no proper checks are made, is possible to crash the server. (like deleting the entity after X seconds to prevent No Free Edicts)
__________________
Marttt is offline
King_OXO
Senior Member
Join Date: Dec 2020
Location: Brazil
Old 01-29-2021 , 15:38   Re: [L4D2] Tank Spawn Announcement with sound (versus)
Reply With Quote #12

Quote:
Originally Posted by Marttt View Post
Yeah what I mean is that if no proper checks are made, is possible to crash the server. (like deleting the entity after X seconds to prevent No Free Edicts)
OK, got it

sorry for making you waste your time
King_OXO is offline
Tank Rush
Senior Member
Join Date: May 2019
Location: Argentina
Old 01-29-2021 , 18:17   Re: [L4D2] Tank Spawn Announcement with sound (versus)
Reply With Quote #13

Hi Marttt, I have noticed that when the Tank bot spawns the tank ad appears in the chat, a few seconds pass, the player takes control of the tank and the chat ad appears again, it should appear once.
__________________
Sorry i don't speak english very well

--->My name is Source and I'm on Steam<---
Discord: Source#9382
Tank Rush is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 01-29-2021 , 19:14   Re: [L4D2] Tank Spawn Announcement with sound (versus)
Reply With Quote #14

@TankRush, well try this one attached.

If it doesn't work you can try the one that Zonemod uses here.

Also in finales, it may work only for the first tank I think.

I didn't find a way to know when a tank passes the control from the last time I tried.
Attached Files
File Type: sp Get Plugin or Get Source (tankspawn_sound_n_chat.sp - 106 views - 3.7 KB)
__________________

Last edited by Marttt; 01-29-2021 at 19:15.
Marttt is offline
Tank Rush
Senior Member
Join Date: May 2019
Location: Argentina
Old 01-29-2021 , 20:49   Re: [L4D2] Tank Spawn Announcement with sound (versus)
Reply With Quote #15

Quote:
Originally Posted by Marttt View Post
@TankRush, well try this one attached.

If it doesn't work you can try the one that Zonemod uses here.

Also in finales, it may work only for the first tank I think.

I didn't find a way to know when a tank passes the control from the last time I tried.
Your plugin works, the problem is in the final maps, it is only announced for the first tank of the first wave, but in the other waves it is no longer announced.

The Zonemod version does not emit sound, neither does the {red} color work
__________________
Sorry i don't speak english very well

--->My name is Source and I'm on Steam<---
Discord: Source#9382
Tank Rush is offline
Tank Rush
Senior Member
Join Date: May 2019
Location: Argentina
Old 01-30-2021 , 09:49   Re: [L4D2] Tank Spawn Announcement with sound (versus)
Reply With Quote #16

Quote:
Originally Posted by Marttt View Post
Try this.
Sorry to bother you Marttt, but this keeps failing. The ad appears in the first, second and third waves for survivors, I have tested it playing only with bots; but when there is a player on the infected team the ad only appears for the first tank on both teams.
__________________
Sorry i don't speak english very well

--->My name is Source and I'm on Steam<---
Discord: Source#9382
Tank Rush is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 01-30-2021 , 11:39   Re: [L4D2] Tank Spawn Announcement with sound (versus)
Reply With Quote #17

Quote:
Originally Posted by Marttt View Post
Try this.
Try HookEvent "entity_killed"

PHP Code:
HookEvent("entity_killed",        PD_ev_EntityKilled);

public 
Action PD_ev_EntityKilled(Event event, const char[] namebool dontBroadcast)
{
    if (
g_bIsTankAlive && IsPlayerTank(event.GetInt("entindex_killed")))
    {
        
CreateTimer(1.5FindAnyTank_TIMER_FLAG_NO_MAPCHANGE);
    }
}

public 
Action FindAnyTank(Handle timerany client)
{
    if(!
IsTankInGame()){
        
g_bIsTankAlive false;
    }
}

void IsTankInGame(exclude 0)
{
    for (
int i 1<= MaxClientsi++)
        if (
exclude != && IsClientInGame(i) && GetClientTeam(i) == && IsPlayerTank(i) && IsPlayerAlive(i) && !IsIncapacitated(i))
            return 
i;

    return 
0;

__________________

Last edited by HarryPotter; 01-30-2021 at 11:42.
HarryPotter is offline
Tank Rush
Senior Member
Join Date: May 2019
Location: Argentina
Old 01-30-2021 , 13:18   Re: [L4D2] Tank Spawn Announcement with sound (versus)
Reply With Quote #18

Quote:
Originally Posted by HarryPotter View Post
Try HookEvent "entity_killed"

PHP Code:
HookEvent("entity_killed",        PD_ev_EntityKilled);

public 
Action PD_ev_EntityKilled(Event event, const char[] namebool dontBroadcast)
{
    if (
g_bIsTankAlive && IsPlayerTank(event.GetInt("entindex_killed")))
    {
        
CreateTimer(1.5FindAnyTank_TIMER_FLAG_NO_MAPCHANGE);
    }
}

public 
Action FindAnyTank(Handle timerany client)
{
    if(!
IsTankInGame()){
        
g_bIsTankAlive false;
    }
}

void IsTankInGame(exclude 0)
{
    for (
int i 1<= MaxClientsi++)
        if (
exclude != && IsClientInGame(i) && GetClientTeam(i) == && IsPlayerTank(i) && IsPlayerAlive(i) && !IsIncapacitated(i))
            return 
i;

    return 
0;

I'm sorry, I don't know how to do it
you can help?
__________________
Sorry i don't speak english very well

--->My name is Source and I'm on Steam<---
Discord: Source#9382
Tank Rush is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 01-30-2021 , 18:48   Re: [L4D2] Tank Spawn Announcement with sound (versus)
Reply With Quote #19

Testing in my local server, the previous script work in coop and in versus (with 1 player). When there is more than 1 player (and in different teams) the plugin stops to work in versus after first spawn (weird).

I rewrote the plugin, try this:

Spoiler
Attached Files
File Type: sp Get Plugin or Get Source (tankspawn_sound_n_chat.sp - 191 views - 9.0 KB)
__________________

Last edited by Marttt; 01-31-2021 at 10:10.
Marttt is offline
Tank Rush
Senior Member
Join Date: May 2019
Location: Argentina
Old 01-30-2021 , 21:05   Re: [L4D2] Tank Spawn Announcement with sound (versus)
Reply With Quote #20

Quote:
Originally Posted by Marttt View Post
Try this:

Spoiler
This works, when compiling it gives 3 warnings, anyway I will be checking in logs if it presents any errors.
__________________
Sorry i don't speak english very well

--->My name is Source and I'm on Steam<---
Discord: Source#9382
Tank Rush 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 15:20.


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