BANNED
|
05-27-2021
, 12:00
can someone help me with this?
|
#1
|
My goal in this plugin is to slow down when there is a Survivor spitter acid left, but when I tried to compile it, I got a few errors.
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;
//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); HookEvent("spit_burst", Event_SpitBurst); 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, _); }
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); } } } }
public Event_PlayerHurt (Handle:event, const String:name[], bool:dontBroadcast) { new client = GetClientOfUserId(GetEventInt(event, "userid")); decl String:weapon[64]; GetEventString(event, "weapon", weapon, sizeof(weapon)); //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; } //Spitter Timers if(cvarAcidSwipeTimer[client] != INVALID_HANDLE) { KillTimer(cvarAcidSwipeTimer[client]); cvarAcidSwipeTimer[client] = INVALID_HANDLE; } }
public Event_PlayerIncapped (Handle:event, const String:name[], bool:dontBroadcast) { if (isJockey && isDerbyDaze) { new client = GetClientOfUserId( GetEventInt( event, "victim"));
if (IsValidClient(client) && GetClientTeam(client) == 2) { DerbyDaze(client, 0); SetEntProp(client, Prop_Send, "m_iHideHUD", 0); } } }
public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast) { new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (IsValidClient2(client) && GetClientTeam(client) == 2) { isSlowed[client] = false; SetEntProp(client, Prop_Send, "m_iHideHUD", 0); } Reset_Timers(client); }
public Event_PlayerTeam(Handle:event, const String:name[], bool:dontBroadcast) { new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (IsValidClient2(client)) { isSlowed[client] = false; SetEntProp(client, Prop_Send, "m_iHideHUD", 0); Reset_Timers(client); } }
public Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast) { new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (IsValidClient2(client) && GetClientTeam(client) == 2) { isSlowed[client] = false; SetEntProp(client, Prop_Send, "m_iHideHUD", 0); Reset_Timers(client); } Reset_Timers(client); }
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; }
ERRORS:
Quote:
/groups/sourcemod/upload_tmp/textAbuXLC.sp(37) : error 017: undefined symbol "Event_EnteredSpit"
/groups/sourcemod/upload_tmp/textAbuXLC.sp(3 : warning 217: loose indentation
/groups/sourcemod/upload_tmp/textAbuXLC.sp(3 : error 017: undefined symbol "Event_SpitBurst"
/groups/sourcemod/upload_tmp/textAbuXLC.sp(57) : warning 217: loose indentation
/groups/sourcemod/upload_tmp/textAbuXLC.sp(100) : error 017: undefined symbol "isSlowed"
/groups/sourcemod/upload_tmp/textAbuXLC.sp(100) : warning 215: expression has no effect
/groups/sourcemod/upload_tmp/textAbuXLC.sp(100) : error 001: expected token: ";", but found "]"
/groups/sourcemod/upload_tmp/textAbuXLC.sp(100) : error 029: invalid expression, assumed zero
/groups/sourcemod/upload_tmp/textAbuXLC.sp(100) : fatal error 190: too many error messages on one line
|
Last edited by Darkwob; 05-27-2021 at 12:01.
|
|