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

2 menu & IsDead() Prob


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jeanlepail
Member
Join Date: Nov 2005
Location: Paris France
Old 08-03-2006 , 10:02   2 menu & IsDead() Prob
Reply With Quote #1

Hi everyone, i am trying to add menus to my plugin, that work great, but i have 2 menu and both return to "menuselect" function, so, how i do to have different "menuselect" for my menu ? thanks

PS: how i do red Option like Mani done ? thanks

--------------------- Other Probleme ---------------------------
when i call info->IsDead() the game just crash, how i can fix it ? thanks
__________________
TK's Management : Finish
Bet Plugin : 90 %

Last edited by jeanlepail; 08-03-2006 at 10:05.
jeanlepail is offline
Send a message via AIM to jeanlepail Send a message via MSN to jeanlepail
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 08-03-2006 , 10:07   Re: 2 menu & IsDead() Prob
Reply With Quote #2

What I do is create a "menu manager" that remembers (for each player) what menu has been displayed and for how long it was set to be shown. When a "menuselect" command comes in, I check if a menu is active for that player and if it is within the allowed time. If not, ignore it because it's probably from Mani or another plugin. You should also set a reasonable time for it to show to limit problems. I usually use 15 seconds.

I think the colored lines are created by adding "->" to the beginning of the line.
L. Duke is offline
jeanlepail
Member
Join Date: Nov 2005
Location: Paris France
Old 08-03-2006 , 10:38   Re: 2 menu & IsDead() Prob
Reply With Quote #3

Thanks a lot LDuke
add karma : the colored menu work thanks
__________________
TK's Management : Finish
Bet Plugin : 90 %

Last edited by jeanlepail; 08-03-2006 at 10:46.
jeanlepail is offline
Send a message via AIM to jeanlepail Send a message via MSN to jeanlepail
BAILOPAN
Join Date: Jan 2004
Old 08-03-2006 , 14:01   Re: 2 menu & IsDead() Prob
Reply With Quote #4

Don't get an IPlayerInfo pointer before the client has been PutInServer
__________________
egg
BAILOPAN is offline
jeanlepail
Member
Join Date: Nov 2005
Location: Paris France
Old 08-03-2006 , 17:26   Re: 2 menu & IsDead() Prob
Reply With Quote #5

i use it in firegame event, when i use GetUserID that work good, but when i use IsDead() that crash
__________________
TK's Management : Finish
Bet Plugin : 90 %
jeanlepail is offline
Send a message via AIM to jeanlepail Send a message via MSN to jeanlepail
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 08-03-2006 , 17:47   Re: 2 menu & IsDead() Prob
Reply With Quote #6

IVEngineServer::GetPlayerUserId(pEntity)
IServerGameClients::GetPlayerState(pEntity)->deadflag

ftw

(Have I mentioned that IPlayerInfo sucks and I refuse to use it?)



Last edited by L. Duke; 08-03-2006 at 17:51.
L. Duke is offline
jeanlepail
Member
Join Date: Nov 2005
Location: Paris France
Old 08-04-2006 , 05:38   Re: 2 menu & IsDead() Prob
Reply With Quote #7

i tried : Crash too
__________________
TK's Management : Finish
Bet Plugin : 90 %
jeanlepail is offline
Send a message via AIM to jeanlepail Send a message via MSN to jeanlepail
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 08-04-2006 , 09:07   Re: 2 menu & IsDead() Prob
Reply With Quote #8

In that case I would guess that the pointer is somehow invalid. Which event are you doing this in? How are you getting the edict_t* from the user ID?
L. Duke is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 08-04-2006 , 09:49   Re: 2 menu & IsDead() Prob
Reply With Quote #9

Could you just show us the code that isn't working? Rather then guess what you have done and why it doesn't work?
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
jeanlepail
Member
Join Date: Nov 2005
Location: Paris France
Old 08-04-2006 , 15:09   Re: 2 menu & IsDead() Prob
Reply With Quote #10

just to try it :

if(FStrEq(pcmd,"jean"))
{
IServerGameClients * pInfo;
Warning("= %i =",pInfo->GetPlayerState(pEntity)->deadflag);
}

in client command
__________________
TK's Management : Finish
Bet Plugin : 90 %
jeanlepail is offline
Send a message via AIM to jeanlepail Send a message via MSN to jeanlepail
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 05:22.


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