Raised This Month: $ Target: $400
 0% 

Solved Get team of disconnected player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 06-09-2018 , 00:33   Re: Get team of disconnected player
Reply With Quote #1

Have u tried one which i corrected above ?
The one by relaxing... Try that with 183
instinctpt1 is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 06-09-2018 , 09:43   Re: Get team of disconnected player
Reply With Quote #2

Quote:
Originally Posted by instinctpt1 View Post
Have u tried one which i corrected above ?
The one by relaxing... Try that with 183
Yes I tried, nothing appears in the chat.
iceeedr is offline
Send a message via Skype™ to iceeedr
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 06-09-2018 , 10:14   Re: Get team of disconnected player
Reply With Quote #3

Quote:
Originally Posted by iceeedr View Post
Yes I tried, nothing appears in the chat.
Common brother... i tested myself
There must be numbers appearing in chat
1 = Terror
2 = CT

Run plugin, go to your server, kick someone ..
instinctpt1 is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 06-09-2018 , 10:37   Re: Get team of disconnected player
Reply With Quote #4

Quote:
Originally Posted by instinctpt1 View Post
Common brother... i tested myself
There must be numbers appearing in chat
1 = Terror
2 = CT

Run plugin, go to your server, kick someone ..
Ok, my mistake .. I was trying to kick the bot..not going to show up even kkkkk. But that was exactly what I was doing and I'm getting a log, see how I used it.

PHP Code:
if(g_dUserData[id][bSurrender])
{
        new 
CsTeams:Team cs_get_user_team(id)
        switch(
Team
        { 
            case 
CS_TEAM_TSurrenderTr --     
            case 
CS_TEAM_CTSurrenderCt--
    
        }
        
g_dUserData[id][bSurrender] = false

SurrenderXX is just a variable that I increase by +1 when calling and decreasing when the player exits, however in the disconnect I get invalid player.

Last edited by iceeedr; 06-09-2018 at 10:38.
iceeedr is offline
Send a message via Skype™ to iceeedr
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-09-2018 , 10:40   Re: Get team of disconnected player
Reply With Quote #5

Use client_disconnect() instead of client_disconnected() and you will be fine.

PHP Code:
public client_disconnectid )
{
    
server_print"team=%d" cs_get_user_teamid ) );

My server console:
Code:
team=1
__________________
Bugsy is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 06-09-2018 , 10:46   Re: Get team of disconnected player
Reply With Quote #6

Quote:
Originally Posted by Bugsy View Post
Use client_disconnect() instead of client_disconnected() and you will be fine.

PHP Code:
public client_disconnectid )
{
    
server_print"team=%d" cs_get_user_teamid ) );

My server console:
Code:
team=1
The console prints the number, but when I tried my above code I get invalid player...any idea?

Last edited by iceeedr; 06-09-2018 at 10:46.
iceeedr is offline
Send a message via Skype™ to iceeedr
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 04:39.


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