Raised This Month: $ Target: $400
 0% 

[CS:GO] get players' grenades


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rodpod
SourceMod Donor
Join Date: Jan 2005
Old 12-07-2014 , 05:55   [CS:GO] get players' grenades
Reply With Quote #1

Hi guys. I'm in the dark with this one. I need to get players' grenades that he's carrying atm. cstrike.inc has only this output:
Code:
#define CS_SLOT_GRENADE         3       /**< Grenade slot (will only return one grenade). */
Is there a way to cycle through all of them or do I need to search for prop indexes assignes to the player (that one boggles my mind...)

In-game grenades have their own slots and a slot that switches between them. That confuses me.
rodpod is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 12-07-2014 , 13:32   Re: [CS:GO] get players' grenades
Reply With Quote #2

Code:
new wep = -1;
while(GetPlayerWeaponSlot(client, 3) != -1) {
    // do stuff which each grenade.
}
Mitchell is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 12-08-2014 , 18:16   Re: [CS:GO] get players' grenades
Reply With Quote #3

wouldn't that be stuck into a infinite loop since GetPlayerWeaponSlot only return the first one? Removing it and regiving it would be a solution but I am sure there is NetProps that is storing the grenades.
Mathias. is offline
rodpod
SourceMod Donor
Join Date: Jan 2005
Old 12-09-2014 , 03:44   Re: [CS:GO] get players' grenades
Reply With Quote #4

the only thing that would keep track of players' grenades at this point would be to check what player has bought, picked up or received from plugins' perspective. I need to look at this matter... csgo sucks in comparison to css. you can't even use custom sounds as easy as in previous source engine.
rodpod is offline
h3bus
AlliedModders Donor
Join Date: Nov 2013
Old 12-09-2014 , 06:07   Re: [CS:GO] get players' grenades
Reply With Quote #5

There is another solution, dumping m_hMyWeapons and check each one on a loop to see if it is a nade.
h3bus is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 12-09-2014 , 12:06   Re: [CS:GO] get players' grenades
Reply With Quote #6

indeed cs:go is a terrible game, I even went back to 1.6 lol but grenades are the same in css. there is a netprops that you can loop and check every single item and I think h3bus point it out the one I was talking about.

Last edited by Mathias.; 12-09-2014 at 12:08.
Mathias. is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 12-09-2014 , 13:48   Re: [CS:GO] get players' grenades
Reply With Quote #7

Quote:
Originally Posted by Black-Rabbit View Post
indeed cs:go is a terrible game, I even went back to 1.6 lol ...
Actually i found cs:go to have more of an opportunity to spread creativity among gamemodes. Everybody just complains about the minor flaws. Which existed in the game for over a year now. And it hasn't stopped modders from creating different game modes.
(Not to mention the insane amount of props that they have already in the game, although it would be nice if you could use hl2 props in the game by default.)
Mitchell is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 12-09-2014 , 16:38   Re: [CS:GO] get players' grenades
Reply With Quote #8

there is almost no go community, matchmaking killed the communities, it will never be like before. On top of that the game in my opinion is not consistent. Pros got forced to move on it because of sponsors, pretty sure most of them still prefer the old stuff but they have to do their job, no wonder why they actually start to cheat.

Last edited by Mathias.; 12-09-2014 at 16:38.
Mathias. is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 12-09-2014 , 17:38   Re: [CS:GO] get players' grenades
Reply With Quote #9

The server browser imo never worked correctly, it would rape the user's internet searching for servers.
I wonder why no one has made a site with a UI to find servers for the community.
Mitchell is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 12-10-2014 , 13:11   Re: [CS:GO] get players' grenades
Reply With Quote #10

gametracker lol
Mathias. 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 21:34.


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