Raised This Month: $ Target: $400
 0% 

Module: Counter-Strike Weapon Mod [1.7.1]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 09-08-2018 , 05:17   Re: Module: Counter-Strike Weapon Mod [1.6 R]
Reply With Quote #1

Quote:
Originally Posted by Airkish View Post
Tried to build some weapons from cs:go, then noticed it's windows only :/ Can we expect linux support?
I'l try.
EDIT: I think compiling on windows to get linux library is impssible.

Quote:
Originally Posted by Airkish View Post
And what will get_user_weapon(id) return when I've selected custom weapon?
Will return Pistol as P228, Rifle as AK47, Sniper as AWP, Shotgun as XM1014
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 09-08-2018 at 11:02.
Ghosted is offline
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 09-08-2018 , 05:20   Re: Module: Counter-Strike Weapon Mod [1.6 R]
Reply With Quote #2

Quote:
Originally Posted by Ghosted View Post
Will return Pistol as P228, Rifle as AK47, Sniper as AWP, Shotgun as XM1014
Would it be possible for you to let us set custom id?

PHP Code:
new Weapon CreateWeapon(<Model Name>, <Type>, <Name>, <Index>); 
__________________

Last edited by Airkish; 09-08-2018 at 05:23.
Airkish is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 09-08-2018 , 06:02   Re: Module: Counter-Strike Weapon Mod [1.6 R]
Reply With Quote #3

Quote:
Originally Posted by Airkish View Post
Would it be possible for you to let us set custom id?

PHP Code:
new Weapon CreateWeapon(<Model Name>, <Type>, <Name>, <Index>); 
no, there is limit of weapon index - 32 (MAX_WEAPONS) which is already filled up.
things would mess up.
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 09-08-2018 at 06:02.
Ghosted is offline
hjkwe654
Member
Join Date: Sep 2005
Location: Taiwan
Old 09-09-2018 , 01:45   Re: Module: Counter-Strike Weapon Mod [1.6 R]
Reply With Quote #4

CSWM will conflict with other plugins and cause server crash

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <rpgx>

#define dmgcalc (0.04 * RPGx_GetUpgradeLevel(attacker, upgrade_id))

new g_hambots
new cvar_botquota
new upgrade_id

public plugin_init() {
    
register_plugin("Knife Dmg+ RPGx Upgrade""2.7""hjkwe654")
    
cvar_botquota get_cvar_pointer("bot_quota")
    
RegisterHam(Ham_TakeDamage"player""KnifeDamage")
}

public 
client_putinserver(id) {
    if (!
is_user_bot(id) && g_hambots && !cvar_botquota)
        return
    
    
set_task(0.1"fw_RegisterHamBots"id)
}

public 
fw_RegisterHamBots(id) {
    
RegisterHamFromEntity(Ham_TakeDamageid"KnifeDamage_BOT")
    
g_hambots true
}

public 
RPGx_OnPluginReady()
    
upgrade_id RPGx_MakeUpgrade("近戰訓練"100157)

public 
KnifeDamage(thisidattackerFloat:fDmgdamagebits) {
    if(
is_user_alive(attacker)){
        new 
iLevel RPGx_GetUpgradeLevel(attackerupgrade_id)
        if(
iLevel && get_user_weapon(attacker) == CSW_KNIFE)
        {
            
SetHamParamFloat(4fDmg * (dmgcalc))   //this code will conflict with CSWM
            
return HAM_HANDLED
        
}
    }
    return 
HAM_IGNORED
}

public 
KnifeDamage_BOT(thisidattackerFloat:fDmgdamagebits) {
    if(
is_user_alive(attacker)){
        new 
iLevel RPGx_GetUpgradeLevel(attackerupgrade_id)
        if(
iLevel && get_user_weapon(attacker) == CSW_KNIFE)
        {
            
SetHamParamFloat(4fDmg + (iLevel 0.08))   //this code will conflict with CSWM
            
return HAM_HANDLED
        
}
    }
    return 
HAM_IGNORED

hjkwe654 is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 09-09-2018 , 04:49   Re: Module: Counter-Strike Weapon Mod [1.6 R]
Reply With Quote #5

Quote:
Originally Posted by hjkwe654 View Post
CSWM will conflict with other plugins and cause server crash
Spoiler
Thanks for report, i have fixed the issue, problem was not SetHamParamFloat, it was caused after restarting the game and shooting bot.

Your code is incorrect at:
Code:
if (!is_user_bot(id) && g_hambots && !cvar_botquota)
		return
should be:
Code:
if (!is_user_bot(id) || g_hambots || !cvar_botquota)
		return
If you face any issues please report here or on github page.
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 09-09-2018 at 04:50.
Ghosted is offline
hjkwe654
Member
Join Date: Sep 2005
Location: Taiwan
Old 09-09-2018 , 13:28   Re: Module: Counter-Strike Weapon Mod [1.6 R]
Reply With Quote #6

One more issue, client get into buy menu will crash client side. (After update to 1.6.1)

Last edited by hjkwe654; 09-09-2018 at 13:29.
hjkwe654 is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 09-09-2018 , 16:20   Re: Module: Counter-Strike Weapon Mod [1.6 R]
Reply With Quote #7

Quote:
Originally Posted by hjkwe654 View Post
One more issue, client get into buy menu will crash client side. (After update to 1.6.1)
That should not be connected to server in any way. Anyway tested and it is not an issue.
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 09-09-2018 at 16:20.
Ghosted is offline
killerZM
Senior Member
Join Date: Sep 2016
Old 10-07-2018 , 11:52   Re: Module: Counter-Strike Weapon Mod [1.6.3]
Reply With Quote #8

off-topic sorry
where did you learn using C++ to make CS modules ?
killerZM is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-07-2018 , 12:12   Re: Module: Counter-Strike Weapon Mod [1.6.3]
Reply With Quote #9

Quote:
Originally Posted by killerZM View Post
off-topic sorry
where did you learn using C++ to make CS modules ?
There are tons of sites/books to learn C++ from.
__________________
HamletEagle is offline
killerZM
Senior Member
Join Date: Sep 2016
Old 10-07-2018 , 15:22   Re: Module: Counter-Strike Weapon Mod [1.6.3]
Reply With Quote #10

Quote:
Originally Posted by HamletEagle View Post
There are tons of sites/books to learn C++ from.
i am not talking about C++ i am talking about HL SDK and such
killerZM 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 18:19.


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