Raised This Month: $ Target: $400
 0% 

in game menu?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Stormsys
Member
Join Date: Oct 2005
Old 04-14-2006 , 17:22   in game menu?
Reply With Quote #1

Code:
//Show the client there information!\\//
//					
							snprintf(sPText, sizeof(sPText), "[Stormsys™ XP/WoW Mod]\n\nYour info:\nLevel %d\n%d XP", this->GetLVFromXP(PlayerXP), PlayerXP);					

							//show player info

		MRecipientFilter filter;
		filter.AddRecipient(this->getIndexFromUserID(m_Engine->GetPlayerUserId(pEntity)));
		bf_write *pBuffer = m_Engine->UserMessageBegin( &filter, 8 );
		pBuffer->WriteShort( (1<<0) ); //Sets how many options the menu has
		pBuffer->WriteChar( -1 ); //Sets how long the menu stays open -1 for stay until option selected
		pBuffer->WriteByte( false );
		pBuffer->WriteString( sPText ); //The text shown on the menu
		m_Engine->MessageEnd();

		m_Engine->ServerCommand("say should be showing now\n");







int SSExpMod::getIndexFromUserID(int userid)
{
	edict_t *player;
	for(int i = 1; i <= maxClients; i++)  //int maxplayers; has to be added after the includes and maxplayers=clientMax; in the ServerActivate function
	{
		player = 
			m_Engine->PEntityOfEntIndex(i);
		if(!player || player->IsFree() )
			continue;
		if(m_Engine->GetPlayerUserId(player) == userid)
			return i;
	}
	return -1;
}
could somone explane where i am gooing wrong herre?- it shows the
m_Engine->ServerCommand("say should be showing now\n");
but no menu ...

any help apriciated.

thanks
Stormsys is offline
Stormsys
Member
Join Date: Oct 2005
Old 04-14-2006 , 18:20  
Reply With Quote #2

also while this post is here, what is the correct way to set gravity i tryed pBase->SetGravity("100"); it actualy made it heavyer- i read something about some offset i cant find that anymore :/-

thx
Stormsys is offline
imported_hippo
Junior Member
Join Date: Mar 2006
Old 04-14-2006 , 18:33  
Reply With Quote #3

I hope you know most of the cbaseplayer stuff has been broken since last year...

You can scan for offsets by looping or by using mani's plugin and using the following cmds:

ma_offsetscan <look for value> <start offset> <end offset> (gives you offsets with that value)

ma_offset <offset> (returns value at offset)

I am guessing that you can: set server gravity to like 234, connect, then scan for the value of 234. Hopefully the server puts the server's global gravity into the individual player's entity. Either that or make sure you don't have 100 anywhere else in game (like player health, armor, etc) then scanf or 100.

Hippo
imported_hippo is offline
opi123
Junior Member
Join Date: Apr 2005
Old 04-15-2006 , 09:25  
Reply With Quote #4

bf_write *pBuffer = m_Engine->UserMessageBegin( &filter, 8 );

should be

bf_write *pBuffer = m_Engine->UserMessageBegin( &filter, 10 );
opi123 is offline
Stormsys
Member
Join Date: Oct 2005
Old 04-15-2006 , 10:45  
Reply With Quote #5

Quote:
Originally Posted by opi123
bf_write *pBuffer = m_Engine->UserMessageBegin( &filter, 8 );

should be

bf_write *pBuffer = m_Engine->UserMessageBegin( &filter, 10 );

Hey thanks verry much.

is there a way to phrase it for colour, like mani dose on the statme info heading's , its in orange- then it goes back to white for the info next header is in orange so on...

how could this be done

and one last thing:



thanks opi for help for far.
Quote:
else if ( FStrEq( pcmd, "menuselect" ) )
{
const char *parameter = engine->Cmd_Argv(1);
switch(atoi(parameter))
{
case 1:
engine->ClientCommand (pEntity, "buy m4a1;buy ak47;buy primammo;buy vesthelm;buy deagle;buy secammo;buy flashbang;buy hegrenade;buy flashbang\n");
break;
now wouild i get this to identify if its menu 1 or menu 2 on my application?
Stormsys is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 04-16-2006 , 00:00  
Reply With Quote #6

Gravity is a percent of normal, so 0.5 would be 50% (400 on a sv_gravity 800 setting). Your setting of 100.0 would be a 10,000% increase.
L. Duke is offline
Stormsys
Member
Join Date: Oct 2005
Old 04-16-2006 , 04:30  
Reply With Quote #7

Quote:
Originally Posted by L. Duke
Gravity is a percent of normal, so 0.5 would be 50% (400 on a sv_gravity 800 setting). Your setting of 100.0 would be a 10,000% increase.
whoa silly me=) thanks a bunch, so using that would i be able to gert the current server gravity so i can do newgravity / server grav?
Stormsys is offline
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 04-16-2006 , 04:49  
Reply With Quote #8

Quote:
Originally Posted by Storm™
Quote:
Originally Posted by L. Duke
Gravity is a percent of normal, so 0.5 would be 50% (400 on a sv_gravity 800 setting). Your setting of 100.0 would be a 10,000% increase.
whoa silly me=) thanks a bunch, so using that would i be able to gert the current server gravity so i can do newgravity / server grav?
m_Engine->ServerCommand( "sv_gravity 800\n" );

CBaseEntity::SetGravity I am presuming, would set the gravity for that CBaseEntity. So no, you cannot use that method to set or get the server gravity.
You also are in need of this link.
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
Stormsys
Member
Join Date: Oct 2005
Old 04-16-2006 , 04:55  
Reply With Quote #9

what i mean is like lduke said SetGravity = a percentage of the server gravity

i have my app set so the user chooses the ggravity level, for eg. user sets GravLv to 200- i would do SetGravity (GravLv / *function to get server gravity*)
Stormsys is offline
sslice
Senior Member
Join Date: Feb 2005
Location: Texas, USA
Old 04-16-2006 , 14:02  
Reply With Quote #10

You can do something like SetGravity(grav / 800.0f) so you can use the same scale that sv_gravity uses but still give a correct percentage for the SetGravity function to use...
__________________
sslice 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 10:11.


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