Raised This Month: $ Target: $400
 0% 

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
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 06-13-2009 , 01:31   Re: Anti-Stuck plugin
Reply With Quote #7

I've actually created a module in ZR (not yet released) that automatically unsticks you if you are stuck within another player. No manual intervention required. I will release it as a standalone one of these days when I have time
__________________
Greyscale is offline
CS:S*
BANNED
Join Date: Jun 2009
Old 06-13-2009 , 08:15   Re: Anti-Stuck plugin
Reply With Quote #8

I hope this thing will work ... never found something like this on the forum ... it's a need ;)

Last edited by CS:S*; 06-13-2009 at 08:17.
CS:S* is offline
Schpraaankiii
Veteran Member
Join Date: Dec 2009
Location: Sweden Norrköping
Old 03-05-2011 , 21:18   Re: Anti-Stuck plugin
Reply With Quote #9

I need a plugin exactly like this but for cstrike...
Can someone make it? :love:
__________________
CAOSK-ESPORTS.COM
Schpraaankiii is offline
Send a message via Skype™ to Schpraaankiii
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 11:50.


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