Raised This Month: $ Target: $400
 0% 

Help with native


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
PawnBegg
Junior Member
Join Date: Apr 2022
Old 04-19-2022 , 10:20   Re: Help with native
Reply With Quote #7

Quote:
Originally Posted by Shadows Adi View Post
Because player's rank is assigned after he is logged into his account:
https://github.com/ShadowsAdi/CSGORe...make.sma#L2625

If you run into any issue, you can open a ticket on project's Github. https://github.com/ShadowsAdi/CSGORemake/issues
Hello, i get Rank value from database like this
Code:
rank = SQL_ReadResult(query, SQL_FieldNameToNum(query, "Rank"));
and print like this
Code:
formatex(itemName, charsmax(itemName), "%L", id, "CSGO_CLANS_APPLICATION_ITEM", userName, aplpoints, rank);
https://imgur.com/a/1EHd3rN
is it possible to convert it to string?

bcuz when im using native
Code:
csgor_get_user_rank(id, szRank, charsmax(szRank));
i just print rank of myself but i want to print another player

BTW if someone else can help me here is main plugin native
Code:
public native_get_user_rank(iPluginID, iParamNum)
{
	#if defined DEBUG
	log_to_file("csgor_debug_logs.log", "native_get_user_rank()")
	#endif

	if (iParamNum != 3)
	{
		log_error(AMX_ERR_NATIVE, "%s Invalid param num ! Valid: (PlayerID, Output, Len)", CSGO_TAG);
		return -1;
	}
	
	new id = get_param(1);
	if(!is_user_connected(id))
	{
		log_error(AMX_ERR_NATIVE, "%s Player is not connected (%d)", CSGO_TAG, id);
		return -1;
	}

	new szRank[MAX_RANK_NAME]
	new rank = -2

	if(g_bLogged[id])
	{
		rank = g_iUserRank[id];
		ArrayGetString(g_aRankName, rank, szRank, charsmax(szRank));
	}
	else
	{
		formatex(szRank, charsmax(szRank), "%L", LANG_SERVER, "CSGOR_NOT_LOGGED_CHAT")
	}

	set_string(2, szRank, get_param(3));

	return rank;
}

Last edited by PawnBegg; 04-19-2022 at 10:27.
PawnBegg 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 00:19.


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