Home » Renegade Discussions » Mod Forum » !para
!para [message #471168] |
Wed, 11 July 2012 04:47  |
 |
Distrbd21
Messages: 743 Registered: September 2008
Karma: 0
|
Colonel |

|
|
I'm trying to get it to work with 4.0, but I don't know exactly what I have done wrong.
The server doesn't crash when I do !para or when I get out of a veh, nothing happens I still die ;p
void ObjectHookCall(void *data,GameObject *obj) {
if (obj->As_SoldierGameObj()) {
Attach_Script_Once(obj,"Parachute","");
}
else if (obj->As_VehicleGameObj()) {
if (obj->As_PhysicalGameObj() && (Get_Vehicle_Mode(obj) == VEHICLE_TYPE_FLYING)) {
Attach_Script_Once(obj,"Parachute","");
}
}
}
void Parachute::Created(GameObject *obj) {
isFalling = false;
floaterID = 0;
pchuteID = 0;
fallin = 0;
health = Commands->Get_Health(obj);
}
void Parachute::Damaged(GameObject *obj,GameObject *damager,float damage) {
if (!damager && isFalling && (damage < 1000)) {
Commands->Set_Health(obj,health);
isFalling = false;
}
else {
health = Commands->Get_Health(obj);
}
}
void Parachute::Killed(GameObject *obj, GameObject *shooter) {
if (obj->As_VehicleGameObj()) {
if (Commands->Get_ID(obj) && obj && obj->As_VehicleGameObj()) {
VectorClass<GameObject *> *ptr = (VectorClass<GameObject *>*)(obj+0x9AC);
VectorClass<GameObject *> occupants = (VectorClass<GameObject *>)*ptr;
int x = occupants.Length();
for (int i = 0;i < x;i++) {
if (occupants[i]) {
Commands->Send_Custom_Event(occupants[i],occupants[i],4612,0,0);
}
}
}
}
else if (obj->As_SoldierGameObj()) {
Commands->Enable_Collisions(obj);
if (Commands->Find_Object(pchuteID)) {
Commands->Destroy_Object(Commands->Find_Object(pchuteID));
pchuteID = 0;
}
if (Commands->Find_Object(floaterID)) {
Commands->Destroy_Object(Commands->Find_Object(floaterID));
floaterID = 0;
}
isFalling = false;
}
}
void Parachute::Timer_Expired(GameObject *obj,int number) {
if (number == 1) {
newpos = Commands->Get_Position(obj);
if (newpos.Z < pos.Z) {
fallin += pos.Z - newpos.Z;
if (fallin > 10 && !isFalling) {
isFalling = true;
GameObject *floater = Commands->Create_Object("CnC_Beacon_IonCannon",Commands->Get_Position(obj));
Commands->Set_Model(floater,"null");
Commands->Set_Facing(floater,Commands->Get_Facing(obj));
GameObject *pchute = Commands->Create_Object("Generic_Cinematic",Commands->Get_Position(obj));
Commands->Set_Model(pchute,"X5D_Parachute");
Commands->Disable_All_Collisions(pchute);
Commands->Disable_Physical_Collisions(obj);
Commands->Attach_To_Object_Bone(obj,floater,"");
Commands->Attach_To_Object_Bone(pchute,obj,"");
floaterID = Commands->Get_ID(floater);
pchuteID = Commands->Get_ID(pchute);
}
pos = Commands->Get_Position(obj);
Commands->Start_Timer(obj, this, 0.1f, 1);
}
else {
Commands->Enable_Collisions(obj);
if (Commands->Find_Object(pchuteID)) {
Commands->Destroy_Object(Commands->Find_Object(pchuteID));
pchuteID = 0;
}
if (Commands->Find_Object(floaterID)) {
Commands->Destroy_Object(Commands->Find_Object(floaterID));
floaterID = 0;
}
Commands->Start_Timer(obj, this, 2.0f, 2);
}
}
else if (number == 2) {
isFalling = false;
}
}
void Parachute::Custom(GameObject *obj, int message, int param, GameObject *sender) {
if (message == CUSTOM_EVENT_VEHICLE_EXITED) {
Commands->Send_Custom_Event(sender,sender,4612,0,0);
}
else if (message == CUSTOM_EVENT_VEHICLE_ENTERED) {
Commands->Send_Custom_Event(sender,sender,4613,0,0);
}
else if (message == 4612) {
health = Commands->Get_Health(obj);
fallin = 0;
pos = Commands->Get_Position(obj);
Commands->Start_Timer(obj, this, 0.1f, 1);
}
else if (message == 4613) {
isFalling = false;
if (Commands->Find_Object(pchuteID)) {
Commands->Destroy_Object(Commands->Find_Object(pchuteID));
pchuteID = 0;
}
if (Commands->Find_Object(floaterID)) {
Commands->Destroy_Object(Commands->Find_Object(floaterID));
floaterID = 0;
}
}
}
Live Your Life Not Some one Else's.| Sharing Is Caring
Cookie Jar<glome> Who stole the cookie from the cookie jar?!
<content> glome stole the cookie from the cookie jar!
<glome> Who me?!
<content> Yes you!
<glome> Couldn't be!
<content> Then WHO?!!
<glome> Woody stole the cookie from the cookie jar!
*** glome has been kicked by DrWoody (fuck you i didn't touch the motherfucking cookie, bitch
Suicide<TB> I was depressed last night so I called the Suicide Life Line.
<TB> I reached a call center in Pakistan.
<TB> I told them I was suicidal.
<TB> They got all excited and asked if I could drive a truck
|
|
|
|
Re: !para [message #471227 is a reply to message #471168] |
Wed, 11 July 2012 10:53   |
 |
Distrbd21
Messages: 743 Registered: September 2008
Karma: 0
|
Colonel |

|
|
My test server is hooked to debug, but I'm having problems with it not copying over the sciprts.dll to the server folder.
The script is suppost to auto deploy your parachute if you exit the veh in mid air, or if your veh is killed mid air, I was also trying to make it work with !para, so I didn't have to have 2 scripts.
Most of it is to get the parachute to be placed in the right facing on your back.
EDIT: My guess is I don't have the As_ stuff right, as I don't know it all that well.
Live Your Life Not Some one Else's.| Sharing Is Caring
Cookie Jar<glome> Who stole the cookie from the cookie jar?!
<content> glome stole the cookie from the cookie jar!
<glome> Who me?!
<content> Yes you!
<glome> Couldn't be!
<content> Then WHO?!!
<glome> Woody stole the cookie from the cookie jar!
*** glome has been kicked by DrWoody (fuck you i didn't touch the motherfucking cookie, bitch
Suicide<TB> I was depressed last night so I called the Suicide Life Line.
<TB> I reached a call center in Pakistan.
<TB> I told them I was suicidal.
<TB> They got all excited and asked if I could drive a truck
[Updated on: Wed, 11 July 2012 10:55] Report message to a moderator
|
|
|
|
Re: !para [message #471230 is a reply to message #471228] |
Wed, 11 July 2012 10:56   |
 |
Distrbd21
Messages: 743 Registered: September 2008
Karma: 0
|
Colonel |

|
|
iRANian wrote on Wed, 11 July 2012 12:55 | Hex' script doesn't require you to type !para, the reason it's not doing anything is because you forgot the scriptregistrant line.
|
no thats there at the bottum...
ScriptRegistrant<Parachute> Parachute_Registrant("Parachute","");
Live Your Life Not Some one Else's.| Sharing Is Caring
Cookie Jar<glome> Who stole the cookie from the cookie jar?!
<content> glome stole the cookie from the cookie jar!
<glome> Who me?!
<content> Yes you!
<glome> Couldn't be!
<content> Then WHO?!!
<glome> Woody stole the cookie from the cookie jar!
*** glome has been kicked by DrWoody (fuck you i didn't touch the motherfucking cookie, bitch
Suicide<TB> I was depressed last night so I called the Suicide Life Line.
<TB> I reached a call center in Pakistan.
<TB> I told them I was suicidal.
<TB> They got all excited and asked if I could drive a truck
|
|
|
|
Re: !para [message #471264 is a reply to message #471168] |
Wed, 11 July 2012 13:58   |
 |
Xpert
Messages: 1588 Registered: December 2005 Location: New York City
Karma: 0
|
General (1 Star) |
|
|
Commands->Is_A_Star(obj) instead of (obj->As_SoldierGameObj())
Funny, I was gonna release a parachute plugin using this script.
Quote: |
VectorClass<GameObject *> *ptr = (VectorClass<GameObject *>*)(obj+0x9AC);
VectorClass<GameObject *> occupants = (VectorClass<GameObject *>)*ptr;
|
This will crash in 4.0
Creator of NetGuard, an IRC network regulator.
Developer of the CloudyServ 0.982-X project.
Developer of the CloudyServ Ren-X bot.
Part time streamer - https://twitch.tv/gg_wonder
|
|
|
|
Re: !para [message #471396 is a reply to message #471264] |
Thu, 12 July 2012 02:47   |
 |
Distrbd21
Messages: 743 Registered: September 2008
Karma: 0
|
Colonel |

|
|
Xpert wrote on Wed, 11 July 2012 15:58 | Commands->Is_A_Star(obj) instead of (obj->As_SoldierGameObj())
|
so like this?
void ObjectHookCall(void *data,GameObject *obj) {
if (Commands->Is_A_Star(obj)) {
Attach_Script_Once(obj,"Parachute","");
}
else if (obj->As_VehicleGameObj()) {
Attach_Script_Once(obj,"Parachute","");
}
}
And this one is built into gmgame, and ssgm.
@ Iran so just take it out right?
@ Jonwil, Can you explain a little more?
This is what I did to replace it not sure if it's right or not.
void Parachute::Killed(GameObject *obj, GameObject *shooter) {
if (obj->As_VehicleGameObj()->Get_Occupant()) {
if (obj->As_VehicleGameObj()->Get_Occupant_Count()) {
}
else if (Commands->Is_A_Star(obj)) {
Commands->Enable_Collisions(obj);
if (Commands->Find_Object(pchuteID)) {
Commands->Destroy_Object(Commands->Find_Object(pchuteID));
pchuteID = 0;
}
if (Commands->Find_Object(floaterID)) {
Commands->Destroy_Object(Commands->Find_Object(floaterID));
floaterID = 0;
}
isFalling = false;
}
}
Live Your Life Not Some one Else's.| Sharing Is Caring
Cookie Jar<glome> Who stole the cookie from the cookie jar?!
<content> glome stole the cookie from the cookie jar!
<glome> Who me?!
<content> Yes you!
<glome> Couldn't be!
<content> Then WHO?!!
<glome> Woody stole the cookie from the cookie jar!
*** glome has been kicked by DrWoody (fuck you i didn't touch the motherfucking cookie, bitch
Suicide<TB> I was depressed last night so I called the Suicide Life Line.
<TB> I reached a call center in Pakistan.
<TB> I told them I was suicidal.
<TB> They got all excited and asked if I could drive a truck
|
|
|
Re: !para [message #471798 is a reply to message #471168] |
Tue, 17 July 2012 06:03   |
 |
Distrbd21
Messages: 743 Registered: September 2008
Karma: 0
|
Colonel |

|
|
bump been few days...
Live Your Life Not Some one Else's.| Sharing Is Caring
Cookie Jar<glome> Who stole the cookie from the cookie jar?!
<content> glome stole the cookie from the cookie jar!
<glome> Who me?!
<content> Yes you!
<glome> Couldn't be!
<content> Then WHO?!!
<glome> Woody stole the cookie from the cookie jar!
*** glome has been kicked by DrWoody (fuck you i didn't touch the motherfucking cookie, bitch
Suicide<TB> I was depressed last night so I called the Suicide Life Line.
<TB> I reached a call center in Pakistan.
<TB> I told them I was suicidal.
<TB> They got all excited and asked if I could drive a truck
|
|
|
|
|
|
|
Re: !para [message #472029 is a reply to message #472028] |
Fri, 20 July 2012 12:09   |
 |
Xpert
Messages: 1588 Registered: December 2005 Location: New York City
Karma: 0
|
General (1 Star) |
|
|
jonwil wrote on Wed, 11 July 2012 22:24 | You need to replace that blob of code (with the 0x9AC thing) with calls to ->Get_Occupant_Count() and ->Get_Occupant()
|
VectorClass<GameObject *>& occupants = *(VectorClass<GameObject *>*)((char*)obj+0x9AC);
Gen_Blacky wrote on Fri, 20 July 2012 13:53 | Last time i looked at it, it looked like the para was facing the player's side.
|
It does I think.
Creator of NetGuard, an IRC network regulator.
Developer of the CloudyServ 0.982-X project.
Developer of the CloudyServ Ren-X bot.
Part time streamer - https://twitch.tv/gg_wonder
|
|
|
|
Goto Forum:
Current Time: Thu Dec 19 13:29:12 MST 2024
Total time taken to generate the page: 0.00924 seconds
|