BANNED
|
05-27-2021
, 16:19
Re: can someone help me with this?
|
#3
|
Quote:
Originally Posted by Johnny2525
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_NOTIFY, true, 0.0, false, _);
cvarStickyGooDuration = CreateConVar("l4d_stickygooduration", "6", "How long a Survivor is slowed for aftering entering spit. (Def 6)", FCVAR_NOTIFY, true, 1.0, false, _);
cvarStickyGooSpeed = CreateConVar("l4d_stickygoospeed", "0.5", "Speed reduction to Survivor. (Def 0.5)", FCVAR_NOTIFY, true, 0.0, false, _);
cvarStickyGooJump = CreateConVar("l4d_stickygoojump", "1", "Speed reduction to Survivor jumping. (Def 1)", FCVAR_NOTIFY, true, 0.0, false, _);
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"), GameMode, sizeof(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=1; client<=MaxClients; client++)
{
if (IsValidClient(client) && GetClientTeam(client) == 2 && isSlowed[client])
{
new flags = GetEntityFlags(client);
if (flags & JUMPFLAG)
{
//PrintHintText(client, "JUMPER!");
SetEntDataFloat(client, velocityModifierOffset, GetConVarFloat(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) == 2 && !isSlowed[client])
{
isSlowed[client] = true;
if (isAnnounce) {PrintHintText(client, "Standing in the spit is slowing you down!");}
cvarStickyGooTimer[client] = CreateTimer(GetConVarFloat(cvarStickyGooDuration), StickyGoo, client);
SetEntDataFloat(client, laggedMovementOffset, GetConVarFloat(cvarStickyGooSpeed), true);
}
}
}
public Action:StickyGoo(Handle:timer, any:client)
{
if (IsValidClient(client))
{
SetEntDataFloat(client, laggedMovementOffset, 1.0, true); //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(client, Prop_Send, "m_isGhost")) return true;
else return false;
}
return 1;
}
Last edited by Darkwob; 05-27-2021 at 16:21.
|
|