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

[Solved][CS:GO] Carrying more nades, How to do?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DSASDFGH
Senior Member
Join Date: Jul 2011
Location: Facebook
Old 04-29-2015 , 11:05   [Solved][CS:GO] Carrying more nades, How to do?
Reply With Quote #1

OK, I used this code at CS:S Server for carrying more grenades, But not works on CS:GO completly

How can i fix this?

PHP Code:
public Action:Clcmd_BuyHe(idargs)
{
 
// 유저 유효성 검사
 
if(id >= && id <= MaxClients)
 {
  if(
IsClientConnected(id) && IsClientInGame(id))
  {
   
// 탄약팩이 5이상, 살아있는 유저
   
if(zp_get_user_ammo_packs(id) > && IsPlayerAlive(id))
   {
    
/* OK, This part is give the nades to client, But not works */
    
new offset2 FindDataMapOffs(id,"m_iAmmo")+(4*11);
    new 
current2 GetEntData(id,offset2,4);
    if (
current2 == 0)  GivePlayerItem(id"weapon_hegrenade");
    
SetEntData(id,offset2,current2+5);  
 
    
// 탄약팩 감소,
    
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) - 5);
   }
  }
 }

__________________
Learning SourceMod is happy

Last edited by DSASDFGH; 04-29-2015 at 13:35.
DSASDFGH is offline
sejin513
AlliedModders Donor
Join Date: Dec 2008
Location: ._.
Old 04-29-2015 , 12:40   Re: [CS:GO] Carrying more nades, How to do?
Reply With Quote #2

Try to set 14*4 on offset
sejin513 is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 04-29-2015 , 13:22   Re: [CS:GO] Carrying more nades, How to do?
Reply With Quote #3

Check how I do it in my CS:GO GrenadePack 2 plugin
__________________
View my Plugins | Donate
TnTSCS is offline
DSASDFGH
Senior Member
Join Date: Jul 2011
Location: Facebook
Old 04-29-2015 , 13:35   Re: [CS:GO] Carrying more nades, How to do?
Reply With Quote #4

How i fixed:

PHP Code:
    new offset2 FindDataMapOffs(id,"m_iAmmo")+(4*11);
    new 
current2 GetEntData(id,offset2,4);
    if (
current2 == 0)  GivePlayerItem(id"weapon_hegrenade");
    
SetEntData(id,offset2,current2+5); 


to

PHP Code:
    new offset2 FindDataMapOffs(id,"m_iAmmo")+(4*14);
    new 
current2 GetEntData(id,offset2,4);
    if (
current2 == 0)  GivePlayerItem(id"weapon_hegrenade");
    else 
SetEntData(id,offset2,current2+1); 


The offset of grenades start with 14
4*14 = HEGrenade
4*15 = Flashbang
4*16 = SmokeGrenade
4*17 = Inc blabla
4*18 = DecoyNade
__________________
Learning SourceMod is happy

Last edited by DSASDFGH; 04-29-2015 at 13:38.
DSASDFGH 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 09:45.


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