Quote:
Originally Posted by Mortiegama
It can theoretically be done. I'd need to suppress the director and then lottery pick a player to become tank. They'd have the SI ghost but when they spawn it would become a Tank.
|
I actually just did this for Tank Rush with the help of Infected Spawn API.
Here's a the bit of code you'll need to change someone from tank to ghost and keep them in the same spot:
PHP Code:
new m_vecVelocity0 = FindSendPropInfo("CTerrorPlayer", "m_vecVelocity[0]");
decl Float:AbsOrigin[3];
decl Float:EyeAngles[3];
decl Float:Velocity[3];
GetClientAbsOrigin(client,AbsOrigin);
GetClientEyeAngles(client,EyeAngles);
Velocity[0] = GetEntDataFloat(client,m_vecVelocity0);
Velocity[1] = GetEntDataFloat(client,m_vecVelocity0 + 4);
Velocity[2] = GetEntDataFloat(client,m_vecVelocity0 + 8);
new m_isCulling = FindSendPropInfo("CTerrorPlayer","m_isCulling");
SetEntData(client,m_isCulling,1,1);
SDKCall(g_hZombieAbortControl,client,0.0);
TeleportEntity(client, AbsOrigin, EyeAngles, Velocity);
And you'll need this in the gamedata file (which is used in the SDKCall above):
Code:
"Games"
{
"left4dead2"
{
"Signatures"
{
"ZombieAbortControl"
{
"library" "server"
"windows" "\x55\x8b\xec\x83\xec*\x56\x8b\xf1\xe8****\x83\xf8*\x0f\x85****\x8b\x06\x8b\x90***\x00\x8b\xce\xff\xd2\x84\xc0"
"linux" "@_ZN13CTerrorPlayer24PlayerZombieAbortControlEv"
}
}
}
}
You can actually use that bit of code on the player_spawn event and check if they're a non-bot tank, then turn them into a ghost.
The only problem I had (which may be unique to Tank Rush) is if another tank spawns the ghost tank will still be a candidate to take control of that tank. Shouldn't be a problem in a regular versus server though.