AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Get team of disconnected player (https://forums.alliedmods.net/showthread.php?t=308143)

iceeedr 06-08-2018 09:46

Get team of disconnected player
 
Hello, how are you? I hope it is..
Is there any way to get the team of the player that just left on the client_disconnect?
I'm using amx 1.8.3

Relaxing 06-08-2018 11:11

Re: Get team of disconnected player
 
Code:
public client_disconnected(id)     client_print(0, 3, "%i", cs_get_user_team(id));

iceeedr 06-08-2018 11:15

Re: Get team of disconnected player
 
Quote:

Originally Posted by Relaxing (Post 2595836)
Code:
public client_disconnected(id)     client_print(0, 3, "%i", cs_get_user_team(id));

Wow, I never thought of that? Please relaxing, just come post something if in fact it is for help, if you do not go, dispense.

L 06/08/2018 - 00:16:42: [AMXX] [0] disconnect.sma::client_disconnected (line 2132)
L 06/08/2018 - 00:20:51: [CSTRIKE] Invalid player 3
L 06/08/2018 - 00:20:51: [AMXX] Displaying debug trace (plugin "disconnect.amxx", version "13.0")
L 06/08/2018 - 00:20:51: [AMXX] Run time error 10: native error (native "cs_get_user_team")

CrazY. 06-08-2018 11:41

Re: Get team of disconnected player
 
Code:
#include <amxmodx> #include <cstrike> #include <fakemeta> public plugin_init() {     register_plugin("Get team on disconnect", "1.0", "Unknown");     register_forward(FM_ClientDisconnect, "fw_ClientDisconnect_Pre"); } public fw_ClientDisconnect_Pre(pPlayer) {     new CsTeams:iTeam = cs_get_user_team(pPlayer);     client_print(0, print_chat, "Team: %s", iTeam == CS_TEAM_T ? "TERRORIST" : "CT"); }

Or just use client_disconnected forward in AMx Mod X 1.8.3.

iceeedr 06-08-2018 11:53

Re: Get team of disconnected player
 
Quote:

Originally Posted by CrazY. (Post 2595841)
Code:
#include <amxmodx> #include <cstrike> #include <fakemeta> public plugin_init() {     register_plugin("Get team on disconnect", "1.0", "Unknown");     register_forward(FM_ClientDisconnect, "fw_ClientDisconnect_Pre"); } public fw_ClientDisconnect_Pre(pPlayer) {     new CsTeams:iTeam = cs_get_user_team(pPlayer);     client_print(0, print_chat, "Team: %s", iTeam == CS_TEAM_T ? "TERRORIST" : "CT"); }

Or just use client_disconnected forward in AMx Mod X 1.8.3.

With the disconnected forward I'm getting invalid player..Will test with fakemeta thanks

Relaxing 06-08-2018 12:00

Re: Get team of disconnected player
 
I still wonder what's wrong with that.

instinctpt1 06-08-2018 12:00

Re: Get team of disconnected player
 
Quote:

Originally Posted by Relaxing (Post 2595836)
Code:
public client_disconnected(id)     client_print(0, 3, "%i", cs_get_user_team(id));

PHP Code:

public client_disconnected(id)
    
client_print(03"%i"get_user_team(id)); 

Corrected * ( Just a lil )

^SmileY 06-08-2018 12:19

Re: Get team of disconnected player
 
it shoud be client_disconnectex since entity it alread removed on client_disconnected

@iceeedr


KKKK

iceeedr 06-08-2018 22:04

Re: Get team of disconnected player
 
Quote:

Originally Posted by CrazY. (Post 2595841)
Code:
#include <amxmodx> #include <cstrike> #include <fakemeta> public plugin_init() {     register_plugin("Get team on disconnect", "1.0", "Unknown");     register_forward(FM_ClientDisconnect, "fw_ClientDisconnect_Pre"); } public fw_ClientDisconnect_Pre(pPlayer) {     new CsTeams:iTeam = cs_get_user_team(pPlayer);     client_print(0, print_chat, "Team: %s", iTeam == CS_TEAM_T ? "TERRORIST" : "CT"); }

Or just use client_disconnected forward in AMx Mod X 1.8.3.

I have tried client_disconnect, client_disconnected (id), client_disconnected (id, bool: drop, message [], len), and now the method with fakemeta, and the result is always this log.

L 06/08/2018 - 21:59:16: [CSTRIKE] Invalid player 4
L 06/08/2018 - 21:59:16: [AMXX] Displaying debug trace (plugin "disconnect.amxx", version "13.0")
L 06/08/2018 - 21:59:16: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 06/08/2018 - 21:59:16: [AMXX] [0] disconnect.amxx::fw_ClientDisconnect_Pre (line 2105)

instinctpt1 06-09-2018 00:33

Re: Get team of disconnected player
 
Have u tried one which i corrected above ?
The one by relaxing... Try that with 183


All times are GMT -4. The time now is 04:39.

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