Raised This Month: $ Target: $400
 0% 

Solved engfunc(EngFunc_AllocString, "str") not return index


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
VINAGHOST
Member
Join Date: Aug 2016
Location: Việt Nam
Old 06-25-2021 , 12:14   engfunc(EngFunc_AllocString, "str") not return index
Reply With Quote #1

I'm doing rework on Dias's plugin that will follow this

But it has a weird situation.
Code:
new g_iszWeaponKey 
public plugin_precache() {
	// ...
	g_iszWeaponKey = engfunc(EngFunc_AllocString, WEAPON_NAME);
	server_print("..., Key: %d %s", g_iszWeaponKey, g_iszWeaponKey);
	// ...
}
this print to the server (from 2 plugins) has same %d and empty string %s
Code:
//WEAPON_NAME weapon_dargoncannon
Key: -74022417                    <= empty string
//WEAPON_NAME weapon_papin
Key: -74020417                    <= empty string
Besides that, no error nor warning shows.

Another part that uses EngFunc_AllocString works normally
Code:
Weapon_Create(const Float: vecOrigin[3] = {0.0, 0.0, 0.0}, const Float: vecAngles[3] = {0.0, 0.0, 0.0}) {
	new iWeapon;
	static iszAllocStringCached;
	if (iszAllocStringCached || (iszAllocStringCached = engfunc(EngFunc_AllocString, WEAPON_REFERANCE))) {
		iWeapon = engfunc(EngFunc_CreateNamedEntity, iszAllocStringCached);
		server_print("Key: %d %s", iszAllocStringCached, iszAllocStringCached)
	}
        // ...
}
Printed different per string, %d and %s
Code:
// WEAPON_REFERANCE weapon_ump45
Key: -74012316 dweapon_ump45
// WEAPON_REFERANCE weapon_knife
Key: -74012329 9weapon_knife
Anyone here knows about this situation?
(I'm using ReHLDS, ReAPI and AmxModX ver 1.9.0.5)

Last edited by VINAGHOST; 06-26-2021 at 05:22. Reason: update info
VINAGHOST 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 09:05.


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