Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » teleport on poke
teleport on poke [message #203566] Mon, 12 June 2006 17:04 Go to next message
sycar is currently offline  sycar
Messages: 144
Registered: February 2006
Location: Reading, UK
Karma: 0
Recruit
Hi, does anyone know what script to use if i want to teleport on poke, i.e. they poke a switch and get teleported somewhere. Likewise does anyone know how to get it to private message on poke?

thanks buffymaniack
Re: teleport on poke [message #203616 is a reply to message #203566] Tue, 13 June 2006 02:56 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
I have not tested this, it compiles but i have not used it before.. I made this very quickly by changing another reb script, so there may well be additional un-needed crap in there that i did not have time/could be bothered to remove. If nothing else, it should give you a good starting point.



//script
void reb_Poke_teleport_team::Poked(GameObject *obj,GameObject *poker)
{
        Vector3 spawn_position;
	spawn_position = Get_Vector3_Parameter("Location");
	int team;
	team = Get_Int_Parameter("Player_Type");
	if (CheckPlayerType(poker,team))
	{
		return;
	}
	int x = Get_Int_Parameter("Object_ID");
	if (x)
	{
		GameObject *gotoObject = Commands->Find_Object(x);
		Vector3 gotoLocation = Commands->Get_Position(gotoObject);
		Commands->Set_Position(poker,gotoLocation);
	}
	else
		Commands->Set_Position(poker,spawn_position);

//registrant
ScriptRegistrant<reb_Poke_teleport_team> reb_Poke_teleport_team_Registrant("reb_Poke_teleport_team","Location:vector3,Object_ID=0:int,Player_Type:int");





//for the .h file
class reb_Poke_teleport_team : public ScriptImpClass {
	void poked(GameObject *obj,GameObject *poker);
};



[Updated on: Tue, 13 June 2006 03:08]

Report message to a moderator

Re: teleport on poke [message #203652 is a reply to message #203616] Tue, 13 June 2006 09:37 Go to previous messageGo to next message
sycar is currently offline  sycar
Messages: 144
Registered: February 2006
Location: Reading, UK
Karma: 0
Recruit
cheers mate, worked perfectly! any ideas about the PM on poke thingy? Cheers buffymaniack
Re: teleport on poke [message #203659 is a reply to message #203566] Tue, 13 June 2006 09:55 Go to previous messageGo to next message
IronWarrior is currently offline  IronWarrior
Messages: 2460
Registered: November 2004
Location: England UK
Karma: 0
General (2 Stars)
I would love to help you with this, but I dont know how to do it the offical way... but reborn or zunnie would, if you come over to our forums at http://www.mp-gaming.net they be able to help you faster, then waiting for reborn to reply here. Smile
Re: teleport on poke [message #203802 is a reply to message #203652] Wed, 14 June 2006 04:00 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
buffymaniack wrote on Tue, 13 June 2006 12:37

cheers mate, worked perfectly! any ideas about the PM on poke thingy? Cheers buffymaniack


I had 4 minutes before I had to go to work, so don't blame me if this is crap... but i think it should be fine for what you want...


//script
void reb_msg_poke::Poked(GameObject *obj,GameObject *poker)
{
	int x;
	x = Get_Int_Parameter("Player_Type");
	if (CheckPlayerType(poker,x))
	{
		return;
	}
	if (!Commands->Is_A_Star(poker))
	{
		return;
	}
	char message[1000];
	sprintf(message,"msg %d %s",Get_Player_ID(poker),Get_Parameter("Message"));
	Console_Input(message);
}


//registrant
ScriptRegistrant<reb_msg_poke> reb_msg_poke_Registrant("reb_msg_poke","Player_Type:int,Message:string");


//for the .h file
class reb_msg_poke : public ScriptImpClass {
	void Poked(GameObject *obj,GameObject *poker);
};



Re: teleport on poke [message #203884 is a reply to message #203566] Wed, 14 June 2006 12:40 Go to previous messageGo to next message
sycar is currently offline  sycar
Messages: 144
Registered: February 2006
Location: Reading, UK
Karma: 0
Recruit
cheers mate, that code created an admin message sent to all players, but i was able to change it to PM them instead. Your a real help.

Lol i dont wana get cocky so i won't expect reborn to help out, but if anyone knows how to do a death on poke thing, then help me out if u can. If you have any form of death script i can change it into a poke one, i'm just not sure how you would kill a person from the scripts.

Cheers buffymaniack
Re: teleport on poke [message #203895 is a reply to message #203884] Wed, 14 June 2006 15:41 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
buffymaniack wrote on Wed, 14 June 2006 15:40

cheers mate, that code created an admin message sent to all players, but i was able to change it to PM them instead. Your a real help.

Lol i dont wana get cocky so i won't expect reborn to help out, but if anyone knows how to do a death on poke thing, then help me out if u can. If you have any form of death script i can change it into a poke one, i'm just not sure how you would kill a person from the scripts.

Cheers buffymaniack


To kill someone you generally over-kill them by applying shrapnel damage to them, that is how the death crate works.

Commands->Apply_Damage(sender,99999,"Shrapnel",false);


Here is a poke and death script (although technically it is a poke and apply a shitload of damage script) that will let you define who it kills by team.

//script

void reb_death_poke::Poked(GameObject *obj,GameObject *poker)
{
	int x;
	x = Get_Int_Parameter("Player_Type");
	if (CheckPlayerType(poker,x))
	{
		return;
	}
	if (!Commands->Is_A_Star(poker))
	{
		return;
	}
				Commands->Apply_Damage(poker,99999,"Shrapnel",false);
}


//registrant


ScriptRegistrant<reb_death_poke> reb_death_poke_Registrant("reb_death_poke","Player_Type:int");


for the .h file


class reb_death_poke : public ScriptImpClass {
	void Poked(GameObject *obj,GameObject *poker);
};


If I was you I would start making your own .cpp and .h and put your scripts in there, so when new source codes are released you can port yours easily to the latest version.

Can I ask BTW what you are up to?



Re: teleport on poke [message #203987 is a reply to message #203566] Thu, 15 June 2006 11:11 Go to previous messageGo to next message
ghost is currently offline  ghost
Messages: 437
Registered: May 2005
Location: California
Karma: 0
Commander
The script worked well on my project as well. Only when i tryed it for the first time it crashed :S

http://img287.imageshack.us/img287/9936/davesigea4rw5.png
Please visit my forums at: RenForce
Creator of the CrazyAOW Mod
Re: teleport on poke [message #204004 is a reply to message #203987] Thu, 15 June 2006 12:57 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
When you tried which script?


Re: teleport on poke [message #204028 is a reply to message #204004] Thu, 15 June 2006 15:16 Go to previous message
sycar is currently offline  sycar
Messages: 144
Registered: February 2006
Location: Reading, UK
Karma: 0
Recruit
thanks a lot reborn. As always, worked perfectly! I'll have to start paying you soon lol!

I host a server, and am working through each level one-by-one modding them, serverside, to make them more interesting. Your scripting help has been invaluable! I'll even post a 'special thanks' announcement to reborn lol for all his help.

Cheers anyway buffymaniack
Previous Topic: SSAOW 1.5/Scripts.dll Problem
Next Topic: Renegade Destroyed Buildings
Goto Forum:
  


Current Time: Mon Nov 25 20:03:27 MST 2024

Total time taken to generate the page: 0.01730 seconds