Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Making a Command (Need Help)
Making a Command [message #411141] Tue, 17 November 2009 12:18 Go to next message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma: 0
Colonel

As you all know I'm going to be running a Hostage Mode Server with zunnie's Hostage Mode scripts, if you didn't now you know

Anyway i was wondering if someone could tell me how to make a script for my server so if you type !where or !rescue it gives you a pop up msg telling you where to take the hostage's, on each map.

Edit: also i would like to know how to add audio so when you join the game like in sp lock tells you to rescue the hostages.


Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide

[Updated on: Tue, 17 November 2009 12:20]

Report message to a moderator

Re: Making a Command [message #411143 is a reply to message #411141] Tue, 17 November 2009 12:23 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'm sure if you ask Zunnie he will add this for you. If you want to learn it yourself, then I suggest you look at the SSGM source code and look at the chat commands there...
If you run into trouble with the code, then please post the code and where you think you're going wrong.



Re: Making a Command [message #411160 is a reply to message #411141] Tue, 17 November 2009 14:00 Go to previous messageGo to next message
zunnie is currently offline  zunnie
Messages: 2959
Registered: September 2003
Location: Netherlands
Karma: 0
General (2 Stars)

I would explain it to him but i dont know how to make !commands like that myself :S

https://multiplayerforums.com/uploads/monthly_2018_03/TCW2_Signature.png.6236a0dbc6e1e53472a18fe8cd15e47b.png
Re: Making a Command [message #411163 is a reply to message #411141] Tue, 17 November 2009 14:09 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)
class rescueChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType){
if (strcmp(The_Game()->MapName, "CnC_Mesa.mix") == 0) {
Console_Input(StrFormat("ppage %d The objective for this map is to take the hostage to blah blah blah",ID).c_str());
	}
else if (strcmp(The_Game()->MapName, "CnC_Hourglass.mix") == 0) {
Console_Input(StrFormat("ppage %d The objective for this map is to take the hostage to blah blah blah",ID).c_str());
}
    }

};
ChatCommandRegistrant<rescueChatCommand> rescueChatCommandReg("!rescue",CHATTYPE_TEAM,0,GAMEMODE_ALL);



Re: Making a Command [message #411182 is a reply to message #411163] Tue, 17 November 2009 17:15 Go to previous messageGo to next message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma: 0
Colonel

reborn wrote on Tue, 17 November 2009 15:09

class rescueChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType){
if (strcmp(The_Game()->MapName, "CnC_Mesa.mix") == 0) {
Console_Input(StrFormat("ppage %d The objective for this map is to take the hostage to blah blah blah",ID).c_str());
	}
else if (strcmp(The_Game()->MapName, "CnC_Hourglass.mix") == 0) {
Console_Input(StrFormat("ppage %d The objective for this map is to take the hostage to blah blah blah",ID).c_str());
}
    }

};
ChatCommandRegistrant<rescueChatCommand> rescueChatCommandReg("!rescue",CHATTYPE_TEAM,0,GAMEMODE_ALL);


do i compile that in ssgm or scripts?


Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide
Re: Making a Command [message #411229 is a reply to message #411141] Tue, 17 November 2009 23:27 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)
If you have the source code to the hostage mode, then you could add it to that (assuming it is built on SSGM). However, you could also build it as a plugin, so that if zunnie ever creates an updated hostage mode, you do not have to re-add your own custom code.


Re: Making a Command [message #411235 is a reply to message #411229] Wed, 18 November 2009 01:19 Go to previous message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma: 0
Colonel

reborn wrote on Wed, 18 November 2009 00:27

If you have the source code to the hostage mode, then you could add it to that (assuming it is built on SSGM). However, you could also build it as a plugin, so that if zunnie ever creates an updated hostage mode, you do not have to re-add your own custom code.

we added it to ssgm but idk if it works yet i'm still try to get my server up and running so i can upload it to my friend to host it.

ty for the code it explains alot about it and zunnie showed me a teleport script for tanks with no one in them its nice to.. all this will work gr8 with my server.


Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide
Previous Topic: "Renegade" model
Next Topic: Updating UberMapPack (once again)
Goto Forum:
  


Current Time: Sat Nov 02 02:20:36 MST 2024

Total time taken to generate the page: 0.01005 seconds