AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Solved [L4D2] Tank Spawn Announcement with sound (versus) (https://forums.alliedmods.net/showthread.php?t=330277)

Marttt 01-29-2021 13:02

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
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)

King_OXO 01-29-2021 15:38

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Quote:

Originally Posted by Marttt (Post 2734815)
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

Tank Rush 01-29-2021 18:17

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
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.

Marttt 01-29-2021 19:14

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
1 Attachment(s)
@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.

Tank Rush 01-29-2021 20:49

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Quote:

Originally Posted by Marttt (Post 2734852)
@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

Tank Rush 01-30-2021 09:49

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Quote:

Originally Posted by Marttt (Post 2734868)
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.

HarryPotter 01-30-2021 11:39

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Quote:

Originally Posted by Marttt (Post 2734868)
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;



Tank Rush 01-30-2021 13:18

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Quote:

Originally Posted by HarryPotter (Post 2734956)
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?

Marttt 01-30-2021 18:48

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
1 Attachment(s)
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

Tank Rush 01-30-2021 21:05

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Quote:

Originally Posted by Marttt (Post 2735022)
Try this:

Spoiler

This works, when compiling it gives 3 warnings, anyway I will be checking in logs if it presents any errors.


All times are GMT -4. The time now is 05:32.

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