View Single Post
Darkwob
BANNED
Join Date: Oct 2018
Old 05-27-2021 , 16:19   Re: can someone help me with this?
Reply With Quote #3

Quote:
Originally Posted by Johnny2525 View Post
As far as I know your Events should be Actions

So for example
Your:
Code:
public Event_EnteredSpit (Handle:event, const String:name[], bool:dontBroadcast)
Should be
Code:
public Action:Event_EnteredSpit (Handle:event, const String:name[], bool:dontBroadcast)
Same with other Events you have in your file

With rest of the errors I am sure you can figure it out.
When I got no response from anyone, I asked a friend for help, it solved the problem, there was no problem in the compilation, but the plugin does not work. Spitter's acid doesn't slow Survivor. can you solve this?


this is my friend fixing the problems.
PHP Code:
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1

#define Spitters Sticky Goo
#define PLUGIN_VERSION "2.01"

#define ZOMBIECLASS_SPITTER 4

///Spitter
//Bools
new bool:isSpitter false;
new 
bool:isStickyGoo false;


//Handles
new Handle:cvarSpitter;
new 
Handle:cvarStickyGoo;
new 
Handle:cvarStickyGooDuration;
new 
Handle:cvarStickyGooSpeed;
new 
Handle:cvarStickyGooJump;
new 
Handle:cvarStickyGooTimer[MAXPLAYERS 1] = INVALID_HANDLE;

new 
bool:isSlowed[MAXPLAYERS+1] = false;
static const 
JUMPFLAG IN_JUMP;
static 
laggedMovementOffset 0;
static 
velocityModifierOffset 0;
new 
bool:isAnnounce true;

//Plugins İnformations
public Plugin:myinfo =
{
    
name "Sticky Goo",
    
author "DarkWob",
    
description "Slow Acid",
    
version PLUGIN_VERSION,
    
url ""
}

public 
OnPluginStart()
{

    
//we setup everything that we need for the Spitter
    
HookEvent("entered_spit"Event_EnteredSpit);

    
CreateConVar("sticky_goo_version"PLUGIN_VERSION"Sticky Goo"FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
cvarStickyGoo CreateConVar("l4d_stickygoo""1""Slows down Survivor when standing in spit. (Def 1)"FCVAR_NOTIFYtrue0.0false_);
    
cvarStickyGooDuration CreateConVar("l4d_stickygooduration""6""How long a Survivor is slowed for aftering entering spit. (Def 6)"FCVAR_NOTIFYtrue1.0false_);
    
cvarStickyGooSpeed CreateConVar("l4d_stickygoospeed""0.5""Speed reduction to Survivor. (Def 0.5)"FCVAR_NOTIFYtrue0.0false_);
    
cvarStickyGooJump CreateConVar("l4d_stickygoojump""1""Speed reduction to Survivor jumping. (Def 1)"FCVAR_NOTIFYtrue0.0false_);

    
laggedMovementOffset FindSendPropInfo("CTerrorPlayer""m_flLaggedMovementValue");
    
velocityModifierOffset FindSendPropInfo("CTerrorPlayer""m_flVelocityModifier");
}

public 
Action:OnPluginStart_Delayed(Handle:timer)
{
    
//Next we setup the Bool for the Spitter
    
if (GetConVarInt(cvarSpitter))
    {
        
isSpitter true;
    }

    if (
GetConVarInt(cvarStickyGoo))
    {
        
isStickyGoo true;
    }

}

public 
OnMapStart()
{
    
/* Precache Models */
    
PrecacheModel("models/infected"true);
    
PrecacheModel("models/infected"true);

    
decl String:GameMode[16];
    
GetConVarString(FindConVar("mp_gamemode"), GameModesizeof(GameMode));
}
///Universal Events

//This will setup events that are required for more than one ability

/*public Event_PlayerSpawn (Handle:event, const String:name[], bool:dontBroadcast)
{
    new client = GetClientOfUserId(GetEventInt(event,"userid"));

    if (IsValidClient(client) && GetClientTeam(client) == 3)
    {
        new class = GetEntProp(client, Prop_Send, "m_zombieClass");
        if (class == ZOMBIECLASS_BOOMER)
        {
            if (isBoomer && isBileFeet)
            {
            cvarBileFeetTimer[client] = CreateTimer(0.5, Event_BoomerBileFeet, client);
            }
        }
    }
}
*/
//This is a call for the Sticky Goo

public OnGameFrame()
{
    for (new 
client=1client<=MaxClientsclient++)
    {
    if (
IsValidClient(client) && GetClientTeam(client) == && isSlowed[client])
    {
        new 
flags GetEntityFlags(client);

        if (
flags JUMPFLAG)
        {
        
//PrintHintText(client, "JUMPER!");
        
SetEntDataFloat(clientvelocityModifierOffsetGetConVarFloat(cvarStickyGooJump), true);
        }
    }
    }
}

//This will setup Sticky Goo - Reduce the speed of Survivors if they enter Spit

public Event_EnteredSpit (Handle:event, const String:name[], bool:dontBroadcast)
{
    if (
isSpitter && isStickyGoo)
    {
        new 
client GetClientOfUserId(GetEventInt(event,"userid"));

        if (
IsValidClient(client) && GetClientTeam(client) == && !isSlowed[client])
        {
            
isSlowed[client] = true;
            if (
isAnnounce) {PrintHintText(client"Standing in the spit is slowing you down!");}
            
cvarStickyGooTimer[client] = CreateTimer(GetConVarFloat(cvarStickyGooDuration), StickyGooclient);
            
SetEntDataFloat(clientlaggedMovementOffsetGetConVarFloat(cvarStickyGooSpeed), true);
        }
    }
}

public 
Action:StickyGoo(Handle:timerany:client)
{
    if (
IsValidClient(client))
    {
        
SetEntDataFloat(clientlaggedMovementOffset1.0true); //sets the survivors speed back to normal
        
if (isAnnounce) {PrintHintText(client"The spit is wearing off!");}
        
isSlowed[client] = false;

        if (
cvarStickyGooTimer[client] != INVALID_HANDLE)
            {
                
KillTimer(cvarStickyGooTimer[client]);
                
cvarStickyGooTimer[client] = INVALID_HANDLE;
            }
    }

    return 
Plugin_Stop;
}

public 
IsValidClient(client)
{
    if (
client == 0)
        return 
false;

    
//if (IsFakeClient(client))
        //return false;

    
if (!IsClientInGame(client))
        return 
false;

    if (!
IsPlayerAlive(client))
        return 
false;

    return 
true;
}

public 
IsValidClient2(client)
{
    if (
client == 0)
        return 
false;

    
//if (IsFakeClient(client))
        //return false;

    
if (!IsClientInGame(client))
        return 
false;

    return 
true;
}


public 
IsPlayerGhost(client)
{
    if (
IsValidClient(client))
    {
        if (
GetEntProp(clientProp_Send"m_isGhost")) return true;
        else return 
false;
    }
    return 
1;


Last edited by Darkwob; 05-27-2021 at 16:21.
Darkwob is offline