Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » [script]drop mod
[script]drop mod [message #345906] Sun, 10 August 2008 07:27 Go to next message
Jamie or NuneGa is currently offline  Jamie or NuneGa
Messages: 954
Registered: June 2007
Karma: 0
Colonel
Wondering if anyone could provide a drop mod for a server so that with a admin command you can drop an orca onto you...

http://img504.imageshack.us/img504/8789/avilj4.jpg

Jamie is a guys name in Europe...

[Updated on: Fri, 30 January 2009 14:36] by Moderator

Report message to a moderator

Re: drop mod [message #345922 is a reply to message #345906] Sun, 10 August 2008 09:20 Go to previous messageGo to next message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma: 0
General (3 Stars)
Permabanned for trying and failing DDoS
i gave many peoples my script but cant find it yet lol
Re: drop mod [message #345954 is a reply to message #345922] Sun, 10 August 2008 11:25 Go to previous messageGo to next message
MacKinsey is currently offline  MacKinsey
Messages: 83
Registered: March 2008
Karma: 0
Recruit
madrackz wrote on Sun, 10 August 2008 11:20

i gave many peoples my script but cant find it yet lol

I am one of them ^^, ty very much again!
class OrcaChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
		GameObject *obj = Get_GameObj(ID);
Vector3 position;
position = Commands->Get_Position(obj);
position.Z += 3.00;
position.X += (float)(5*cos(Commands->Get_Facing(Get_GameObj(ID))*(3.14 / 180)));
position.Y += (float)(5*sin(Commands->Get_Facing(Get_GameObj(ID))*(3.14 / 180)));
				   const char * name = Get_Player_Name(obj);
 if (strcmp(name, "MonkeyX01") == 0)
 {
	GameObject *X = Commands->Create_Object("CnC_GDI_Orca", position);
	Commands->Set_Player_Type(X, 3);
		Commands->Set_Facing(X, Commands->Get_Facing(obj)-180);
			char message[1000];
			const char *Player = Get_Player_Name(obj);
			sprintf(message,"msg %s has Droped a GDI Orca.", Player);
	Console_Input(message);
	}
	}
};
ChatCommandRegistrant<OrcaChatCommand> OrcaChatCommandReg("!orca",CHATTYPE_ALL,0,GAMEMODE_AOW);

The one above is only for 1 Nickname, MonkeyX01, just edit it.
This one is for everyone, and costs 900 creds
class OrcaChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
		GameObject *obj = Get_GameObj(ID);
Vector3 position;
position = Commands->Get_Position(obj);
position.Z += 3.00;
position.X += (float)(5*cos(Commands->Get_Facing(Get_GameObj(ID))*(3.14 / 180)));
position.Y += (float)(5*sin(Commands->Get_Facing(Get_GameObj(ID))*(3.14 / 180)));
if(Credits >= 900){
   Commands->Give_Money(obj,-900,false);
	GameObject *X = Commands->Create_Object("CnC_GDI_Orca", position);
	Commands->Set_Player_Type(X, 3);
		Commands->Set_Facing(X, Commands->Get_Facing(obj)-180);
			char message[1000];
			const char *Player = Get_Player_Name(obj);
			sprintf(message,"msg %s has Droped a GDI Orca.", Player);
	Console_Input(message);
	}
	else {
Console_Input(StrFormat("ppage %d You need 900 credits to spawn an Orca.",ID).c_str());
		}
	}
};
ChatCommandRegistrant<OrcaChatCommand> OrcaChatCommandReg("!orca",CHATTYPE_ALL,0,GAMEMODE_AOW);

And this one is only for mods and costs nothing again.
Add this on top of the file
#include<fstream>
usingnamespace std;

and this can be at every position (at gmmain.cpp)
//Mod App
bool Is_Mod(const char *Name)
{
     fstream file("mods.txt", ios::in);
     string tmp;
     while(file >> tmp)
     { 
         if(strcmp(Name, tmp.c_str()) == 0)
          {
               return 1;
         }
     }
     return 0;
}
//Orca Command
class OrcaChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
		GameObject *obj = Get_GameObj(ID);
Vector3 position;
position = Commands->Get_Position(obj);
position.Z += 3.00;
position.X += (float)(5*cos(Commands->Get_Facing(Get_GameObj(ID))*(3.14 / 180)));
position.Y += (float)(5*sin(Commands->Get_Facing(Get_GameObj(ID))*(3.14 / 180)));
if(Is_Mod(Get_Player_Name_By_ID(ID))) {
	GameObject *X = Commands->Create_Object("CnC_GDI_Orca", position);
	Commands->Set_Player_Type(X, 3);
		Commands->Set_Facing(X, Commands->Get_Facing(obj)-180);
			char message[1000];
			const char *Player = Get_Player_Name(obj);
			sprintf(message,"msg %s has Droped a GDI Orca.", Player);
	Console_Input(message);
	}
		else {
Console_Input(StrFormat("ppage %d You need to be a mod to use that command.",ID).c_str());
		}
	}
};
ChatCommandRegistrant<OrcaChatCommand> OrcaChatCommandReg("!orca",CHATTYPE_ALL,0,GAMEMODE_AOW);


You need to edit the Chat Command Registrants that u can use them all at one time, for example
class Orca1ChatCommand : public ChatCommandClass {
......
ChatCommandRegistrant<Orca1ChatCommand> Orca1ChatCommandReg("!orca1",CHATTYPE_ALL,0,GAMEMODE_AOW);

class Orca2ChatCommand : public ChatCommandClass {
......
ChatCommandRegistrant<Orca2ChatCommand> Orca2ChatCommandReg("!orca2",CHATTYPE_ALL,0,GAMEMODE_AOW);



EDIT: For the Modlist based Variant, u need a mods.txt in your FDS Folder

EDIT2: Nice Photoshop Skills, NuneGa!
(And if you need help, ask Madrockz or contact me via pm here or at blackintel ^^)

[Updated on: Sun, 10 August 2008 11:51]

Report message to a moderator

Re: drop mod [message #345965 is a reply to message #345906] Sun, 10 August 2008 12:24 Go to previous messageGo to next message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma: 0
General (3 Stars)
Permabanned for trying and failing DDoS
or you want my command that a heli puts down a Orca
Re: drop mod [message #346377 is a reply to message #345965] Tue, 12 August 2008 08:57 Go to previous message
Sn1per74* is currently offline  Sn1per74*
Messages: 939
Registered: April 2006
Karma: 0
Colonel
That's not a drop mod though...

http://i4.photobucket.com/albums/y133/FMAROCKS/sniper74halosigsnipedontforgettogiv.png
Creator: AoBFrost
Previous Topic: [model] CCR-Style TOW-Hummer
Next Topic: [model]Weapon release
Goto Forum:
  


Current Time: Sat Nov 23 23:26:37 MST 2024

Total time taken to generate the page: 0.00941 seconds