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

Hamsandwich Updating


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 06-21-2011 , 12:56   Hamsandwich Updating
#1

This update is now integrated to the next 1.8.3 version.

LASTEST VERSION CAN BE DOWNLOADED FROM THERE : https://forums.alliedmods.net/showpo...9&postcount=34


Hello dear individuals. To begin, me and Arkshine are fixing the functions in hamsandwich that return a Vector (so they can be executed since the could for hooks is ok). It is fixed in Windows and I'm guessing that in linux it won't need to be fixed because it is done other way. So, we would like to ask if someone can test in Linux to execute with ExecuteHam:

at least one of these functions:

Code:
Ham_Center
Ham_EyePosition
Ham_EarPosition
Ham_Player_GetGunPosition
and this one:
Code:
Ham_BodyTarget
Thank you!

Last edited by Arkshine; 05-03-2014 at 11:23.
joaquimandrade is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-21-2011 , 15:09   Re: Setting a client's maxspeed permanently and efficiently
#2

Tested and work fine.
__________________
fysiks is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 06-21-2011 , 15:20   Re: Setting a client's maxspeed permanently and efficiently
#3

Quote:
Originally Posted by fysiks View Post
Tested and work fine.
Thank you!

The "project" will be at this address:

https://github.com/joaquimandrade/Hamsandwich-Update/

If someone is experienced with this of github that is a new world for me (that's why the author is the misterious unknown (as fysiks kindly pointed to me in steam)), I kindly accept suggestions.

For now you can check the current advances at

https://github.com/joaquimandrade/Ha...pdate/commits/
joaquimandrade is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 06-21-2011 , 21:54   Re: Setting a client's maxspeed permanently and efficiently
#4

Added so far (after the name there is the return type and arguments, please tell me if you don't understand. This is needed because documentation isn't ready yet):

Added to CS and DOD

Code:
    Ham_ChangeYaw, float (id,int)
    Ham_HasHumanGibs, int (id)
    Ham_Has_AlienGibs, int (id)
    Ham_FadeMonster, void (id)
    Ham_GibMonster, void (id)
    Ham_BecomeDead, void (id)
    Ham_IRelationship, int (id,entity)
    Ham_PainSound,  void (id)
    Ham_ReportAIState, void (id)
    Ham_MonsterInitDead, void (id)
    Ham_Look, void (id)
    Ham_BestVisibleEnemy, entity (id)
To CS:

Code:
Ham_CS_ResetMaxSpeed void(id) (the one already being used with the trick reported on this thread)
To DOD:
Code:
    Ham_DOD_Item_SpawnDeploy int (id)
    Ham_DOD_Item_SetDmgTime void (id,float)
    Ham_DOD_Item_DropGren void (id)
    Ham_DOD_Weapon_IsUseable int (id)
    Ham_DOD_Weapon_Aim, void (id,float,ent,int)
    Ham_DOD_Weapon_flAim, void (id,int,float)
    Ham_DOD_Weapon_ChangeFOV, void (id,int)
    Ham_DOD_Weapon_ZoomOut, void (id)
    Ham_DOD_Weapon_ZoomIn, void (id)
    Ham_DOD_Weapon_GetFOV, int (id)
    Ham_DOD_Weapon_IsWaterSniping, int (id) 
    Ham_DOD_Weapon_UpdateZoomSpeed, void (id)
Also fixed the calling of those functions that return a vector, namely:

Code:
Ham_Center
Ham_EyePosition
Ham_EarPosition
Ham_Player_GetGunPosition
Ham_BodyTarget
Please help testing it
Attached Files
File Type: zip hamsandwich.zip (157.9 KB, 803 views)

Last edited by joaquimandrade; 06-21-2011 at 22:06.
joaquimandrade is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 06-21-2011 , 22:51   Re: Setting a client's maxspeed permanently and efficiently
#5

Here goes a stupid example. When you scream in pain it also shows gibs. Also it shows how you can write more concise and efficient code when more functions are exposed:

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <fakemeta_stocks>
#include <hamsandwich>
#include <xs>

#define PLUGIN    "New Plugin"
#define AUTHOR    "Unknown"
#define VERSION    "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_PainSound,"player","painSound",0)
}

public 
painSound(id)
{
    new 
Float:eyes[3]
    
    
ExecuteHam(Ham_EyePosition,id,eyes)
    
    
// Equivalent to:
    
new Float:origin[3], Float:view_ofs[3]
    
pev(id,pev_origin,origin)
    
pev(id,pev_view_ofs,view_ofs)
    
xs_vec_add(origin,view_ofs,origin)
    
//
    
    
ExecuteHam(Ham_GibMonster,id)
    
    
client_print(0,print_chat,"These vectors should be equal [%f][%f][%f] - [%f][%f][%f]",origin[0],origin[1],origin[2],eyes[0],eyes[1],eyes[2])

joaquimandrade is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 06-21-2011 , 23:04   Re: Setting a client's maxspeed permanently and efficiently
#6

Edit: (This post was made before this thread was here in "Module Coding")

As my good friend fysiks wisely pointed me, this thread is no place for this. I therefore request, if you don't mind, if you can split the posts related to the hamsandwich update to a new thread in Module Coding with a name related to "Hamsandwich Updating" or something like that. Thanks in advance.

Last edited by joaquimandrade; 06-22-2011 at 11:57.
joaquimandrade is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-22-2011 , 01:52   Re: Hamsandwich Updating
#7

Thanks.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-22-2011 , 02:10   Re: Hamsandwich Updating
#8

You forgot to close your comment on line 964 of ham_const.inc FYI.

EDIT:

So, I was working with Ham_DOD_Weapon_ZoomIn and Ham_DOD_Weapon_ZoomOut and the latter really screws things up just by hooking it:

PHP Code:
    RegisterHam(Ham_DOD_Weapon_ZoomOut"weapon_spring""hookSpringZoomOut")

public 
hookSpringZoomOut(wepent)
{


This will affect gameplay, it's hard to explain but it certainly makes playing with the springfield screwy.
__________________

Last edited by fysiks; 06-22-2011 at 02:53.
fysiks is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 06-22-2011 , 10:04   Re: Hamsandwich Updating
#9

fysiks, the comment thing is because there are nested comments that are there so one does not forget to update the documentation. It's ok.

Now, to the bug. My guess is that that is failing because I assumed that the function doesn't return a value and it indeed returns. Im gonna attach two versions of the library. One that returns an integer and other that returns a float (by ref). When you use them remove the prefix. Unfortunately I'm not being able to test myself because my windows client isn't able to access my linux server I have to figure out why.

Also issue the following command on the console:

Code:
ham hooks
Just to confirm that it throws:

Code:
Key                      | Classname                   |        Pre |       Post
--------------------------------------------------------------------------------
dod_weapon_zoomout       | weapon_spring               |          1 |          0
Attached Files
File Type: so float_hamsandwich_amxx_i386.so (280.9 KB, 370 views)
File Type: so int_hamsandwich_amxx_i386.so (280.9 KB, 475 views)
joaquimandrade is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 06-22-2011 , 11:37   Re: Hamsandwich Updating
#10

Dear fysiks, had the chance to test it out and is indeed the return type. It must be set to int so the int_ file I've sent you should work (please test it because I tested on Windows alone but it should be fine). It seems that if you return values higher than 0 it applies an effect on the player (like an effect because you zoomed out). Thanks for detecting that.
joaquimandrade is offline
Closed Thread


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 04:17.


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