Raised This Month: $ Target: $400
 0% 

Can anyone check if there is a better way to do this?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Alahmoh
Member
Join Date: Jun 2018
Old 08-07-2022 , 17:00   Re: Can anyone check if there is a better way to do this?
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
You should post the full plugin so that we can easily test it since you didn't provide any information about the warnings. The easier you make it for us, the more likely you'll get a quick answer.
the plugin is private, thou i will post the required natives to make it work.
Code:
#define Struct				enum

Struct _:StructIntPlayerInfo {	
	g_iHudSaved
}

new g_iPlayerInfo[ 33 ][ StructIntPlayerInfo ];

new g_iUserStatus[33],g_iUserColor[33],g_iHudLcr[33],g_iHudUcd[33];

new const g_szHudCN[ ][ ] = {
	"ML_NORMAL",
	"ML_CUSTOME"
};

new const g_szHudMenu[ ][ ] = {
	"ML_NORMAL",
	"ML_CYAN",
	"ML_RED",
	"ML_GREEN",
	"ML_TAN",
	"ML_PINK",
	"ML_ORANGE",
	"ML_PURPLE"
};

new const g_szHudMenuLcr[ ][ ] = {
	"ML_NORMAL",
	"ML_LEFT",
	"ML_CENTRE",
	"ML_RIGHT"
};

new const g_szHudMenuUcd[ ][ ] = {
	"ML_NORMAL",
	"ML_UP",
	"ML_CENTREE",
	"ML_DOWN"
};

public SaveHud( iPlayer ) {
	if( is_user_bot( iPlayer ) )
		return;
		
	new szKey[ 96 ], szData[ 96 ];
	formatex( szKey, charsmax( szKey ), "%s", g_szPlayerInfo[ iPlayer ][ g_szSteamID ] );
	formatex( szData, charsmax( szData ), "%i %i %i", g_iUserColor[ iPlayer ], g_iHudLcr[ iPlayer ], g_iHudUcd[ iPlayer ] );
		
	nvault_set( g_iVault, szKey, szData );
	
	g_szPlayerInfo[ iPlayer ][g_iHudSaved] = 1;
}
	
public LoadHud( iPlayer ) {
	if( is_user_bot( iPlayer ) )
		return;
		
	new szKey[ 96 ], szData[ 96 ], szDataPieces[ 6 ][ 10 ];
	formatex( szKey, charsmax( szKey ), "%s", g_szPlayerInfo[ iPlayer ][ g_szSteamID ] );
	nvault_get( g_iVault, szKey, szData, charsmax( szData ) );
		
	parse( szData, szDataPieces[ 0 ], charsmax( szDataPieces[ ] ), szDataPieces[ 1 ], charsmax( szDataPieces[ ] ), szDataPieces[ 2 ], charsmax( szDataPieces[ ] ) );
		
	g_iUserColor[ iPlayer ] = str_to_num( szDataPieces[ 0 ] );
	g_iHudLcr[ iPlayer ] =  str_to_num( szDataPieces[ 1 ] );
	g_iHudUcd[ iPlayer ] = str_to_num( szDataPieces[ 2 ] );
}
btw you dont need to test it because it works perfectly i only want to get rid of warnings.

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Warning: Tag mismatch on line 641
Warning: Tag mismatch on line 642
Warning: Tag mismatch on line 649
Warning: Tag mismatch on line 651
Warning: Tag mismatch on line 653
Warning: Tag mismatch on line 687
Warning: Tag mismatch on line 689
Warning: Tag mismatch on line 691
Warning: Tag mismatch on line 695
Warning: Tag mismatch on line 695
Warning: Tag mismatch on line 695
Warning: Tag mismatch on line 695
Warning: Tag mismatch on line 1394
Warning: Function "ChooseTeam" should return a value on line 2096
Warning: Function "Show_HudMenu" should return a value on line 2631
Warning: Function "Show_HudMenu" should return a value on line 2636
Warning: Function "Show_HudMenu" should return a value on line 2641
Warning: Function "Show_HudMenu" should return a value on line 2658
Header size: 6688 bytes
Code size: 120912 bytes
Data size: 405420 bytes
Stack/heap size: 16384 bytes; max. usage is unknown, due to recursion
Total requirements: 549404 bytes

18 Warnings.
Done.
Alahmoh is offline
 



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 15:41.


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