Raised This Month: $67 Target: $400
 16% 

[CS:GO] Problem with my array to save a last player disconnect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SnMaxx
Junior Member
Join Date: Jun 2014
Old 06-05-2017 , 14:36   [CS:GO] Problem with my array to save a last player disconnect
Reply With Quote #1

Hi, im have a problem with my plugin.

If nobody was disconnected
] sm_last
No se desconecto ningun jugador en este mapa!

If someone disconnects
] sm_last
Unknown command: sm_last

Code:
SourcePawn Compiler 1.7.1
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2014 AlliedModders LLC

/home/groups/sourcemod/upload_tmp/phpjiIlMy.sp(39) : warning 213: tag mismatch (Info[j][LastID]=GetSteamAccountID(client);)
Code size:             3348 bytes
Data size:            18592 bytes
Stack/heap size:      16384 bytes
Total requirements:   38324 bytes

1 Warning.
Code:
#include <sourcemod>


int j=0;//cantidad de jugadores desconectados

public Plugin myinfo ={
	name = "sm_last",
	author = "SnMaxx",
	description = "Ultimos jugadores desconectados",
	version = "1.0",
	url = "http://www.sourcemod.net/"
};

public void OnPluginStart(){	
	RegConsoleCmd("sm_last", print_lastdisconnect);
	
}

enum pInfo{
	string:LastID[30],
	string:LastNM[50],
};

new Info[50][pInfo];

public Action:print_lastdisconnect(int client, int args){
	if(j==0){
		PrintToConsole(client, "No se desconecto ningun jugador en este mapa!");
		return Plugin_Handled;
	}
	for(int i=0;i<j;i++){
		PrintToConsole(client,"%s",Info[i-1][LastID]);
	}
	return Plugin_Handled;
}

public void OnClientDisconnect(int client){
	
	Info[j][LastID]=GetSteamAccountID(client);
	j++;
}
Sorry for my bad english, and thanks
SnMaxx is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 06-05-2017 , 14:54   Re: [CS:GO] Problem with my array to save a last player disconnect
Reply With Quote #2

GetSteamAccountID return numbers not a string
8guawong is offline
SnMaxx
Junior Member
Join Date: Jun 2014
Old 06-05-2017 , 15:18   Re: [CS:GO] Problem with my array to save a last player disconnect
Reply With Quote #3

Quote:
Originally Posted by 8guawong View Post
GetSteamAccountID return numbers not a string
Thanks, GetSteamAccountID return "STEAM_1:0:6388376" ?? or other ID?
SnMaxx is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 06-05-2017 , 15:51   Re: [CS:GO] Problem with my array to save a last player disconnect
Reply With Quote #4

Quote:
Originally Posted by SnMaxx View Post
Thanks, GetSteamAccountID return "STEAM_1:0:6388376" ?? or other ID?
i do not know you can try printing it to see
8guawong is offline
Maxximou5
AlliedModders Donor
Join Date: Feb 2013
Old 06-05-2017 , 17:08   Re: [CS:GO] Problem with my array to save a last player disconnect
Reply With Quote #5

GetSteamAccountID will return the steamid64
Quote:
A Steam account ID is the lower 32 bits of the full 64-bit Steam ID (referred to as community id by some) and is unique per account.
If you're looking for STEAM_, you want to use GetClientAuthId: http://www.sourcemod.net/new-api/cli...etClientAuthId
__________________
Maxximou5 is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 06-06-2017 , 04:18   Re: [CS:GO] Problem with my array to save a last player disconnect
Reply With Quote #6

Quote:
Originally Posted by Maxximou5 View Post
GetSteamAccountID will return the steamid64
If you're looking for STEAM_, you want to use GetClientAuthId: http://www.sourcemod.net/new-api/cli...etClientAuthId
i don't think GetSteamAccountID returns the steamid64
https://wiki.alliedmods.net/SourceMo...hanges#Clients

Quote:
A new GetSteamAccountID native also has this param with the same purpose. A Steam account ID is the lower 32 bits of the full 64-bit Steam ID (referred to as community id by some) and is unique per account.
to get steamid64 u can use GetClientAuthId as well
http://www.sourcemod.net/new-api/clients/AuthIdType
8guawong 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 18:26.


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