Home » Renegade Discussions » Mod Forum » jfw_attach_script_vehicle_created
jfw_attach_script_vehicle_created [message #446683] |
Sun, 08 May 2011 03:52 |
robbyke
Messages: 348 Registered: September 2010 Location: Belgium
Karma: 0
|
Recruit |
|
|
jfw_attach_script_vehicle_created
id like to use this but i have no clue how does anyone has an example or something?
Owner of kambot TT server
kambot.freeforums.org
|
|
|
|
Re: jfw_attach_script_vehicle_created [message #446687 is a reply to message #446683] |
Sun, 08 May 2011 04:09 |
robbyke
Messages: 348 Registered: September 2010 Location: Belgium
Karma: 0
|
Recruit |
|
|
I do read the readme
but that doesnt explain me how i use it only how it works i need to know:
Do i have to attach it to something or do i have to call it as if its a function if so how?
edit:
ive found another way but if i would still like to know for future uses
Owner of kambot TT server
kambot.freeforums.org
[Updated on: Sun, 08 May 2011 04:13] Report message to a moderator
|
|
|
|
|
|
Re: jfw_attach_script_vehicle_created [message #446770 is a reply to message #446683] |
Mon, 09 May 2011 02:52 |
|
zunnie
Messages: 2959 Registered: September 2003 Location: Netherlands
Karma: 0
|
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);
}
}
[Updated on: Mon, 09 May 2011 02:53] Report message to a moderator
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Dec 21 07:27:43 MST 2024
Total time taken to generate the page: 0.01100 seconds
|