AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   (L4D2)Plugin request! Help! I always wondered if the special zombio (https://forums.alliedmods.net/showthread.php?t=319873)

login101 11-24-2019 02:21

(L4D2)Plugin request! Help! I always wondered if the special zombio
 
1 Attachment(s)
Bot Special zombies Can you make it to the Survivor Arrival Point Safe Door?



Please let the bot zombie open the door. Can I add it? :wink:

I'm weak in English .. I'm sorry


ai Special zombies Please open the door!


Special zombie
Let me open the door to the survivor's safety.

BHaType 11-25-2019 23:55

Re: (L4D2)Plugin request! Help! I always wondered if the special zombio
 
Try this

PHP Code:

#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>

#define CoolDown 0.5
#define MAXDISTANCE 60.0

float g_flTime[MAXPLAYERS 1];

public 
void OnMapEnd()
{
    for (
int i 1<= MaxClientsi++)
        
g_flTime[i] = 0.0;
}

public 
Action OnPlayerRunCmd(int clientint &buttons)
{
    if (
GetClientTeam(client) != || !IsPlayerAlive(client) || !(buttons IN_ATTACK2) || GetGameTime() - g_flTime[client] < CoolDown)
        return;
        
    
int iTarget GetClientAimTarget(clientfalse);
    
    if (
iTarget <= MaxClients || GetDistance(clientiTarget) > MAXDISTANCE)
        return;
        
    
char szName[56];
    
GetEntityClassname(iTargetszNamesizeof szName);
    
    if (
StrContains(szName"prop_door_rotating") != -1)
        
AcceptEntityInput(iTarget"Toggle");
        
    
g_flTime[client] = GetGameTime();
}

float GetDistance(int a1int a2)
{
    
float vOrigin[3], vPos[3];
    
    
GetClientEyePosition(a1vOrigin);
    
GetEntPropVector(a2Prop_Send"m_vecOrigin"vPos);
    
    return 
GetVectorDistance(vOriginvPos);



login101 11-27-2019 09:13

Re: (L4D2)Plugin request! Help! I always wondered if the special zombio
 
Quote:

Originally Posted by BHaType (Post 2674517)
Try this

PHP Code:

#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>

#define CoolDown 0.5
#define MAXDISTANCE 60.0

float g_flTime[MAXPLAYERS 1];

public 
void OnMapEnd()
{
    for (
int i 1<= MaxClientsi++)
        
g_flTime[i] = 0.0;
}

public 
Action OnPlayerRunCmd(int clientint &buttons)
{
    if (
GetClientTeam(client) != || !IsPlayerAlive(client) || !(buttons IN_ATTACK2) || GetGameTime() - g_flTime[client] < CoolDown)
        return;
        
    
int iTarget GetClientAimTarget(clientfalse);
    
    if (
iTarget <= MaxClients || GetDistance(clientiTarget) > MAXDISTANCE)
        return;
        
    
char szName[56];
    
GetEntityClassname(iTargetszNamesizeof szName);
    
    if (
StrContains(szName"prop_door_rotating") != -1)
        
AcceptEntityInput(iTarget"Toggle");
        
    
g_flTime[client] = GetGameTime();
}

float GetDistance(int a1int a2)
{
    
float vOrigin[3], vPos[3];
    
    
GetClientEyePosition(a1vOrigin);
    
GetEntPropVector(a2Prop_Send"m_vecOrigin"vPos);
    
    return 
GetVectorDistance(vOriginvPos);



Thank you very much for your help. Um ... Is it possible to open only closed doors? Only open locked doors Open only closed doors


ai I want to open only closed doors.

BHaType 11-27-2019 20:30

Re: (L4D2)Plugin request! Help! I always wondered if the special zombio
 
PHP Code:

#pragma semicolon 1 
#pragma newdecls required 

#include <sourcemod> 
#include <sdktools> 

#define CoolDown 0.5 
#define MAXDISTANCE 60.0 

float g_flTime[MAXPLAYERS 1]; 

public 
void OnMapEnd() 

    for (
int i 1<= MaxClientsi++) 
        
g_flTime[i] = 0.0


public 
Action OnPlayerRunCmd(int clientint &buttons

    if (
GetClientTeam(client) != || !IsPlayerAlive(client) || !(buttons IN_ATTACK2) || GetGameTime() - g_flTime[client] < CoolDown
        return; 
         
    
int iTarget GetClientAimTarget(clientfalse); 
     
    if (
iTarget <= MaxClients || GetDistance(clientiTarget) > MAXDISTANCE
        return; 
         
    
char szName[56]; 
    
GetEntityClassname(iTargetszNamesizeof szName); 
     
    if (
StrContains(szName"prop_door_rotating") != -1
        
AcceptEntityInput(iTarget"Open"); 
         
    
g_flTime[client] = GetGameTime(); 


float GetDistance(int a1int a2

    
float vOrigin[3], vPos[3]; 
     
    
GetClientEyePosition(a1vOrigin); 
    
GetEntPropVector(a2Prop_Send"m_vecOrigin"vPos); 
     
    return 
GetVectorDistance(vOriginvPos); 



login101 11-27-2019 23:26

Re: (L4D2)Plugin request! Help! I always wondered if the special zombio
 
Quote:

Originally Posted by BHaType (Post 2674733)
PHP Code:

#pragma semicolon 1 
#pragma newdecls required 

#include <sourcemod> 
#include <sdktools> 

#define CoolDown 0.5 
#define MAXDISTANCE 60.0 

float g_flTime[MAXPLAYERS 1]; 

public 
void OnMapEnd() 

    for (
int i 1<= MaxClientsi++) 
        
g_flTime[i] = 0.0


public 
Action OnPlayerRunCmd(int clientint &buttons

    if (
GetClientTeam(client) != || !IsPlayerAlive(client) || !(buttons IN_ATTACK2) || GetGameTime() - g_flTime[client] < CoolDown
        return; 
         
    
int iTarget GetClientAimTarget(clientfalse); 
     
    if (
iTarget <= MaxClients || GetDistance(clientiTarget) > MAXDISTANCE
        return; 
         
    
char szName[56]; 
    
GetEntityClassname(iTargetszNamesizeof szName); 
     
    if (
StrContains(szName"prop_door_rotating") != -1
        
AcceptEntityInput(iTarget"Open"); 
         
    
g_flTime[client] = GetGameTime(); 


float GetDistance(int a1int a2

    
float vOrigin[3], vPos[3]; 
     
    
GetClientEyePosition(a1vOrigin); 
    
GetEntPropVector(a2Prop_Send"m_vecOrigin"vPos); 
     
    return 
GetVectorDistance(vOriginvPos); 




thank you!!! You are an angel

login101 11-28-2019 00:08

Re: (L4D2)Plugin request! Help! I always wondered if the special zombio
 
Quote:

Originally Posted by BHaType (Post 2674733)
PHP Code:

#pragma semicolon 1 
#pragma newdecls required 

#include <sourcemod> 
#include <sdktools> 

#define CoolDown 0.5 
#define MAXDISTANCE 60.0 

float g_flTime[MAXPLAYERS 1]; 

public 
void OnMapEnd() 

    for (
int i 1<= MaxClientsi++) 
        
g_flTime[i] = 0.0


public 
Action OnPlayerRunCmd(int clientint &buttons

    if (
GetClientTeam(client) != || !IsPlayerAlive(client) || !(buttons IN_ATTACK2) || GetGameTime() - g_flTime[client] < CoolDown
        return; 
         
    
int iTarget GetClientAimTarget(clientfalse); 
     
    if (
iTarget <= MaxClients || GetDistance(clientiTarget) > MAXDISTANCE
        return; 
         
    
char szName[56]; 
    
GetEntityClassname(iTargetszNamesizeof szName); 
     
    if (
StrContains(szName"prop_door_rotating") != -1
        
AcceptEntityInput(iTarget"Open"); 
         
    
g_flTime[client] = GetGameTime(); 


float GetDistance(int a1int a2

    
float vOrigin[3], vPos[3]; 
     
    
GetClientEyePosition(a1vOrigin); 
    
GetEntPropVector(a2Prop_Send"m_vecOrigin"vPos); 
     
    return 
GetVectorDistance(vOriginvPos); 



Can I add a tank? ㅇㅅㅇ

login101 11-28-2019 01:19

Re: (L4D2)Plugin request! Help! I always wondered if the special zombio
 
Quote:

Originally Posted by BHaType (Post 2674517)
Try this

PHP Code:

#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>

#define CoolDown 0.5
#define MAXDISTANCE 60.0

float g_flTime[MAXPLAYERS 1];

public 
void OnMapEnd()
{
    for (
int i 1<= MaxClientsi++)
        
g_flTime[i] = 0.0;
}

public 
Action OnPlayerRunCmd(int clientint &buttons)
{
    if (
GetClientTeam(client) != || !IsPlayerAlive(client) || !(buttons IN_ATTACK2) || GetGameTime() - g_flTime[client] < CoolDown)
        return;
        
    
int iTarget GetClientAimTarget(clientfalse);
    
    if (
iTarget <= MaxClients || GetDistance(clientiTarget) > MAXDISTANCE)
        return;
        
    
char szName[56];
    
GetEntityClassname(iTargetszNamesizeof szName);
    
    if (
StrContains(szName"prop_door_rotating") != -1)
        
AcceptEntityInput(iTarget"Toggle");
        
    
g_flTime[client] = GetGameTime();
}

float GetDistance(int a1int a2)
{
    
float vOrigin[3], vPos[3];
    
    
GetClientEyePosition(a1vOrigin);
    
GetEntPropVector(a2Prop_Send"m_vecOrigin"vPos);
    
    return 
GetVectorDistance(vOriginvPos);



The multiple rock plugins you shared are really fun !!
Applied to my tank !! 04:37 ~ 06:55
https://youtu.be/qnwum3K8i0g



ThanksThanksThanksThanksThanksThanksThanks


All times are GMT -4. The time now is 04:55.

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