Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » jfw_attach_script_vehicle_created
Re: jfw_attach_script_vehicle_created [message #446770 is a reply to message #446683] Mon, 09 May 2011 02:52 Go to previous messageGo to previous message
zunnie is currently offline  zunnie
Messages: 2959
Registered: September 2003
Location: Netherlands
Karma:
General (2 Stars)

Note that this script does not attach the script to vehicles created later in the game.
So say a vehicle is created 5 mins into the game, the script will not be attached to it.
You must modify the script and include a timer and loop checking for vehs.

IE something like this:

void JFW_Attach_Script_Vehicle_Created::ObjectCreateHook(GameObject *obj)
{
	const char *script;
	const char *paramx;
	char *params;
	char delim;
	script = Get_Parameter("Script");
	paramx = Get_Parameter("Params");
	params = newstr(paramx);
	delim = Get_Parameter("Delim")[0];
	unsigned int x = strlen(params);
	for (unsigned int i=0;i<x;i++)
	{
		if (params[i] == delim)
		{
			params[i] = ',';
		}
	}
	Attach_Script_Is_Type(obj,Vehicle,script,params,Get_Int_Parameter("Player_Type"));
	delete[] params;
	Commands->Start_Timer(obj,this,1.0f,1000);
}
void JFW_Attach_Script_Vehicle_Created::Timer_Expired(GameObject *obj, int number)
{
	if (number == 1000)
	{
		const char *script;
		const char *paramx;
		char *params;
		char delim;
		script = Get_Parameter("Script");
		paramx = Get_Parameter("Params");
		params = newstr(paramx);
		delim = Get_Parameter("Delim")[0];
		unsigned int x = strlen(params);
		for (unsigned int i=0;i<x;i++)
		{
			if (params[i] == delim)
			{
				params[i] = ',';
			}
		}
		Attach_Script_Is_Type(obj,Vehicle,script,params,Get_Int_Parameter("Player_Type"));
		delete[] params;
		Commands->Start_Timer(obj,this,1.0f,1000);
	}
}


https://multiplayerforums.com/uploads/monthly_2018_03/TCW2_Signature.png.6236a0dbc6e1e53472a18fe8cd15e47b.png

[Updated on: Mon, 09 May 2011 02:53]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: modifying weapons&ammos with serverside scripts.dll
Next Topic: level load
Goto Forum:
  


Current Time: Wed Jan 15 13:56:00 MST 2025

Total time taken to generate the page: 0.00873 seconds