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

[CS:GO] Deathmatch Goes Advanced (v0.13.8, 23/01/2016)


Post New Thread Reply   
 
Thread Tools Display Modes
root88
Senior Member
Join Date: May 2016
Old 08-31-2017 , 05:13   Re: [CS:GO] Deathmatch Goes Advanced (v0.13.8, 23/01/2016)
Reply With Quote #2331

Warning: Only quick tested.
in deathmatch/weapons.sp, stock weapons_GivePlayerItem add in the beggining:
Code:
if(weaponId == 32)
    {
        new weaponEntity = GivePlayerItem(clientIndex, "weapon_hkp2000");
        return weaponEntity;
    }
Than recompile deathmatch.sp. I've attached weapons.sp with above modification - but I didn't test it (my weapon.sp is a little diffrent, so I won't post it - but tested it with my weapons.sp)
Let me know if it works for you.
Attached Files
File Type: sp Get Plugin or Get Source (weapons.sp - 119 views - 93.0 KB)
__________________
root88 is offline
die_man
Senior Member
Join Date: Jul 2017
Old 08-31-2017 , 11:38   Re: [CS:GO] Deathmatch Goes Advanced (v0.13.8, 23/01/2016)
Reply With Quote #2332

Quote:
Originally Posted by root88 View Post
Warning: Only quick tested.
in deathmatch/weapons.sp, stock weapons_GivePlayerItem add in the beggining:
Code:
if(weaponId == 32)
    {
        new weaponEntity = GivePlayerItem(clientIndex, "weapon_hkp2000");
        return weaponEntity;
    }
Than recompile deathmatch.sp. I've attached weapons.sp with above modification - but I didn't test it (my weapon.sp is a little diffrent, so I won't post it - but tested it with my weapons.sp)
Let me know if it works for you.
Doesn't works.

When i select P2000, i receive a "fake" P2000, without ammo, arm dissapears and when i change to knife (e.g) the weapon disappears too.
Print: http://prntscr.com/gffzh1

Last edited by die_man; 08-31-2017 at 11:38.
die_man is offline
root88
Senior Member
Join Date: May 2016
Old 08-31-2017 , 12:09   Re: [CS:GO] Deathmatch Goes Advanced (v0.13.8, 23/01/2016)
Reply With Quote #2333

Well I've tested it only in situation when I have usp-s in inventory and I select p2000 on server (which gives me usp-s). Maybe I'll check that later.
__________________
root88 is offline
die_man
Senior Member
Join Date: Jul 2017
Old 08-31-2017 , 12:22   Re: [CS:GO] Deathmatch Goes Advanced (v0.13.8, 23/01/2016)
Reply With Quote #2334

Quote:
Originally Posted by root88 View Post
Well I've tested it only in situation when I have usp-s in inventory and I select p2000 on server (which gives me usp-s). Maybe I'll check that later.
I will wait
Thanks!
die_man is offline
root88
Senior Member
Join Date: May 2016
Old 09-02-2017 , 05:56   Re: [CS:GO] Deathmatch Goes Advanced (v0.13.8, 23/01/2016)
Reply With Quote #2335

Tested, 100% working for me:
in deathmatch/weapons.sp, stock weapons_GivePlayerItem change this:
PHP Code:
 // Some hacking to bypass inventory
    
if(weaponId NO_WEAPON_SELECTED && targetDefinitinIndex != GetEntProp(weaponEntityProp_Send"m_iItemDefinitionIndex")) 
to this:
PHP Code:
 // Some hacking to bypass inventory
    
if(weaponId != 32 && weaponId NO_WEAPON_SELECTED && targetDefinitinIndex != GetEntProp(weaponEntityProp_Send"m_iItemDefinitionIndex")) 
Attached weapons.sp with this modification.
You can test it on this server: 193.33.176.252:27015
Attached Files
File Type: sp Get Plugin or Get Source (weapons.sp - 99 views - 92.9 KB)
__________________
root88 is offline
die_man
Senior Member
Join Date: Jul 2017
Old 09-02-2017 , 12:48   Re: [CS:GO] Deathmatch Goes Advanced (v0.13.8, 23/01/2016)
Reply With Quote #2336

Quote:
Originally Posted by root88 View Post
Tested, 100% working for me:
in deathmatch/weapons.sp, stock weapons_GivePlayerItem change this:
PHP Code:
 // Some hacking to bypass inventory
    
if(weaponId NO_WEAPON_SELECTED && targetDefinitinIndex != GetEntProp(weaponEntityProp_Send"m_iItemDefinitionIndex")) 
to this:
PHP Code:
 // Some hacking to bypass inventory
    
if(weaponId != 32 && weaponId NO_WEAPON_SELECTED && targetDefinitinIndex != GetEntProp(weaponEntityProp_Send"m_iItemDefinitionIndex")) 
Attached weapons.sp with this modification.
You can test it on this server: 193.33.176.252:27015
If i have P2000 equipped, this edit works perfectly, thanks!

But if a player have USP-S equipped, only receive a USP-S in both menu options (USP and P2000), how can bypass the inventory and get the weapon selected ignoring the pistol the player have equipped?
die_man is offline
root88
Senior Member
Join Date: May 2016
Old 09-02-2017 , 13:00   Re: [CS:GO] Deathmatch Goes Advanced (v0.13.8, 23/01/2016)
Reply With Quote #2337

I don't think it's possible for now.
You can just add some info for players, so they know they should change it in their inventory. You can change .weaponName = "P2000" to .weaponName = "P2000/USP-S" too, which will be probably more understandable for players.
__________________
root88 is offline
root88
Senior Member
Join Date: May 2016
Old 09-02-2017 , 20:25   Re: [CS:GO] Deathmatch Goes Advanced (v0.13.8, 23/01/2016)
Reply With Quote #2338

It looks like setting m_iItemDefinitionIndex before DispatchSpawn fixes almost all problems.
in deathmatch/weapons.sp, stock weapons_GivePlayerItem change this (standard weapons.sp version):
PHP Code:
// Some hacking to bypass inventory
    
if(weaponId NO_WEAPON_SELECTED && targetDefinitinIndex != GetEntProp(weaponEntityProp_Send"m_iItemDefinitionIndex"))
    {
        
weapons_RemovePlayerWeapon(weaponEntityclientIndex);
        
// Weapon is removed on a timer to prevent crash
        
CreateTimer(0.2weapons_Timer_DelayedWeaponKillEntIndexToEntRef(weaponEntity));
        
        
weaponEntity CreateEntityByName(weaponEntityName);
        
DispatchSpawn(weaponEntity);
        
SetEntProp(weaponEntityProp_Send"m_iItemDefinitionIndex"targetDefinitinIndex);
        
EquipPlayerWeapon(clientIndexweaponEntity);
    } 
to this:
PHP Code:
// Some hacking to bypass inventory
    
if(weaponId NO_WEAPON_SELECTED && targetDefinitinIndex != GetEntProp(weaponEntityProp_Send"m_iItemDefinitionIndex"))
    {
        
weapons_RemovePlayerWeapon(weaponEntityclientIndex);
        
// Weapon is removed on a timer to prevent crash
        
CreateTimer(0.2weapons_Timer_DelayedWeaponKillEntIndexToEntRef(weaponEntity));
        
weaponEntity CreateEntityByName(weaponEntityName);
        
SetEntProp(weaponEntityProp_Send"m_iItemDefinitionIndex"targetDefinitinIndex);
        
DispatchSpawn(weaponEntity);
        
EquipPlayerWeapon(clientIndexweaponEntity);
    } 
Attached weapons.sp with this modification.

There is one bug however: skins for p2000 won't work if you have usp-s selected in inventory. I haven't tried to fix it yet.

Let me know if it works for you.
Attached Files
File Type: sp Get Plugin or Get Source (weapons.sp - 83 views - 92.8 KB)
__________________
root88 is offline
h3bus
AlliedModders Donor
Join Date: Nov 2013
Old 09-03-2017 , 04:40   Re: [CS:GO] Deathmatch Goes Advanced (v0.13.8, 23/01/2016)
Reply With Quote #2339

I didn't know you could set a netprop before spawn.

Anyway, if it is confirmed to work, this is a good find! Thank you!
h3bus is offline
Marounda
Senior Member
Join Date: Oct 2014
Old 09-03-2017 , 18:40   Re: [CS:GO] Deathmatch Goes Advanced (v0.13.8, 23/01/2016)
Reply With Quote #2340

Can someone give a "standard" compilated plugin with the fix plz ? =)
__________________
MER IL ET FOU's servers on our website : http://meriletfou.fr/


Marounda 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 22:19.


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