View Single Post
Omixsat
Member
Join Date: Jul 2022
Old 08-31-2022 , 11:15   Re: [L4D2] 200 IQ Bots: AI Tank Haymakers And More!
Reply With Quote #20

Quote:
Originally Posted by Dominatez View Post
It's constantly spamming the error log all the time with this.

L 02/20/2020 - 20:231: [SM] Exception reported: Invalid entity index -1
L 02/20/2020 - 20:231: [SM] Blaming: 200IQBots_FlyYouFools.smx
L 02/20/2020 - 20:231: [SM] Call stack trace:
L 02/20/2020 - 20:231: [SM] [0] EntIndexToEntRef
L 02/20/2020 - 20:231: [SM] [1] Line 127, 200IQBots_FlyYouFools.sp::L4D2_RunScript
L 02/20/2020 - 20:231: [SM] [2] Line 86, 200IQBots_FlyYouFools.sp::BotControlTimer

Any ideas ?
It's referring to the stock Timocop has provided

Code:
stock L4D2_RunScript(const String:sCode[], any:...)
{
	static iScriptLogic = INVALID_ENT_REFERENCE;
	if(iScriptLogic == INVALID_ENT_REFERENCE || !IsValidEntity(iScriptLogic)) {
		iScriptLogic = EntIndexToEntRef(CreateEntityByName("logic_script"));
		if(iScriptLogic == INVALID_ENT_REFERENCE || !IsValidEntity(iScriptLogic))
			SetFailState("Could not create 'logic_script'");
		
		DispatchSpawn(iScriptLogic);
	}
	
	static String:sBuffer[512];
	VFormat(sBuffer, sizeof(sBuffer), sCode, 2);
	
	SetVariantString(sBuffer);
	AcceptEntityInput(iScriptLogic, "RunScriptCode");
}
This specific line "iScriptLogic = EntIndexToEntRef(CreateEntityByName("logic_sc ript"));" has an issue in L4D1 and I don't know why, but this did work before.
Omixsat is offline