Home » Renegade Discussions » Mod Release Forum » [Plug-in] SSGM2.02 Commander BETA
( ) 1 Vote
|
|
|
|
|
Re: [Plug-in] SSGM2.02 Commander BETA [message #397684 is a reply to message #383047] |
Wed, 12 August 2009 03:03   |
Vaati19
Messages: 50 Registered: April 2009 Location: Sweden
Karma: 0
|
Recruit |
|
|
Is this correct?
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *object = Get_GameObj(ID);
if(GDICommander[ID] || NodCommander[ID]){
if(GDICommander[ID]){
if(GDIDropActive){
if(GDITeamFund >= CSettings->supplycost){
GDITeamFund = GDITeamFund - CSettings->supplycost;
//Create the supply drop here
Commands->Create_2D_WAV_Sound("m00evag_dsgn0063i1evag_snd.wav");
Vector3 position = Commands->Get_Position(object);
GameObject *flare = Commands->Create_Object("Invisible_Object",position);
Commands->Set_Model(flare,"ag_sigflare_gld");
Commands->Attach_Script(flare,"Test_Cinematic","GDI_MedDrop.txt");
GDIDropActive = false;
GameObject *dropsetter = Commands->Create_Object("Invisible_Object",Vector3(0.0f,0.0f,0.0f));
Commands->Attach_Script(dropsetter,"reb_GDI_drop_setter","");
}
else{
Console_Input(StrFormat("ppage %d you do not have enough money in the Team Fund to order a tank drop.",ID).c_str());
}
}
else{
Console_Input(StrFormat("ppage %d The \"!meddrop\" command is not available yet. It can be used every %i seconds",ID,CSettings->droptimer).c_str());
}
}
else if(NodCommander[ID]){
if(NodDropActive){
if(NodTeamFund >= CSettings->supplycost){
NodTeamFund = NodTeamFund - CSettings->supplycost;
//Create the supply drop here
//mx0_trooper1_112.wav
Commands->Create_2D_WAV_Sound("m00evag_dsgn0063i1evag_snd.wav");
Vector3 position = Commands->Get_Position(object);
GameObject *flare = Commands->Create_Object("Invisible_Object",position);
Commands->Set_Model(flare,"ag_sigflare_gld");
Commands->Attach_Script(flare,"Test_Cinematic","Nod_LightDrop.txt");
NodDropActive = false;
GameObject *dropsetter = Commands->Create_Object("Invisible_Object",Vector3(0.0f,0.0f,0.0f));
Commands->Attach_Script(dropsetter,"reb_Nod_drop_setter","");
}
else{
Console_Input(StrFormat("ppage %d you do not have enough money in the Team Fund to order a tank drop.",ID).c_str());
}
}
else{
Console_Input(StrFormat("ppage %d The \"!lightdrop\" command is not available yet. It can be used every %i seconds",ID,CSettings->droptimer).c_str());
}
}
}
else{
Console_Input(StrFormat("ppage %d You are not a team commander and cannot use this command.",ID).c_str());
}
}
};
ChatCommandRegistrant<TankChatCommand> TankChatCommandReg("!meddrop;!mediumtank;!medtank;!mediumtankdrop;!lightdrop;lighttank;!lighttankdrop;!light;!med",CHATTYPE_ALL,0,GAMEMODE_ALL);
|
|
|
Re: [Plug-in] SSGM2.02 Commander BETA [message #397688 is a reply to message #383047] |
Wed, 12 August 2009 04:46   |
 |
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
You could hard code the cost of the drop if you wanted to do that in there yes.
Specifically here:
if(GDITeamFund >= CSettings->supplycost){
GDITeamFund = GDITeamFund - CSettings->supplycost;
You would change it to this for example if you wanted it to cost 2000 credits:
if(GDITeamFund >= 2000){
GDITeamFund = GDITeamFund - 2000;
However, the cost of the drop has been set up to be a configurable option in the .ini file supplied in the download.
You seem to be getting the hang of this, for someone who claims to not be able to code, you've done well! 
You do realise you need to compile this code, don't you?
[Updated on: Wed, 12 August 2009 04:46] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Apr 11 23:07:32 MST 2025
Total time taken to generate the page: 0.01294 seconds
|