Raised This Month: $ Target: $400
 0% 

[L4D2] Smoke IT Modification / Help Requests


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Darkwob
BANNED
Join Date: Oct 2018
Old 08-26-2020 , 00:34   [L4D2] Smoke IT Modification / Help Requests
Reply With Quote #1

Even though I have adjusted the smoker's tongue pull distance, it doesn't pull remotely. How can I fix it?




PHP Code:
#define PLUGIN_VERSION "1.3"
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1
#define CVAR_FLAGS FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_NOTIFY

new Float:f_SmokersSpeed;
new 
bool:Grabbed[MAXPLAYERS+1];
new 
TongueMaxStretch;

public 
Plugin:myinfo =

{
    
name "Smoke'n Move",
    
author "Olj, raziEiL [disawar1]",
    
description "Wanna move while smoking? No problem!",
    
version PLUGIN_VERSION,
    
url "http://www.sourcemod.net/"
}

public 
OnPluginStart()
{
    
CreateConVar("l4d_smokeit_version"PLUGIN_VERSION"Version of Smoke It plugin"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
    new 
Handle:h_SmokersSpeed CreateConVar("l4d_smokeit_speed""0.42""Smoker's speed modifier"CVAR_FLAGS);
    new 
Handle:h_TongueMaxStretch CreateConVar("l4d_smokeit_tongue_stretch""5000000""Smoker's max tongue stretch (tongue will be released if beyond this)"CVAR_FLAGS);
    
f_SmokersSpeed GetConVarFloat(h_SmokersSpeed);
    
TongueMaxStretch GetConVarInt(h_TongueMaxStretch);
    
HookConVarChange(h_SmokersSpeedSmokersSpeedChanged);
    
HookConVarChange(h_TongueMaxStretchTongueMaxStretchChanged);
    
HookEvent("tongue_grab"GrabEventEventHookMode_Pre);
    
HookEvent("tongue_release"ReleaseEventEventHookMode_Pre);
    
AutoExecConfig(true"l4d_smokeit");
}

public 
SmokersSpeedChanged(Handle:convar, const String:oldValue[], const String:newValue[])
{
    
f_SmokersSpeed GetConVarFloat(convar);
}

public 
TongueMaxStretchChanged(Handle:convar, const String:oldValue[], const String:newValue[])
{
    
TongueMaxStretch GetConVarInt(convar);
}

public 
OnClientPutInServer(client)
{
    
Grabbed[client] = false;
}

public 
GrabEvent(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
Smoker GetClientOfUserId(GetEventInt(event"userid"));
    if (
IsFakeClient(Smoker)) return;
    
Grabbed[Smoker] = true;
    new 
Victim GetClientOfUserId(GetEventInt(event"victim"));
    
SetEntityMoveType(SmokerMOVETYPE_ISOMETRIC);
    
SetEntPropFloat(SmokerProp_Send"m_flLaggedMovementValue"f_SmokersSpeed);
    
decl Handle:pack;
    
CreateDataTimer(0.2RangeCheckTimerFunctionpackTIMER_FLAG_NO_MAPCHANGE|TIMER_REPEAT);
    
WritePackCell(packSmoker);
    
WritePackCell(packVictim);
}

public 
Action:RangeCheckTimerFunction(Handle:timerHandle:pack)
{
    
ResetPack(pack);
    new 
Smoker ReadPackCell(pack);

    if (!
Grabbed[Smoker])
        return 
Plugin_Stop;

    new 
Victim ReadPackCell(pack);

    if (!
IsValidClient(Smoker) || GetClientTeam(Smoker) != || IsFakeClient(Smoker) || !IsSmoker(Smoker) || !IsValidClient(Victim) || GetClientTeam(Victim) != 2)
    {
        
Grabbed[Smoker] = false;
        return 
Plugin_Stop;
    }

    
decl Float:SmokerPosition[3], Float:VictimPosition[3];
    
GetClientAbsOrigin(Smoker,SmokerPosition);
    
GetClientAbsOrigin(Victim,VictimPosition);

    if (
RoundToNearest(GetVectorDistance(SmokerPositionVictimPosition)) > TongueMaxStretch)
    {
        
SlapPlayer(Smoker0false);
    }
    return 
Plugin_Continue;
}

public 
ReleaseEvent(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
Smoker GetClientOfUserId(GetEventInt(event"userid"));
    if (!
Grabbed[Smoker]) return;
    
Grabbed[Smoker] = false;
    
SetEntityMoveType(SmokerMOVETYPE_CUSTOM);
    
SetEntPropFloat(SmokerProp_Send"m_flLaggedMovementValue"1.0);
}

bool:IsValidClient(client)
{
    return 
client && IsClientInGame(client) && IsPlayerAlive(client);
}

bool:IsSmoker(client)
{
    return 
GetEntProp(clientProp_Send"m_zombieClass") == 1;

Darkwob is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 08-26-2020 , 00:42   Re: [L4D2] Smoke IT Modification / Help Requests
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?p=2590861
__________________
HarryPotter is offline
Darkwob
BANNED
Join Date: Oct 2018
Old 08-26-2020 , 06:44   Re: [L4D2] Smoke IT Modification / Help Requests
Reply With Quote #3

Quote:
Originally Posted by fbef0102 View Post
this plugin that you're offering me just makes it move, and I'm I wanting can extend smoaker's language distance.
Darkwob is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 08-27-2020 , 23:09   Re: [L4D2] Smoke IT Modification / Help Requests
Reply With Quote #4

Quote:
Originally Posted by Darkwob View Post
I'm I wanting can extend smoaker's language distance.
what?
__________________

Last edited by HarryPotter; 08-27-2020 at 23:09.
HarryPotter is offline
Darkwob
BANNED
Join Date: Oct 2018
Old 08-27-2020 , 23:33   Re: [L4D2] Smoke IT Modification / Help Requests
Reply With Quote #5

Quote:
Originally Posted by fbef0102 View Post
what?
tongue pull distance doesn't work in this plugin. The plugin you recommended to me only allows infected players to move when they use their Special Abilities.

Last edited by Darkwob; 08-27-2020 at 23:34.
Darkwob is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 08-28-2020 , 02:12   Re: [L4D2] Smoke IT Modification / Help Requests
Reply With Quote #6

Is this you looking for?
PHP Code:
tongue_range                             750      : , "sv""cheat"  How far a smoker can shoot his tongue
__________________
HarryPotter is offline
Darkwob
BANNED
Join Date: Oct 2018
Old 08-28-2020 , 03:59   Re: [L4D2] Smoke IT Modification / Help Requests
Reply With Quote #7

Quote:
Originally Posted by fbef0102 View Post
Is this you looking for?
PHP Code:
tongue_range                             750      : , "sv""cheat"  How far a smoker can shoot his tongue
l4d_smokeit_tongue_stretch
does it correspond to this position?
Darkwob is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:07.


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