added SharedPlugin code and SetNTVOptional()
added public printing for zr_human, zr_infect and zr_zspawn_force command fixed zombiereloaded changing player colors updated sample cfg updated makefile
This commit is contained in:
@ -284,8 +284,7 @@ InfectOnClientSpawn(client)
|
||||
CS_RespawnPlayer(client);
|
||||
}
|
||||
|
||||
// Unglitch kevlar. (Reset hitbox to HITBOX_GENERIC)
|
||||
SetEntData(client, 4444, 0, 4);
|
||||
InfectUnglitchKevlar(client);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -875,8 +874,7 @@ InfectZombieToHuman(client, bool:respawn = false, bool:protect = false)
|
||||
SpawnProtectStart(client);
|
||||
}
|
||||
|
||||
// Unglitch kevlar. (Reset hitbox to HITBOX_GENERIC)
|
||||
SetEntData(client, 4444, 0, 4);
|
||||
InfectUnglitchKevlar(client);
|
||||
|
||||
// Forward event to modules.
|
||||
SEffectsOnClientHuman(client);
|
||||
@ -1185,6 +1183,13 @@ stock InfectManualInfect(client, targets[], count, bool:respawnoverride = false,
|
||||
}
|
||||
|
||||
decl String:targetname[MAX_NAME_LENGTH];
|
||||
decl String:adminname[MAX_NAME_LENGTH];
|
||||
|
||||
// Get admin's name for later use.
|
||||
if(client > 0)
|
||||
GetClientName(client, adminname, sizeof(adminname));
|
||||
else
|
||||
strcopy(adminname, sizeof(adminname), "Console");
|
||||
|
||||
// x = Client index.
|
||||
for (new x = 0; x < count; x++)
|
||||
@ -1211,6 +1216,7 @@ stock InfectManualInfect(client, targets[], count, bool:respawnoverride = false,
|
||||
// Turn client into a mother zombie.
|
||||
InfectHumanToZombie(targets[x], _, true, respawnoverride, respawn);
|
||||
LogAction(client, targets[x], "\"%L\" turned \"%L\" into a mother zombie", client, targets[x]);
|
||||
TranslationPrintToChatAll(false, false, "Infect command infect mother successful public", adminname, targetname);
|
||||
|
||||
// If there was only 1 player targetted, then let admin know the outcome of the command.
|
||||
if (count == 1)
|
||||
@ -1224,6 +1230,7 @@ stock InfectManualInfect(client, targets[], count, bool:respawnoverride = false,
|
||||
// Turn client into a zombie.
|
||||
InfectHumanToZombie(targets[x], _, false, respawnoverride, respawn);
|
||||
LogAction(client, targets[x], "\"%L\" turned \"%L\" into a zombie", client, targets[x]);
|
||||
TranslationPrintToChatAll(false, false, "Infect command infect successful public", adminname, targetname);
|
||||
|
||||
// If there was only 1 player targetted, then let admin know the outcome of the command.
|
||||
if (count == 1)
|
||||
@ -1245,6 +1252,13 @@ stock InfectManualInfect(client, targets[], count, bool:respawnoverride = false,
|
||||
stock InfectManualHuman(client, targets[], count, bool:respawn = false, bool:protect = false)
|
||||
{
|
||||
decl String:targetname[MAX_NAME_LENGTH];
|
||||
decl String:adminname[MAX_NAME_LENGTH];
|
||||
|
||||
// Get admin's name for later use.
|
||||
if(client > 0)
|
||||
GetClientName(client, adminname, sizeof(adminname));
|
||||
else
|
||||
strcopy(adminname, sizeof(adminname), "Console");
|
||||
|
||||
// x = Client index.
|
||||
for (new x = 0; x < count; x++)
|
||||
@ -1258,6 +1272,7 @@ stock InfectManualHuman(client, targets[], count, bool:respawn = false, bool:pro
|
||||
// Turn client into a zombie.
|
||||
InfectZombieToHuman(targets[x], respawn, protect);
|
||||
LogAction(client, targets[x], "\"%L\" turned \"%L\" into a human", client, targets[x]);
|
||||
TranslationPrintToChatAll(false, false, "Infect command human successful public", adminname, targetname);
|
||||
|
||||
// If there was only 1 player targetted, then let admin know the outcome of the command.
|
||||
if (count == 1)
|
||||
@ -1486,3 +1501,14 @@ InfectMode:InfectGetModeOrFail()
|
||||
|
||||
return mode;
|
||||
}
|
||||
|
||||
InfectUnglitchKevlar(client)
|
||||
{
|
||||
// Unglitch kevlar. (Reset hitbox to HITBOX_GENERIC)
|
||||
// Example: You get hit in the head by a bullet as a zombie
|
||||
// the round ends, you spawn as a human.
|
||||
// You get damaged by a trigger, the game still thinks you
|
||||
// are getting damaged in the head hitgroup, >mfw source engine.
|
||||
// Thanks to leaked 2007 Source Engine Code.
|
||||
SetEntData(client, 4444, 0, 4);
|
||||
}
|
||||
|
@ -194,8 +194,12 @@ stock ToolsSetClientAlpha(client, alpha)
|
||||
// Turn rendermode on, on the client.
|
||||
SetEntityRenderMode(client, RENDER_TRANSALPHA);
|
||||
|
||||
// Get current client colors.
|
||||
new color[4];
|
||||
ToolsGetEntityColor(client, color);
|
||||
|
||||
// Set alpha value on the client.
|
||||
SetEntityRenderColor(client, _, _, _, alpha);
|
||||
SetEntityRenderColor(client, color[0], color[1], color[2], alpha);
|
||||
|
||||
// Forward event to modules.
|
||||
WeaponAlphaOnClientAlphaChanged(client, alpha);
|
||||
@ -230,3 +234,34 @@ stock ToolsGetEntityAlpha(entity)
|
||||
|
||||
return GetEntData(entity, offset + 3, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an entity's color and alpha.
|
||||
*
|
||||
* @param client The client index.
|
||||
* @param color 4 dimensional array where [r,g,b,a] values are stored
|
||||
*/
|
||||
stock ToolsGetEntityColor(entity, color[4])
|
||||
{
|
||||
static bool:gotconfig = false;
|
||||
static String:prop[32];
|
||||
|
||||
if (!gotconfig)
|
||||
{
|
||||
new Handle:gc = LoadGameConfigFile("core.games");
|
||||
new bool:exists = GameConfGetKeyValue(gc, "m_clrRender", prop, sizeof(prop));
|
||||
CloseHandle(gc);
|
||||
|
||||
if (!exists)
|
||||
{
|
||||
strcopy(prop, sizeof(prop), "m_clrRender");
|
||||
}
|
||||
|
||||
gotconfig = true;
|
||||
}
|
||||
|
||||
new offset = GetEntSendPropOffs(entity, prop);
|
||||
|
||||
for (new i = 0; i < 4; i++)
|
||||
color[i] = GetEntData(entity, offset + i, 1);
|
||||
}
|
||||
|
@ -412,12 +412,18 @@ public Action:ZSpawnForceCommand(client, argc)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
decl String:target[MAX_NAME_LENGTH], String:targetname[MAX_NAME_LENGTH];
|
||||
decl String:target[MAX_NAME_LENGTH], String:targetname[MAX_NAME_LENGTH], String:adminname[MAX_NAME_LENGTH];
|
||||
new targets[MAXPLAYERS], bool:tn_is_ml, result;
|
||||
|
||||
// Get targetname.
|
||||
GetCmdArg(1, target, sizeof(target));
|
||||
|
||||
// Get admin's name for later use.
|
||||
if(client > 0)
|
||||
GetClientName(client, adminname, sizeof(adminname));
|
||||
else
|
||||
strcopy(adminname, sizeof(adminname), "Console");
|
||||
|
||||
// Find a target.
|
||||
result = ProcessTargetString(target, client, targets, sizeof(targets), COMMAND_FILTER_DEAD, targetname, sizeof(targetname), tn_is_ml);
|
||||
|
||||
@ -441,7 +447,12 @@ public Action:ZSpawnForceCommand(client, argc)
|
||||
{
|
||||
// Give client the item.
|
||||
new bool:success = ZSpawnClient(targets[x], true, zombie);
|
||||
LogAction(client, targets[x], "\"%L\" forced a ZSpawn on \"%L\"%s", client, targets[x], zombie ? " and made them zombie" : "");
|
||||
|
||||
if(success)
|
||||
{
|
||||
LogAction(client, targets[x], "\"%L\" forced a ZSpawn on \"%L\"%s", client, targets[x], zombie ? " and made them zombie" : "");
|
||||
TranslationPrintToChatAll(false, false, "ZSpawn command force successful public", adminname, targetname, zombie ? "zombie" : "human");
|
||||
}
|
||||
|
||||
// Tell admin the outcome of the command if only 1 client was targetted.
|
||||
if (result == 1)
|
||||
|
Reference in New Issue
Block a user