Raised This Month: $ Target: $400
 0% 

Menu Close + pev_viewmodel2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 11-27-2017 , 13:04   Menu Close + pev_viewmodel2
Reply With Quote #1

Hello, i have 2 questions

1. How do i close a users menu.

2. I use
PHP Code:
public Event_CurWeaponid 
        
set_pevidpev_viewmodel2vUspModel ); 
to set a users model, but the first "FIRE" every once in a while, doesn't have an animation, after that everything is fine. Do any of you recognize this bug ?

THanks in advance.
maqi is offline
TheWhitesmith
Senior Member
Join Date: Oct 2017
Location: Morocco :c
Old 11-27-2017 , 14:08   Re: Menu Close + pev_viewmodel2
Reply With Quote #2

1. menu_cancel(id) (The menu may still show for the player but they will be forced to choose MENU_EXIT)
2. entity_set_string( id , EV_SZ_viewmodel , vUspModel ) (This works fine for me, I never used set_pev so I have no idea why it does not have an animation)
__________________
TheWhitesmith is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 11-27-2017 , 15:22   Re: Menu Close + pev_viewmodel2
Reply With Quote #3

Thank you for your response
1. I know about the menu_cancel and menu_destroy, but what i actually need is a menu not being visible anymore. I think i found a solution, with creating a new/blank menu, like show_menu(id, 0, "\n", 1); to overlap the existing one. Ill test it out later.

2. Ill try that out, but would still like another input about this because i've seen a lot of people using set_pev and not having such an issue, hell, even another plugin on my server is using set_pev and its working fine there. Maybe its the skin or something else, im not sure...

Last edited by maqi; 11-27-2017 at 15:26.
maqi is offline
TheWhitesmith
Senior Member
Join Date: Oct 2017
Location: Morocco :c
Old 11-27-2017 , 15:35   Re: Menu Close + pev_viewmodel2
Reply With Quote #4

Try changing the model while keeping the same code and try again.
__________________
TheWhitesmith is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 11-27-2017 , 15:37   Re: Menu Close + pev_viewmodel2
Reply With Quote #5

Makes sense, will do, but i don't think its connected to a model, worth a try tho.
maqi is offline
TheWhitesmith
Senior Member
Join Date: Oct 2017
Location: Morocco :c
Old 11-27-2017 , 15:56   Re: Menu Close + pev_viewmodel2
Reply With Quote #6

Quote:
Originally Posted by maqi View Post
i don't think its connected to a model
Neither do I.
__________________
TheWhitesmith is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-27-2017 , 17:25   Re: Menu Close + pev_viewmodel2
Reply With Quote #7

1. To close a user menu just display him an empty menu with no keys

2. Hook ham_item_deploy post to change user weapon model... Instead of hooking event curweapon
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 11-28-2017 , 09:51   Re: Menu Close + pev_viewmodel2
Reply With Quote #8

Menu closing is working perfectly. And for the model, i cant seem to hook it on ham_item_deploy, but anyway my method is working perfectly, except that one bug, i thought ill ask
maqi is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-28-2017 , 11:20   Re: Menu Close + pev_viewmodel2
Reply With Quote #9

Quote:
Originally Posted by maqi View Post
Menu closing is working perfectly. And for the model, i cant seem to hook it on ham_item_deploy, but anyway my method is working perfectly, except that one bug, i thought ill ask
If it works it doesn't mean it's good. Look into Ham_Item_Deploy and show us what you tried.
__________________
HamletEagle is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 11-28-2017 , 11:41   Re: Menu Close + pev_viewmodel2
Reply With Quote #10

PHP Code:
RegisterHam(Ham_Item_Deploy"weapon_usp""ModelChange"1)

public 
ModelChange(id)
{
        
set_pevidpev_viewmodel2vUspModel );
    
set_pevidpev_weaponmodel2pUspModel );

maqi 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 06:12.


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