Raised This Month: $ Target: $400
 0% 

SDK Hooks 2.1 - Updated 2011-9-10


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Cookies.net
Senior Member
Join Date: Jan 2011
Old 02-07-2011 , 13:52   Re: [EXTENSION] SDK Hooks 1.3 (Updated 2010-05-12)
#1111

It doesn't seem like OnLevelInit() works, i know Berni wrote that he wasn't sure if it was working and apparently its not working, i get no errors in the server console but it doesn't print anything the the server

PHP Code:
public Action:OnLevelInit(const String:mapname[], String:mapEntities[2097152])
{
    
PrintToServer("dfbjksdfajnkl");
    
ReplaceString(mapEntitiessizeof(mapEntities), "OnCapTeam2""OnUser2");
    return 
Plugin_Changed;

Any chance this will be fixed or can anyone tell me if i do something wrong?
If it means anything then I'm trying this in TF2
Cookies.net is offline
lollypop
Junior Member
Join Date: Jun 2010
Old 02-08-2011 , 12:38   Re: [EXTENSION] SDK Hooks 1.3 (Updated 2010-05-12)
#1112

Hi there. Im making a script that prints "Dropper " after 3 seconds when you drop a weapon.
But it won't work.
Code:
#include <sdkhooks>
public OnPluginStart()
{
	{
		if (IsClientInGame(i))
        {
			SDKHook(i, SDKHook_WeaponDrop, OnWeaponDrop);
        }
    }
}
public OnClientPutInServer(client)
{
	SDKHook(client, SDKHook_WeaponDrop, OnWeaponDrop);
}
public Action:OnWeaponDrop(client, weapon)
{
	CreateTimer(3.0, DropTimer)
}
public Action:DropTimer(Handle:event)
{
	PrintToChatAll("Dropper :)");
}
It doesn't say Dropper. I can compile it and everything but it wont say Dropper
lollypop is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 02-08-2011 , 15:17   Re: [EXTENSION] SDK Hooks 1.3 (Updated 2010-05-12)
#1113

lollypop you forgot to return.

PHP Code:
#include <sdkhooks>
#include <sourcemod>

public OnPluginStart()
{
   for (new 
i1i<= MaxClientsi++) 
   {
      if (
IsClientInGame(i))
      {
         
SDKHook(iSDKHook_WeaponDropOnWeaponDrop);
      }
   }
}

public 
OnClientPutInServer(client)
{
   
SDKHook(clientSDKHook_WeaponDropOnWeaponDrop);
}

public 
Action:OnWeaponDrop(clientweapon)
{
   
CreateTimer(3.0DropTimer);

   return 
Plugin_Continue;
}

public 
Action:DropTimer(Handle:event)
{
   
PrintToChatAll("Dropper :)");

   return 
Plugin_Handled;


Last edited by blodia; 02-08-2011 at 15:20.
blodia is offline
SilentBr
Veteran Member
Join Date: Jan 2009
Old 02-09-2011 , 16:18   Re: [EXTENSION] SDK Hooks 1.3 (Updated 2010-05-12)
#1114

Is the latest gamedata file into .zip? Because some weeks ago was in a special link and now I could'not find.

Thanks
SilentBr is offline
n3wton
Senior Member
Join Date: Mar 2010
Old 02-10-2011 , 09:06   Stopping Client jumping
#1115

Hello,

Basically i'm writing a mod (L4D2) in which i need to stop clients from jumping for a certain amount of time... e.g. after a big fall, brake a clients leg, thus meaning they can't jump

here's my code to stop jumping...

Code:
public OnClientPutInServer(client)
{
    SDKHook(client, SDKHook_PreThink, OnPreThink);
}

public OnPreThink(client)
{
	if( GetClientTeam(client) == TEAM_SURV )
	{
		new iButtons = GetClientButtons(client);
		if(iButtons & IN_JUMP)
		{
			PrintToChat( client, "\x04[ReadyUp] \x01Jumping has been disabled for survivors, until both teams are ready." );
			iButtons &= ~IN_JUMP;
			SetEntProp(client, Prop_Data, "m_nButtons", iButtons);
		}
	}
}
The print to chat message fires... but the user still jumps

any ideas?

Thanks in advance.
Yours
N3wton

Last edited by n3wton; 02-10-2011 at 09:10.
n3wton is offline
Pawn 3-pg
Senior Member
Join Date: Jul 2009
Old 02-10-2011 , 12:49   Re: Stopping Client jumping
#1116

Quote:
Originally Posted by n3wton View Post
The print to chat message fires... but the user still jumps

any ideas?
I think PreThink happens before the clients keyboard input is processed. Try using the PreThinkPost hook.

OnPlayerRunCmd should also be able to do this.
Pawn 3-pg is offline
Colt.
New Member
Join Date: Feb 2011
Old 02-10-2011 , 20:46   Re: [EXTENSION] SDK Hooks 1.3 (Updated 2010-05-12)
#1117

I'm a noob to this so please be patient.

I already have latest sdkhooks on cs:s gungame server.
I removed eventscripts because it was messing with server performance and reg so I need another way to increase he grenade damage.

Would I just use this

public OnClientPutInServer(client)
{
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}

public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
decl String:sWeapon[32];
GetEdictClassname(inflictor, sWeapon, sizeof(sWeapon));

if(StrEqual(sWeapon, "weapon_hegrenade"))
{
damage *= 2.0;
return Plugin_Changed;
}

return Plugin_Continue;
}

And if so where do I put it?
Help would be greatly appreciated!
Colt. is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 02-12-2011 , 12:27   Re: [EXTENSION] SDK Hooks 1.3 (Updated 2010-05-12)
#1118

Quote:
Originally Posted by Colt. View Post
I'm a noob to this so please be patient.

I already have latest sdkhooks on cs:s gungame server.
I removed eventscripts because it was messing with server performance and reg so I need another way to increase he grenade damage.

Would I just use this

public OnClientPutInServer(client)
{
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}

public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
decl String:sWeapon[32];
GetEdictClassname(inflictor, sWeapon, sizeof(sWeapon));

if(StrEqual(sWeapon, "weapon_hegrenade"))
{
damage *= 2.0;
return Plugin_Changed;
}

return Plugin_Continue;
}

And if so where do I put it?
Help would be greatly appreciated!
Instead of StrEqual use this:
PHP Code:
if ( damagetype DMG_BLAST 
__________________
xbatista is offline
Send a message via Skype™ to xbatista
kevin555
Junior Member
Join Date: Jul 2010
Old 02-13-2011 , 16:06   Re: [EXTENSION] SDK Hooks 1.3 (Updated 2010-05-12)
#1119

How do we install SDKhooks to our server? I downloaded the files but there is no instructions what folders to put each file into.
kevin555 is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 02-13-2011 , 18:24   Re: [EXTENSION] SDK Hooks 1.3 (Updated 2010-05-12)
#1120

Try the SourceMod folder...
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
Closed Thread



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 02:33.


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