Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Vehicle Poke Help
Re: Vehicle Poke Help [message #445703 is a reply to message #445681] Tue, 12 April 2011 14:11 Go to previous messageGo to previous message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma:
General (3 Stars)
Altzan wrote on Tue, 12 April 2011 11:21

You can't have it spawn directly at an object's location using its ID? I don't remember, its been awhile.


yes you can with a different script.


Something like this should work hasn't been tested. We use a dummy object on the map to get spawn location and the facing.

void JFW_Preset_Buy_Poke2::Poked(GameObject *obj,GameObject *poker)
{
	const char *preset = Get_Parameter("Preset_Name");
	int x = Get_Int_Parameter("Player_Type");
	int cost = Get_Int_Parameter("Cost");
	int z = Get_Int_Parameter("LocationObject_ID");
	if (!z) { return; }
	if (CheckPlayerType(poker,x)) {return;}
	if (cost <= Commands->Get_Money(poker))
	{
		cost = -cost;
		Commands->Give_Money(poker,(float)cost,0);
		GameObject *LocationObject = Commands->Find_Object(z);
		Vector3 spawn_position = Commands->Get_Position(LocationObject);
		GameObject *createdobject = Commands->Create_Object(preset,spawn_position);
		float facing = Commands->Get_Facing(LocationObject);
		Commands->Set_Facing(createdobject,facing);		
	}
}


http://s18.postimage.org/jc6qbn4k9/bricks3.png
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: PIC help
Next Topic: Random Teleport script?
Goto Forum:
  


Current Time: Sun Feb 16 04:26:53 MST 2025

Total time taken to generate the page: 0.00742 seconds