Re: Code Release - Kamikaze Suit Crate [message #312833 is a reply to message #302900] |
Tue, 22 January 2008 01:20 |
|
wittebolx
Messages: 332 Registered: May 2007 Location: the netherlands
Karma: 0
|
Recruit |
|
|
reborn wrote on Thu, 13 December 2007 19:04 | Yeah, sorry math
Anyway, madrocks...
class sbhChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
float Credits = Commands->Get_Money(obj);
int Team = Get_Object_Type(obj);
GameObject *hon = Find_Soldier_Factory(0);
Vector3 position;
position = Commands->Get_Position(obj);
if(hon){
if(Credits >= 2000 && (Team == 0) ){
Commands->Give_Money(obj,-2000,false);
Change_Character(obj,"CnC_Nod_FlameThrower_2SF");
Commands->Set_Position(obj,position);
}
else{
Console_Input(StrFormat("ppage %d You have not been charged for this purchase because you did not meet requirements.",Get_Player_ID(obj)).c_str());
}
}
}
};
ChatCommandRegistrant<sbhChatCommand> sbhChatCommandReg("!sbh",CHATTYPE_TEAM,0,GAMEMODE_AOW);
I havn't looked at your code yet hex, looking foward to it
|
you can still use this command when hand of nod is dead.
would this work?
GameObject *hon = Find_Soldier_Factory(0);
Vector3 position;
position = Commands->Get_Position(obj);
if Is_Building_Dead(GameObject *hon);
http://www.wittebolx.com
|
|
|
|
|
|
Re: Code Release - Kamikaze Suit Crate [message #312966 is a reply to message #312962] |
Tue, 22 January 2008 17:59 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
wittebolx wrote on Tue, 22 January 2008 03:20 |
reborn wrote on Thu, 13 December 2007 19:04 | Yeah, sorry math
Anyway, madrocks...
class sbhChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
float Credits = Commands->Get_Money(obj);
int Team = Get_Object_Type(obj);
GameObject *hon = Find_Soldier_Factory(0);
Vector3 position;
position = Commands->Get_Position(obj);
if(hon){
if(Credits >= 2000 && (Team == 0) ){
Commands->Give_Money(obj,-2000,false);
Change_Character(obj,"CnC_Nod_FlameThrower_2SF");
Commands->Set_Position(obj,position);
}
else{
Console_Input(StrFormat("ppage %d You have not been charged for this purchase because you did not meet requirements.",Get_Player_ID(obj)).c_str());
}
}
}
};
ChatCommandRegistrant<sbhChatCommand> sbhChatCommandReg("!sbh",CHATTYPE_TEAM,0,GAMEMODE_AOW);
I havn't looked at your code yet hex, looking foward to it
|
you can still use this command when hand of nod is dead.
would this work?
GameObject *hon = Find_Soldier_Factory(0);
Vector3 position;
position = Commands->Get_Position(obj);
if Is_Building_Dead(GameObject *hon);
|
I didn't actually test it, I thought that would work. Interesting...
I guess what you posted would work, but I havn't tried.
Darknes2 wrote on Tue, 22 January 2008 19:36 | i just wanted to tell you guys *and this is pointless in saying that i too dislike chat hook although i probly dont dislike it AS much as everyone else but i use key hooks to let players buy vehicles and all. *i will post my code that stealths ur bound vehicle for 500 when its done!
|
The code you posted but removed was a little off, here it is re-written to actually work:
class svChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
GameObject *veh = Find_My_Veh(obj);
if (Commands->Get_Money(obj) <= 500){
Console_Input(StrFormat("page %s you need at least 500$ to buy this",Get_Player_Name(obj)).c_str());
}
else{
Commands->Give_Money(obj, -500, 1);
Commands->Enable_Stealth(veh, 1);
}
}
};
ChatCommandRegistrant<svChatCommand> svChatCommandReg("!sv",CHATTYPE_PUBLIC,0,GAMEMODE_ALL);
However, it's still not very good because what if the dude doesn't have a vehichle?
You should do something like
"if(veh){//do the f0sh0zzle}
else{//msg to say you don't have a vehichle dumbass}"
|
|
|
|
Re: Code Release - Kamikaze Suit Crate [message #312989 is a reply to message #312988] |
Tue, 22 January 2008 19:39 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
ferkhat wrote on Tue, 22 January 2008 21:33 | i dont get it
how do i make those codes work on renegade?
|
As a client on his server you would type !sv, as a server owner, you would paste it into gmmain.cpp from ssgm and compile it to produce a scripts.dll file. This file would then be placed on your server.
You would need visualstudio.net2005 to do this.
|
|
|
|
Re: Code Release - Kamikaze Suit Crate [message #321551 is a reply to message #302788] |
Mon, 10 March 2008 16:19 |
|
Darknes2
Messages: 91 Registered: July 2007 Location: Alaberma
Karma: 0
|
Recruit |
|
|
im sorry guys i completely got caught up in other things and forgot bout this so here it is all finished enjoy!
class svChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
GameObject *veh = Find_My_Veh(obj);
Send_Message_Player(obj,255,255,255,"Transmitting...");
Console_Input(StrFormat("sndp %d 00-n026e.wav",ID).c_str());
GameObject *MyVeh = Find_My_Veh(obj);
if (!MyVeh)
{
Console_Input(StrFormat("page %s you have no bound vehicle! press the insert key to lock ur vehicle to youe THEN use this!",Get_Player_Name(obj)).c_str());
}
int cost = 500;
if (Commands->Get_Money(obj) < cost)
{
Console_Input(StrFormat("page %s you need at least $d $ to buy this",Get_Player_Name(obj), cost).c_str());
}
else
{
Commands->Send_Custom_Event(obj,Find_My_Veh(obj),1113,0,0);
int ID = Get_Player_ID(obj);
GameObject *obj = Get_GameObj(ID);
Commands->Enable_Stealth(veh, 1);
//GameObject *MyVeh = Find_My_Veh(obj);
Commands->Give_Money(obj, -500, 1);
Commands->Send_Custom_Event(obj,MyVeh,1111,0,0);
Commands->Send_Custom_Event(obj,Find_My_Veh(obj),1112,0,0);
}
}
};
ChatCommandRegistrant<svChatCommand> svChatCommandReg("!sv",CHATTYPE_ALL,0,GAMEMODE_ALL);
DWC Forums
www.Darknes2.com
[Updated on: Mon, 10 March 2008 16:21] Report message to a moderator
|
|
|
Re: Code Release - Kamikaze Suit Crate [message #321626 is a reply to message #302788] |
Tue, 11 March 2008 03:48 |
|
cpjok
Messages: 425 Registered: September 2007
Karma: 0
|
Commander |
|
|
ok i did what it said but i dont know where this code gose and it has 2 ERRORS
Quote: | void zbl_Kamikaze_Suit_Crate::Created(GameObject *obj)
{
Attach_Script_Once(obj, "JFW_Blow_Up_On_Death", "Explosion_IonCannonBeacon");
float rand = Commands->Get_Random(29,301);
Team = Get_Object_Type(obj);
Commands->Start_Timer(obj, this, rand,0);
}
void zbl_Kamikaze_Suit_Crate::Timer_Expired(GameObject *obj, int number)
{
if (number == 0)
{
float rand = Commands->Get_Random(0,100);
if (rand >= 50.0f)
{
// nothing happens
}
else {
Commands->Apply_Damage(obj, 9999.0f, "BlamoKiller", 0);
Console_Input(StrFormat("msg Crate: Oh no! I guess that experimental kamikaze suit didn't work too well. I hope that %ls guy didn't get hurt. :(", Get_Wide_Team_Name(PTTEAM(Team))).c_str());
}
}
}
ScriptRegistrant<zbl_Kamikaze_Suit_Crate> zbl_Kamikaze_Suit_Crate_Registrant("zbl_Kamikaze_Suit_Crate", "");
|
ERROR 1 says duplicate
ERROR 2 says settings on crate are 91 evan tho there 100
-
Attachment: 1.JPG
(Size: 180.29KB, Downloaded 316 times)
-
Attachment: 2.JPG
(Size: 237.82KB, Downloaded 316 times)
|
|
|
|
|
|
|
|
|
|
|