Raised This Month: $ Target: $400
 0% 

Setting a client's maxspeed permanently and efficiently


Post New Thread Reply   
 
Thread Tools Display Modes
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 01-19-2011 , 08:50   Re: Setting a client's maxspeed permanently and efficiently
Reply With Quote #41

Quote:
Originally Posted by Arkshine View Post
For SendWeaponAnim, a bug report has been already posted and a patch is ready : https://bugs.alliedmods.net/show_bug.cgi?id=3232
It is edited in the source code of the AMXX?
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-19-2011 , 09:09   Re: Setting a client's maxspeed permanently and efficiently
Reply With Quote #42

Not yet. The patch is just ready, it needs to be applied. It's up to BAILOPAN now.
__________________
Arkshine is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 01-19-2011 , 10:26   Re: Setting a client's maxspeed permanently and efficiently
Reply With Quote #43

You are tell about it http://www.amxmodx.org/snapshots.php ?
I need to download the latest version hg21?
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-19-2011 , 10:34   Re: Setting a client's maxspeed permanently and efficiently
Reply With Quote #44

You don't understand me ? I tell you the patch is not pushed yet.
__________________
Arkshine is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 06-19-2011 , 19:35   Re: Setting a client's maxspeed permanently and efficiently
Reply With Quote #45

Quote:
Originally Posted by ConnorMcLeod View Post
Not sure if cs need an altered function or if it's the whole WeaponAnim fonction that doesn't work, but freeman is right.
And would be awesome is ham could provide all virtual functions.
We should have made that long ago and the way hamsandwich made is easy to do it. But we should first check which mods would be nice to have in there.

Arkshine what do you think? There are virtual functions not in hamsandwich worth to add to hamsandwich?
joaquimandrade is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-20-2011 , 02:24   Re: Setting a client's maxspeed permanently and efficiently
Reply With Quote #46

Glad to see you still have interest into amxx stuff
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-20-2011 , 07:12   Re: Setting a client's maxspeed permanently and efficiently
Reply With Quote #47

He's not interested, he's more the kind of guy to trigger things and let people deal with that. Here a perfect example.

About the list, joaquimandrade, you say "worth to add", but the current list contains useless ones, so maybe we should have a complete list whatever some are considered it as useless?

For examples, here the ones not integrated for CS - CBasePlayer :

Code:
CBaseEntity::Restart(void)

CBasePlayer::Save(CSave &)
CBasePlayer::Restore(CRestore &)

CBaseAnimating::HandleAnimEvent(MonsterEvent_t *)
CBaseMonster::ChangeYaw(int)
CBaseMonster::HasHumanGibs(void)
CBaseMonster::HasAlienGibs(void)
CBaseMonster::FadeMonster(void)
CBaseMonster::GibMonster(void)
CBaseMonster::GetDeathActivity(void)
CBaseMonster::BecomeDead(void)
CBasePlayer::ShouldFadeOnDeath(void)
CBaseMonster::IRelationship(CBaseEntity *)

CBaseMonster::PainSound(void)
CBasePlayer::ResetMaxSpeed(void)

CBaseMonster::ReportAIState(void)
CBaseMonster::MonsterInitDead(void)
CBaseMonster::Look(int)
CBaseMonster::BestVisibleEnemy(void)
CBaseMonster::FInViewCone(CBaseEntity *)
CBaseMonster::FInViewCone(Vector *)

CBasePlayer::IsBot(void)
CBasePlayer::GetAutoaimVector(float)
CBasePlayer::Blind(float,float,float,int)

CBasePlayer::OnTouchingWeapon(CWeaponBox *)
The useless ones for me :

- Save, Restore : Not sure to find a real utility.
- HandleAnimEvent -> IRelationship : Related to monster, since there are no monsters in CS, kind of useless.
- ReportAIState, -> FInViewCone : Same as above.

I guess actually all should not be integrated.
__________________
Arkshine is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 06-20-2011 , 07:42   Re: Setting a client's maxspeed permanently and efficiently
Reply With Quote #48

that with ham i used it in my volleyball mod that's the best way good job, but i found it in aliens vs hunters by stupok & digi
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 06-21-2011 , 23:35   Re: Setting a client's maxspeed permanently and efficiently
Reply With Quote #49

Thread split to: https://forums.alliedmods.net/showthread.php?t=159814
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
MeRcyLeZZ
Veteran Member
Join Date: Dec 2007
Old 06-26-2011 , 22:31   Re: Setting a client's maxspeed permanently and efficiently
Reply With Quote #50

It seems like HamSandwich's code introduces 2 different new ways to handle custom maxspeed. I'm wondering which would be more convenient in terms of compatibility with other plugins that also want to change player's maxspeed?

1. Override ResetMaxSpeed (Post Hook)

Similar to CurWeapon method, we just override maxspeed when it's changed by the engine:
Code:
public plugin_init() {     register_clcmd("speed", "clcmd_speed")     RegisterHam(Ham_Player_ResetMaxSpeed, "player", "ham_player_resetmaxspeed_post", 1) } public clcmd_speed(id) {     if (!g_speed[id])     {         // Enable custom speed to set high maxspeed         g_speed[id] = true     }     else     {         // Disable custom speed to restore default maxspeed         g_speed[id] = false     }         // Update player maxspeed     ExecuteHamB(Ham_Player_ResetMaxSpeed, id) } public ham_player_resetmaxspeed_post(id) {     if (is_user_alive(id) && g_speed[id])     {         // Override maxspeed         set_user_speed(id, 1000)     } }

2. Block ResetMaxSpeed (Normal hook):

EDIT: There is a bug with this method: maxspeed is still changed after planting C4. Either handle this manually or use method #1 instead.

Here we prevent the engine from changing player's maxspeed at all when custom speed is enabled:
Code:
public plugin_init() {     register_clcmd("speed", "clcmd_speed")     RegisterHam(Ham_Player_ResetMaxSpeed, "player", "ham_player_resetmaxspeed") } public clcmd_speed(id) {     if (!g_speed[id])     {         // Enable custom speed, set high maxspeed         g_speed[id] = true         set_user_speed(id, 1000)     }     else     {         // Disable custom speed, restore default maxspeed         g_speed[id] = false         ExecuteHamB(Ham_Player_ResetMaxSpeed, id)     } } public ham_player_resetmaxspeed(id) {     if (is_user_alive(id) && g_speed[id])     {         // Block maxspeed change         return HAM_SUPERCEDE;     }         return HAM_IGNORED; }
__________________

Last edited by MeRcyLeZZ; 07-02-2011 at 20:32.
MeRcyLeZZ 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:35.


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