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

[HELP] cs_set_user_team / jointeam - joinclass


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-19-2017 , 17:44   [HELP] cs_set_user_team / jointeam - joinclass
Reply With Quote #1

I know that using cs_set_user_team on a player who haven't yet selected a team and a class will not work properly because some required fields by the game are not yet set

I was wondering what those fields are, and if it is possible to set them manually from a plugin
__________________

Last edited by Depresie; 09-19-2017 at 17:45.
Depresie is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 09-19-2017 , 18:03   Re: [HELP] cs_set_user_team / jointeam - joinclass
Reply With Quote #2

If the user haven't selected a team, then the result must be CS_TEAM_UNASSIGNED which is 0.
KiLLeR. is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-20-2017 , 04:46   Re: [HELP] cs_set_user_team / jointeam - joinclass
Reply With Quote #3

You didn't understand my point... read again
__________________
Depresie is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 09-20-2017 , 06:20   Re: [HELP] cs_set_user_team / jointeam - joinclass
Reply With Quote #4

Why setting fields manually if you can just force engine to join team and joinclass.
Or maybe you want just to know which are those fields so you can use them in other purposes?
siriusmd99 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-20-2017 , 09:13   Re: [HELP] cs_set_user_team / jointeam - joinclass
Reply With Quote #5

Quote:
Originally Posted by siriusmd99 View Post
Why setting fields manually if you can just force engine to join team and joinclass.
This. Anyway, see by yourself what game does:
Choose team: https://github.com/s1lentq/ReGameDLL...ient.cpp#L1491
Choose class:
https://github.com/s1lentq/ReGameDLL...ient.cpp#L1330
__________________
HamletEagle is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-20-2017 , 12:30   Re: [HELP] cs_set_user_team / jointeam - joinclass
Reply With Quote #6

do you mind explaining me what this does "->"
PHP Code:
player->m_flRadioTime gpGlobals->time 1.5f
__________________
Depresie is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 09-20-2017 , 13:17   Re: [HELP] cs_set_user_team / jointeam - joinclass
Reply With Quote #7

Member access operator. Accesses a class/struct member.
klippy is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-20-2017 , 18:15   Re: [HELP] cs_set_user_team / jointeam - joinclass
Reply With Quote #8

Still don't get what's "missing" any ideas what is missing that renders the player frozen and being teleported around by the "unassigned camera"?
__________________
Depresie is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-21-2017 , 11:41   Re: [HELP] cs_set_user_team / jointeam - joinclass
Reply With Quote #9

https://github.com/s1lentq/ReGameDLL...ayer.cpp#L3444

Set m_iJoiningState offset.

Code:
player->m_flRadioTime = gpGlobals->time + 1.5f;
In simple words it sets m_flRadioTime offset on the "player" entity. It's like you would do set_pdata_float(player, m_flRadioTime, ...).
__________________

Last edited by HamletEagle; 09-21-2017 at 11:42.
HamletEagle is offline
Reply


Thread Tools
Display Modes

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 02:51.


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