Raised This Month: $51 Target: $400
 12% 

Anti-Stuck plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zhelev81
Veteran Member
Join Date: Nov 2007
Location: Varna,Bulgaria
Old 06-05-2009 , 08:54   Anti-Stuck plugin
Reply With Quote #1

I'm be glad if someone can create anti-stuck plugin,there is a problem on servers with 40 and over players servers that the players get stuck on spawn pretty often.Or maybe someone created it already but i did not find it ?

Tnx
zhelev81 is offline
Send a message via ICQ to zhelev81 Send a message via MSN to zhelev81 Send a message via Skype™ to zhelev81
almcaeobtac
Senior Member
Join Date: Nov 2008
Location: Florida
Old 06-05-2009 , 09:11   Re: Anti-Stuck plugin
Reply With Quote #2

Well, theres one on RP. Two actually. You can type /stuck to kill yourself, or type /push to push players out of the way. Which would you prefer?
almcaeobtac is offline
zhelev81
Veteran Member
Join Date: Nov 2007
Location: Varna,Bulgaria
Old 06-05-2009 , 09:15   Re: Anti-Stuck plugin
Reply With Quote #3

I prefer to push players away ,kill is a crime ,and is this plugin going to work on CS:S

tnx for the quick reply ,I hope will work
zhelev81 is offline
Send a message via ICQ to zhelev81 Send a message via MSN to zhelev81 Send a message via Skype™ to zhelev81
almcaeobtac
Senior Member
Join Date: Nov 2008
Location: Florida
Old 06-07-2009 , 15:56   Re: Anti-Stuck plugin
Reply With Quote #4

Alright here it is. Tell me if you find any errors.

Usage: /push in chat or push in console.

Info: It has a 5 second cooldown in between uses.

Code:
#include <sourcemod>
#include <sdktools>
#define PLUGIN_VERSION "1.1"

static Stamina[33];

public Plugin:myinfo = 
{
	name = "Player Push",
	author = "Krim (Edited for general use by Alm)",
	description = "Push players using /push",
	version = PLUGIN_VERSION,
	url = ""
}

public OnPluginStart()
{
	CreateConVar("playerpush_version", PLUGIN_VERSION, "Player Push version", FCVAR_PLUGIN|FCVAR_NOTIFY);
	RegConsoleCmd("push", PushPlayer);
}

public OnClientPutInServer(Client)
{
	Stamina[Client] = 100;
	CreateTimer(0.05, StaminaReturn, Client);
}

public Action:StaminaReturn(Handle:Timer, any:Client)
{
	if(!IsClientConnected(Client) || !IsClientInGame(Client))
	{
		return Plugin_Handled;
	}

	if(!IsPlayerAlive(Client))
	{
		CreateTimer(0.05, StaminaReturn, Client);
		return Plugin_Handled;
	}

	if(Stamina[Client] < 100)
	{
		Stamina[Client] += 1;
	}

	CreateTimer(0.05, StaminaReturn, Client);
	return Plugin_Handled;
}

public Action:PushPlayer(Client, Args)
{
	if(Client == 0)
	{
		return Plugin_Handled;
	}

	decl Ent;
  	Ent = GetClientAimTarget(Client, false);

	if(Stamina[Client] < 100)
	{
		PrintToChat(Client, "[SM] You do not have enough stamina to push.");
		return Plugin_Handled;
	}
  
  	if(IsValidEdict(Ent) && IsValidEntity(Ent))
  	{
		if(Ent > 0 && Ent <= GetMaxClients())
		{
  			decl Float:ClientOrigin[3], Float:EntOrigin[3], Float:Dist;

			GetClientAbsOrigin(Client, ClientOrigin);
			GetClientAbsOrigin(Ent, EntOrigin);
			Dist = GetVectorDistance(ClientOrigin, EntOrigin);
	  
			if(Dist <= 100)
			{
  				decl Float:Push[3];
  				decl Float:EyeAngles[3];
  				GetClientEyeAngles(Client, EyeAngles);
	    			Push[0] = (500.0 * Cosine(DegToRad(EyeAngles[1])));
    				Push[1] = (500.0 * Sine(DegToRad(EyeAngles[1])));
    				Push[2] = (-50.0 * Sine(DegToRad(EyeAngles[0])));
    				TeleportEntity(Ent, NULL_VECTOR, NULL_VECTOR, Push);
  			}
  		}
	}
	
	return Plugin_Handled;
}
almcaeobtac is offline
zhelev81
Veteran Member
Join Date: Nov 2007
Location: Varna,Bulgaria
Old 06-07-2009 , 20:51   Re: Anti-Stuck plugin
Reply With Quote #5

I've restricted the "/" on my server ,can we use "!" instead pls ?
zhelev81 is offline
Send a message via ICQ to zhelev81 Send a message via MSN to zhelev81 Send a message via Skype™ to zhelev81
InflatableSoulmate
Senior Member
Join Date: Oct 2008
Location: *.mdmp
Old 06-08-2009 , 00:12   Re: Anti-Stuck plugin
Reply With Quote #6

Because he registered the command with RegConsoleCmd, you should be able to use any of the following combinations to trigger the function:

In chat:
/push
/sm_push
!push
!sm_push

In console:
push
sm_push
__________________
Inflatable Soulmate
Server Operations Manager
Brothers of Chaos Multi-Gaming Clan
http://www.brothersofchaos.com/
InflatableSoulmate is offline
zhelev81
Veteran Member
Join Date: Nov 2007
Location: Varna,Bulgaria
Old 06-08-2009 , 06:18   Re: Anti-Stuck plugin
Reply With Quote #7

Ok I'll try and post back ,but what i saw is the player don't move aside when i type !push in chat and i'm not stucked to anyone ,but on my zombie does because there is something integrated in the ZR. (mod)

I'll post back.
zhelev81 is offline
Send a message via ICQ to zhelev81 Send a message via MSN to zhelev81 Send a message via Skype™ to zhelev81
zhelev81
Veteran Member
Join Date: Nov 2007
Location: Varna,Bulgaria
Old 06-08-2009 , 07:06   Re: Anti-Stuck plugin
Reply With Quote #8

Nope is not working ,we got stucked and we type !push and nothing happened.Can you pls double check the script pls?
zhelev81 is offline
Send a message via ICQ to zhelev81 Send a message via MSN to zhelev81 Send a message via Skype™ to zhelev81
psychonic

BAFFLED
Join Date: May 2008
Old 06-08-2009 , 08:26   Re: Anti-Stuck plugin
Reply With Quote #9

Quote:
Originally Posted by zhelev81 View Post
Nope is not working ,we got stucked and we type !push and nothing happened.Can you pls double check the script pls?
No Steam, No Support

Edit:
I would also appreciate if you didn't send me angry PMs just because you still want to leech support on here.
Quote:
Originally Posted by zhelev81
What's your problem ? I don't ask you to do anything for me so don't shit over the forum just to get attention.I don't understand people like you ... live your life and don't be an asshole

Last edited by psychonic; 06-08-2009 at 09:35.
psychonic is offline
almcaeobtac
Senior Member
Join Date: Nov 2008
Location: Florida
Old 06-08-2009 , 12:48   Re: Anti-Stuck plugin
Reply With Quote #10

this should work (removed the stamina, it's not needed.)

Code:
#include <sourcemod>
#include <sdktools>
#define PLUGIN_VERSION "1.1"

public Plugin:myinfo = 
{
	name = "Player Push",
	author = "Krim (Edited for general use by Alm)",
	description = "Push players using /push",
	version = PLUGIN_VERSION,
	url = ""
}

public OnPluginStart()
{
	CreateConVar("playerpush_version", PLUGIN_VERSION, "Player Push version", FCVAR_PLUGIN|FCVAR_NOTIFY);
	RegConsoleCmd("push", PushPlayer);
}

public Action:PushPlayer(Client, Args)
{
	if(Client == 0)
	{
		return Plugin_Handled;
	}

	decl Ent;
  	Ent = GetClientAimTarget(Client, false);

  	if(IsValidEdict(Ent) && IsValidEntity(Ent))
  	{
		if(Ent > 0 && Ent <= GetMaxClients())
		{
  			decl Float:ClientOrigin[3], Float:EntOrigin[3], Float:Dist;

			GetClientAbsOrigin(Client, ClientOrigin);
			GetClientAbsOrigin(Ent, EntOrigin);
			Dist = GetVectorDistance(ClientOrigin, EntOrigin);
	  
			if(Dist <= 100)
			{
  				decl Float:Push[3];
  				decl Float:EyeAngles[3];
  				GetClientEyeAngles(Client, EyeAngles);
	    			Push[0] = (500.0 * Cosine(DegToRad(EyeAngles[1])));
    				Push[1] = (500.0 * Sine(DegToRad(EyeAngles[1])));
    				Push[2] = (-50.0 * Sine(DegToRad(EyeAngles[0])));
    				TeleportEntity(Ent, NULL_VECTOR, NULL_VECTOR, Push);
  			}
  		}
	}
	
	return Plugin_Handled;
}
almcaeobtac 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 19:49.


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