Raised This Month: $149 Target: $400
 37% 

[INC] Half-Life Stocks


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KORD_12.7
Senior Member
Join Date: Aug 2009
Location: Russia, Vladivostok
Old 07-19-2010 , 08:45   [INC] Half-Life Stocks
Reply With Quote #1

Stocks for Half-Life DM (valve)

PHP Code:
/*
* AMX mod X functions for Half-Life
*
* Version 1.1 (last update: 29.07.2010)
*
* http://hl.levshi.ru/forum/ - Russian Half-Life and Adrenaline Gamer Community
*
 
/* Returns player deaths.
*/
hl_get_user_deaths(client)
 
/* Sets player deaths.
*/
hl_set_user_deaths(clientdeaths)
 
/* Get amount of ammo in backpack on a user for a specific weapon.
* Look in hlsdk_const.inc for weapon types: HLW_*.
* Weapons on the same line uses the same ammo type:
* shotgun
* mp5, glock
* argrenade
* python
* gauss, egon
* rpg
* crossbow
* tripmine
* satchel
* handgrenade
* snark
* hornet
*/
hl_get_user_bpammo(clientweapon)
 
/* Restock/remove ammo in a user's backpack.
*/
hl_set_user_bpammo(clientweaponammo)
 
/* Get user model.
*/
hl_get_user_model(clientmodel[], len)
 
/* Set user model.
*/
hl_set_user_model(client, const model[])
 
/* Returns health value.
*/
hl_get_user_health(client)
 
/* Sets player health.
*/
hl_set_user_health(clienthealth)
 
/* Returns armor value.
*/
hl_get_user_armor(client)
/* Sets player armor.
*/
hl_set_user_armor(clientarmorvalue)
 
/* Returns team id. When length is greater then 0 then a name of team is set.
*/
hl_get_user_team(clientteam[] = ""len 0)
 
/* Set player team by teamname.
*/
hl_set_user_team(client, const team[])
 
/* Returns entity index of active weapon.
*/
hl_get_user_weapon_ent(client)
 
/* Returns amount of ammo in weapon's clip.
*/
hl_get_weapon_ammo(entity)
 
/* Set amount of ammo in weapon's clip.
*/
hl_set_weapon_ammo(entityclip)
 
/* Get weapon type. Corresponds to HLW_* in hlsdk_const.inc: 1 is HLW_CROWBAR, 2 is HLW_GLOCK and so on...
*/
hl_get_weapon_id(entity)
 
/* Returns weapon entity index from weaponbox.
*/
hl_get_wbox_weapon_ent(entity)
 
/* Returns amount of ammo in weaponbox.
*/
hl_get_wbox_ammo(entity)
 
/* Set amount of ammo in weaponbox.
*/
hl_set_wbox_ammo(entityammo)
 
/* Spawns a Half-Life player.
*/
hl_user_spawn(client)
 
/* Strips all weapons from player.
*/
hl_strip_user_weapons(client
 
/* Check if player in spectator mode.
*/
hl_get_user_spectator(client)
 
/* Switch player to spectator mode.
*/
hl_set_user_spectator(clientbool:spectator true)
 
/* Check if player have longjump module.
*/
hl_get_user_longjump(client
 
/* Set longjump module to player.
*/
hl_set_user_longjump(clientbool:longjump truebool:tempicon true
Attached Files
File Type: inc hl.inc (9.8 KB, 660 views)
__________________

Vi Veri Veniversum Vivus Vici
Russian Half-Life and Adrenaline Gamer community

Last edited by KORD_12.7; 07-29-2010 at 06:53.
KORD_12.7 is offline
Send a message via ICQ to KORD_12.7
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 07-19-2010 , 09:38   Re: [INC] Half-Life Stocks
Reply With Quote #2

Sweet. For getting health and armor as integer I'd use
Code:
healthvalue = pev(client, pev_health)
armorvalue = pev(client, pev_armorvalue)
__________________
hleV is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 07-19-2010 , 13:30   Re: [INC] Half-Life Stocks
Reply With Quote #3

Nice. This will make users create more hl plugins, including me :p.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-19-2010 , 14:04   Re: [INC] Half-Life Stocks
Reply With Quote #4

Suggestions : use get_user_info and set_user_info to set/get player model.

You should find m_fLongJump offset and update it when you (un)set longjump, this offset is used for item_longjump Touch fonction.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
MMYTH
BANNED
Join Date: May 2010
Location: Brazil
Old 07-25-2010 , 21:14   Re: [INC] Half-Life Stocks
Reply With Quote #5

oh very very nice
MMYTH is offline
Send a message via MSN to MMYTH
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 07-25-2010 , 22:23   Re: [INC] Half-Life Stocks
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
Suggestions : use get_user_info and set_user_info to set/get player model.

You should find m_fLongJump offset and update it when you (un)set longjump, this offset is used for item_longjump Touch fonction.
I't seems to be this

m_fLongJump = 98 (103 win)
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
KORD_12.7
Senior Member
Join Date: Aug 2009
Location: Russia, Vladivostok
Old 07-29-2010 , 06:56   Re: [INC] Half-Life Stocks
Reply With Quote #7

Updated to version 1.1

Fixed some errors and changed stocks:
g(s)et_user_team
g(s)et_user_spectator
g(s)et_user_model
set_user_longjump

Thanks to ConnorMcLeod and joropito for suggestions.
__________________

Vi Veri Veniversum Vivus Vici
Russian Half-Life and Adrenaline Gamer community
KORD_12.7 is offline
Send a message via ICQ to KORD_12.7
Conan1018
Member
Join Date: Oct 2010
Old 01-29-2011 , 02:14   Re: [INC] Half-Life Stocks
Reply With Quote #8

hl_set_user_deaths wont work. Let say score is 10/5, it reset then the next time he died, his score is 0/6.

Protocol version 48
Exe version 1.1.2.1 (valve)
Exe build: 14:21:06 Mar 8 2010 (4554)
Conan1018 is offline
KORD_12.7
Senior Member
Join Date: Aug 2009
Location: Russia, Vladivostok
Old 01-29-2011 , 03:46   Re: [INC] Half-Life Stocks
Reply With Quote #9

On my hl steam is everything ok. May be you use non-steam? Or may be you use custom hl.dll (xdm, bubble mod, severian mod and etc.)?
__________________

Vi Veri Veniversum Vivus Vici
Russian Half-Life and Adrenaline Gamer community

Last edited by KORD_12.7; 01-29-2011 at 06:34.
KORD_12.7 is offline
Send a message via ICQ to KORD_12.7
Conan1018
Member
Join Date: Oct 2010
Old 01-29-2011 , 14:13   Re: [INC] Half-Life Stocks
Reply With Quote #10

im using xdm. maybe the deaths offset is different from the default one. i've been trying to find the code to collect player offset but no luck so far. maybe you can give me?
Conan1018 is offline
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 17:52.


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