This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Module: Half-Life Weapon Mod (v0.8)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KORD_12.7
Senior Member
Join Date: Aug 2009
Location: Russia, Vladivostok
Old 05-09-2012 , 09:04   Re: Module: Half-Life Weapon Mod (v0.5)
Reply With Quote #1

Technically impossible to add new weapons to CS with AMXX. In CS we can only edit existed weapons.
__________________

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
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 05-09-2012 , 09:24   Re: Module: Half-Life Weapon Mod (v0.5)
Reply With Quote #2

Quote:
Originally Posted by KORD_12.7 View Post
Technically impossible to add new weapons to CS with AMXX. In CS we can only edit existed weapons.
agree, though there are thing called Class Creator under Rage module.

Edit. Does this module suppots give_item? I tried to use it: give_item(id, "weapon_rg6") and it said unable to create item.
__________________


Last edited by NiHiLaNTh; 05-09-2012 at 09:25.
NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 05-10-2012 , 15:55   Re: Module: Half-Life Weapon Mod (v0.5)
Reply With Quote #3

Quote:
Originally Posted by KORD_12.7 View Post
Technically impossible to add new weapons to CS with AMXX. In CS we can only edit existed weapons.
It's not impossible with hacking. When you do like
PHP Code:
create_entity("weapon_awp"
hl searches in the dll of your game for a function with the name "weapon_awp". That function is responsible to create a C++ object that is child of CBaseEntity. If you check the thing Nilhant refered in the post above or the weapon that Arkshine created with Rage you can see that you can do the following: hook the function that create entities, and when they got a specific string that you want like "weapon_stuff" you can provide an object you create yourself. Basically you override the behaviour of creating entity with hooks and it is kind of natural apart for having to add a hook. This applies to any mod.

You can see here http://forums.alliedmods.net/showpos...9&postcount=82
A plugin with module that actualy does this and lets you do
PHP Code:
give_item(id,"weapon_boomerang"
joaquimandrade is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 05-11-2012 , 14:44   Re: Module: Half-Life Weapon Mod (v0.5)
Reply With Quote #4

Quote:
Originally Posted by joaquimandrade View Post
...you can do the following: hook the function that create entities, and when they got a specific string that you want like "weapon_stuff" you can provide an object you create yourself. Basically you override the behaviour of creating entity with hooks and it is kind of natural apart for having to add a hook. This applies to any mod.
In fact you may also add a custom dll inside liblist.gam with the key "gamedll[_linux]" (yes, you may have more than 1 gamedll[_linux]) then that dll will contain the functions named as weapon_* and all the code related.
__________________

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
GordonFreeman (RU)
Veteran Member
Join Date: Jan 2010
Location: Uzbekistan
Old 05-09-2012 , 09:41   Re: Module: Half-Life Weapon Mod (v0.5)
Reply With Quote #5

NiHiLaNTh,
Code:
stock wpnmod_give_item(const iPlayer, const szItem[]) {      new Float: vecOrigin[3];      pev(iPlayer, pev_origin, vecOrigin);            new iItem = wpnmod_create_item(szItem, vecOrigin);            if (pev_valid(iItem))      {           set_pev(iItem, pev_spawnflags, pev(iItem, pev_spawnflags) | SF_NORESPAWN);           dllfunc(DLLFunc_Touch, iItem, iPlayer);                     return iItem;      }            return -1; }
__________________
The functional way is the right way
GordonFreeman (RU) is offline
KORD_12.7
Senior Member
Join Date: Aug 2009
Location: Russia, Vladivostok
Old 05-10-2012 , 22:07   Re: Module: Half-Life Weapon Mod (v0.5)
Reply With Quote #6

Okay. Can we have "weapon_awp" and "weapon_stuff" at one time in player's items inventory with classcreator in CS? Or player's hud will be fucked up? And "weapon_awp" & "weapon_stuff" will have the same weapon ID: CSW_AWP ?
__________________

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

Last edited by KORD_12.7; 05-10-2012 at 22:43.
KORD_12.7 is offline
Send a message via ICQ to KORD_12.7
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 05-10-2012 , 22:35   Re: Module: Half-Life Weapon Mod (v0.5)
Reply With Quote #7

Quote:
Originally Posted by KORD_12.7 View Post
Okay. Can we have "weapon_awp" and "weapon_stuff" at one time in player's items inventory? Or player's hud will be fucked up? And "weapon_awp" & "weapon_stuff" will have the same weapon ID: CSW_AWP ?
In Arkshine plugin there is a part to handle the hud but I don't know if its perfect. About the weapon ID I don't know because I don't know the context of the use of ID's of weapon, I know more of C++ than of HLSDK . I will ask Arkshine tomorrow to come here to answer
joaquimandrade is offline
KORD_12.7
Senior Member
Join Date: Aug 2009
Location: Russia, Vladivostok
Old 05-10-2012 , 22:43   Re: Module: Half-Life Weapon Mod (v0.5)
Reply With Quote #8

Because in Half-Life we can add new weapons by adding their info to ItemInfo array:
PHP Code:
#define MAX_WEAPONS            32

ItemInfo CBasePlayerItem::ItemInfoArray[MAX_WEAPONS]; 
HL have only 15 weapons and so we have 16 empty positions in array to store information about our new weapons. In my module i'm using small hack with hlsdk function
PHP Code:
// Precaches the weapon and queues the weapon info for sending to clients
void UTIL_PrecacheOtherWeapon( const char *szClassname 
to insert info about new weapons to infoarray.
__________________

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

Last edited by KORD_12.7; 05-10-2012 at 22:46.
KORD_12.7 is offline
Send a message via ICQ to KORD_12.7
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 05-11-2012 , 01:10   Re: Module: Half-Life Weapon Mod (v0.5)
Reply With Quote #9

Quote:
Originally Posted by KORD_12.7 View Post
Because in Half-Life we can add new weapons by adding their info to ItemInfo array:
PHP Code:
#define MAX_WEAPONS            32

ItemInfo CBasePlayerItem::ItemInfoArray[MAX_WEAPONS]; 
HL have only 15 weapons and so we have 16 empty positions in array to store information about our new weapons. In my module i'm using small hack with hlsdk function
PHP Code:
// Precaches the weapon and queues the weapon info for sending to clients
void UTIL_PrecacheOtherWeapon( const char *szClassname 
to insert info about new weapons to infoarray.
Ah ok that's why you distinguish CS from HL. I was thinking that just you didnt care about CS in favor of HL.
joaquimandrade is offline
KORD_12.7
Senior Member
Join Date: Aug 2009
Location: Russia, Vladivostok
Old 05-25-2012 , 19:47   Re: Module: Half-Life Weapon Mod (v0.5)
Reply With Quote #10

And what is a mod Rebellion?
__________________

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


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