Raised This Month: $63 Target: $400
 15% 

Double Jump


Post New Thread Reply   
 
Thread Tools Display Modes
AmirHossaiN
Junior Member
Join Date: Oct 2016
Old 10-15-2016 , 17:19   Re: Double Jump
Reply With Quote #31

some time working and most time not working
AmirHossaiN is offline
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 10-20-2016 , 16:41   Re: Double Jump
Reply With Quote #32

Been a while since I touched this but if you jump too fast (like with a mouse wheel) it might not register them all.

Otherwise, You can try adding server console output at the various stages to see what's firing.

Code:
PrintToChat(client, "IsawThat!");
__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod
paegus is offline
sleggie
Junior Member
Join Date: Mar 2016
Old 10-22-2016 , 02:19   Re: Double Jump
Reply With Quote #33

would be nice to make it so only people with certain flags can use it
sleggie is offline
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 10-23-2016 , 02:19   Re: Double Jump
Reply With Quote #34

cheep and nasty version is something like:

Code:
//somewhere up top
new AdminFlag:g_afAdminLevel		= Admin_Kick


// somewhere something happens.
 if (CanClientDoThing(client)) {
    // do thing
  }


// somewhere down bottom
stock bool:CanClientDoThing (const any:client) {
	if (g_afAdminLevel == INVALID_ADMIN_ID) {	// No access levels required. Everyone can spectate hidden.
		return true;
	} else {	// Access level specified.
		new AdminId:aiClient = GetUserAdmin (client);
		return (
			aiClient != INVALID_ADMIN_ID &&							// Client is an admin of some kind.
			//GetAdminFlags (aiClient, Access_Real) & ADMFLAG_KICK	// Client has needed access
			GetAdminFlag (aiClient, g_afAdminLevel)					// Client has needed access
		);
	}
}
It might be better to set it up once so it's not checked every time a player tries. Say in client connect or something, enable to disable their player slot. That way you can have it...

Code:
// somewhere something happens.
  if ( CanClientDoThing[client] ) {
    // do thing
  }
...which is far less work since looking up an array location is just a n counts through the array instead of all that other stuff.
__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod

Last edited by paegus; 10-23-2016 at 02:19.
paegus is offline
StrikerMan780
AlliedModders Donor
Join Date: Jul 2009
Location: Canada
Old 06-18-2018 , 18:56   Re: Double Jump
Reply With Quote #35

Here's an optimized version of the plugin that uses OnPlayerRunCMD rather than OnGameFrame, and removes an unnecessary variable.
Attached Files
File Type: sp Get Plugin or Get Source (sm_doublejump.sp - 408 views - 3.7 KB)
__________________
StrikerMan780 is offline
Send a message via Skype™ to StrikerMan780
Unban
Junior Member
Join Date: Jul 2011
Location: Lithuania
Old 12-18-2018 , 15:02   Re: Double Jump
Reply With Quote #36

StrikerMan780, big thanks
Unban is offline
Send a message via Skype™ to Unban
Reply


Thread Tools
Display Modes

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 14:12.


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