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);
}
}
[Updated on: Mon, 09 May 2011 02:53]
Report message to a moderator