|
Senior Member
|
02-09-2022
, 17:54
Re: [L4D & L4D2] Anti Rush (1.17) [04-Dec-2021]
|
#54
|
Please advise the plugin or sample code as beautiful and not very sharply start throwing a player with special infected if it is rush, some better option than z_spawn.
(or force the Engine forcibly and not noticeably create infected in the player's radius)
found such a code, but it creates an infected behind (sort of)
Rough little way
Spoiler
PHP Code:
void vBossOption(int client, int entity)
{
if (g_bPluginEnabled && g_bPluginEnabled2)
{
if (!g_bBossSpawned)
{
g_bBossSpawned = true;
float flHitPosition[3];
float flPosition[3];
float flAngle[3];
float flVector[3];
GetClientEyePosition(client, flPosition);
GetClientEyeAngles(client, flAngle);
flAngle[0] = -25.0;
GetAngleVectors(flAngle, flAngle, NULL_VECTOR, NULL_VECTOR);
NormalizeVector(flAngle, flAngle);
ScaleVector(flAngle, -1.0);
vCopyVector(flAngle, flVector);
GetVectorAngles(flAngle, flAngle);
Handle hTrace = TR_TraceRayFilterEx(flPosition, flAngle, MASK_SOLID, RayType_Infinite, bTraceRayDontHitSelf, client);
if (TR_DidHit(hTrace))
{
TR_GetEndPosition(flHitPosition, hTrace);
NormalizeVector(flVector, flVector);
ScaleVector(flVector, -40.0);
AddVectors(flHitPosition, flVector, flHitPosition);
if (GetVectorDistance(flHitPosition, flPosition) < 200.0 && GetVectorDistance(flHitPosition, flPosition) > 40.0)
{
vBossSpawner(flHitPosition);
}
}
delete hTrace;
}
else
{
iGetTankCount() > 0 ? (g_bBossDefeated = false) : (g_bBossDefeated = true);
}
if (!g_bBossDefeated)
{
EmitSoundToAll(SOUND_LOCKED, entity);
if (bIsHumanSurvivor(client))
{
bHasTranslationFile() ? PrintToChat(client, "%s %t", ASS_PREFIX01, "BossRequired") : PrintToChat(client, "%s We need to defeat the boss!", ASS_PREFIX01);
}
}
else
{
vEntryMode(entity);
for (int iToucher = 1; iToucher <= MaxClients; iToucher++)
{
if (bIsHumanSurvivor(iToucher))
{
bHasTranslationFile() ? PrintToChat(iToucher, "%s %t", ASS_PREFIX01, "BossDefeated") : PrintToChat(iToucher, "%s The boss has been defeated!", ASS_PREFIX01);
}
}
}
}
}
__________________
-
PHP Code:
public OnClientConnect(int Client) {
KickClient(Client, "sorry");
}
Last edited by Gold Fish; 02-09-2022 at 18:05.
|
|
|
|