Raised This Month: $32 Target: $400
 8% 

Spawn Events without spawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OneMore
Senior Member
Join Date: Feb 2019
Old 06-04-2022 , 22:19   Spawn Events without spawn
Reply With Quote #1

When a player connects to a CS:GO server he sees options on which team to choose.
I hooked:
player_spawn
SDKHook_SpawnPost

All these events happen after the connection before the player choose a team. I don't know why We use the GunGame plugin.

Could you please advise how to be sure that the player chose T, CT or went to spectators?
I tried "switch_team", but it does not have user_id in the event's data.
I mean I need to do some actions after the player chooses a team or to be a spectator.
OneMore is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-08-2022 , 12:09   Re: Spawn Events without spawn
Reply With Quote #2

Quote:
Originally Posted by OneMore View Post
When a player connects to a CS:GO server he sees options on which team to choose.
I hooked:
player_spawn
SDKHook_SpawnPost

All these events happen after the connection before the player choose a team. I don't know why We use the GunGame plugin.

Could you please advise how to be sure that the player chose T, CT or went to spectators?
I tried "switch_team", but it does not have user_id in the event's data.
I mean I need to do some actions after the player chooses a team or to be a spectator.

I would imagine IsPlayerAlive must be true in player_spawn to continue the code.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
OneMore
Senior Member
Join Date: Feb 2019
Old 06-08-2022 , 18:08   Re: Spawn Events without spawn
Reply With Quote #3

Quote:
Originally Posted by eyal282 View Post
I would imagine IsPlayerAlive must be true in player_spawn to continue the code.
This is the good idea, thank you. I’ll check it whether it works. I thought that during the spawn event the player is not entirely alive
I set a small timer in onclientpostadmincheck which skips the first false spawn. But your solution is more universal and clean.
OneMore is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 06-09-2022 , 17:46   Re: Spawn Events without spawn
Reply With Quote #4

What about "player_team" event?
cravenge is offline
OneMore
Senior Member
Join Date: Feb 2019
Old 06-09-2022 , 19:00   Re: Spawn Events without spawn
Reply With Quote #5

Quote:
Originally Posted by cravenge View Post
What about "player_team" event?
My bad, I checked events only on CS:GO events list page. It looks promising but needs to be investigated further.

But I will add to spawn event the check whether the player is alive anyway. It is useful because I was wondering why some operations were fulfilled twice. Now I understand it better.
OneMore is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-10-2022 , 06:45   Re: Spawn Events without spawn
Reply With Quote #6

Quote:
Originally Posted by cravenge View Post
What about "player_team" event?
I don't think player_team fires as a player_spawn event.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 06-10-2022 , 11:38   Re: Spawn Events without spawn
Reply With Quote #7

On event player_spawn, use GetClientTeam,
you get player current team.

When player enter in server, he will spawn in unknow team (team index 0)
Bacardi is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 06-10-2022 , 18:01   Re: Spawn Events without spawn
Reply With Quote #8

Quote:
Originally Posted by eyal282 View Post
I don't think player_team fires as a player_spawn event.
I was referring to this:
Quote:
Originally Posted by OneMore View Post
Could you please advise how to be sure that the player chose T, CT or went to spectators?
I tried "switch_team", but it does not have user_id in the event's data.
I mean I need to do some actions after the player chooses a team or to be a spectator.
cravenge 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 04:20.


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