AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to get player's current weapon model (https://forums.alliedmods.net/showthread.php?t=308378)

sekac 06-18-2018 09:36

How to get player's current weapon model
 
I want to know how to get the model of a weapon that a player is currently holding. I don't need a weapon name, just model, since I want it to work with custom weapons too.

OciXCrom 06-18-2018 10:28

Re: How to get player's current weapon model
 
PHP Code:

new szWeapon[128]
pev(idpev_viewmodel2szWeaponcharsmax(szWeapon)) 


sekac 06-18-2018 11:28

Re: How to get player's current weapon model
 
Thank you.

Is it possible to count how many P_MODELS a player has active at once? Since I am displaying multiple P_MODELS on a player but I don't know how to get that number.

HamletEagle 06-18-2018 11:45

Re: How to get player's current weapon model
 
Quote:

Originally Posted by sekac (Post 2597734)
Thank you.

Is it possible to count how many P_MODELS a player has active at once? Since I am displaying multiple P_MODELS on a player but I don't know how to get that number.

How are you exactly displaying multiple p models?

sekac 06-18-2018 12:05

Re: How to get player's current weapon model
 
Well I didn't write the plugin so I don't know. But I can see bots holding two overlayed weapons and I can hide each of them separately, so I figured it's possible. The second weapon is the same as the player's current weapon (same P_MODEL) so that might be how.

OciXCrom 06-18-2018 13:09

Re: How to get player's current weapon model
 
I don't think having more than one model active at the same time is possible.

sekac 06-18-2018 13:26

Re: How to get player's current weapon model
 
Quote:

Originally Posted by OciXCrom (Post 2597751)
I don't think having more than one model active at the same time is possible.

I will open a thread about this, it's a bug in a plugin that I need fixed.

Edit: https://forums.alliedmods.net/showthread.php?p=2597761


All times are GMT -4. The time now is 12:23.

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