TroubleInTerroristTown / Public

The game is about a group of "terrorists" who have traitors among them, out to kill everyone who's not a traitor.
https://forums.alliedmods.net/showthread.php?p=2357981
GNU General Public License v3.0
93 stars 38 forks source link

[PR] DrawViewModel #463

Closed Cruze03 closed 4 years ago

Cruze03 commented 4 years ago

Weapons weren't showing when round starts so here is a quick fix. (I'm sorry if done before/ there was something I did wrong)


#define PLUGIN_VERSION      "1.0"

#include <sourcemod>
#include <sdktools>
#include <ttt>

#pragma newdecls required
#pragma semicolon 1

public Plugin myinfo = 
{
    name = "[TTT] Draw view model",
    author = "Cruze",
    description = "Draws viewmodel after TTT roundstarts",
    version = PLUGIN_VERSION,
    url = "http://steamcommunity.com/profiles/76561198132924835"
}

public void TTT_OnRoundStart(int roundid, int innocents, int traitors, int detective)
{
    RequestFrame(DrawViewModelFrame, _);
}

public void DrawViewModelFrame(any data)
{
    for(int client = 1; client <= MaxClients; client++)
    {
        if(!IsClientInGame(client) || !IsPlayerAlive(client))
        {
            continue;
        }
        SetEntProp(client, Prop_Data, "m_bDrawViewmodel", 1);
    }
}
Bara commented 4 years ago

Thanks, we'll take a look at this. 👌 If it works, we add this into noweaponfix.

Cruze03 commented 4 years ago

Sure man! Thanks a lot for the hardwork in this mod!! ❤️

Bara commented 4 years ago

Does this have any negatives effects on dead players?

Cruze03 commented 4 years ago

I don't think so but added just in case!