Raised This Month: $ Target: $400
 0% 

Setting team with fakemeta


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 06-28-2007 , 13:39   Setting team with fakemeta
Reply With Quote #1

I'm having trouble setting a users team in Counter-Strike with fakemeta.

I tried usingthe following to set to terrorist...
set_pev(id, pev_team, 1);

... but that didn't work.

Can someone let me knowhow to do this please?
hlstriker is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 06-28-2007 , 14:34   Re: Setting team with fakemeta
Reply With Quote #2

Take a look at the source code to cs_set_user_team. It appears that there are a few private data offsets that you have to update in the player.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 06-28-2007 , 15:15   Re: Setting team with fakemeta
Reply With Quote #3

Quote:
Can someone let me knowhow to do this please?
The below line should do that
PHP Code:
set_pdata_int(player_index_here114team_index_here
This will not update the scoreboard. You have to send corresponding TeamInfo message to do that.

Last edited by VEN; 06-28-2007 at 15:19.
VEN is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 06-28-2007 , 15:37   Re: Setting team with fakemeta
Reply With Quote #4

Thanks that works perfect.

Are there any good threads telling how pdata works? I tried searching but failed to find anything.

I would really like to understand what pdata is, and how it works, and where to get the offsets (whatever they are!).
hlstriker is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 06-28-2007 , 22:06   Re: Setting team with fakemeta
Reply With Quote #5

I needed this to make custom team menus. I blocked the VGUI and text menu and created my own text menu.

Here is a problem though. When someone using VGUI menus tries to select a team, it doesn't set them on a team. If they are using the text menu style, then it works fine. The funny thing is that I made it so when a team was selected it would also print a message. The message prints, but the team doesn't change.

I'm testing this on a linux server, do you think the offset would have something to do with it?
hlstriker is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 06-29-2007 , 06:14   Re: Setting team with fakemeta
Reply With Quote #6

The offset depends on the CPU type if it is a 32 or 64 bit CPU
and the OS...windows and linux have different offsets...
In the pdata natives there is a parameter for the linux offset difference.
Code:
#if cellbits == 32
    #define OFFSET_ARMORTYPE 112
#else
    #define OFFSET_ARMORTYPE 137
#endif
#define OFFSET_LINUX 5


....
...
if(!get_pdata_int(id, OFFSET_ARMORTYPE, OFFSET_LINUX)) set_realarmor(id);

....
....

//+++++ Manipulate the user armor ++++++
set_realarmor(id, armor=2)
{
    if(is_module_loaded("cstrike") != -1)
    {
        set_pdata_int(id, OFFSET_ARMORTYPE, armor, OFFSET_LINUX);
        message_begin(MSG_ONE, g_umsgA, {0,0,0}, id);
        write_byte(1);
        message_end();
    }
}
Hope that helps you a bit ;)

greetz regalis
__________________
regalis 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 15:40.


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