SSGM Help [message #275968] |
Sat, 28 July 2007 20:21 |
Sn1per74*
Messages: 939 Registered: April 2006
Karma: 0
|
Colonel |
|
|
I have a few questions about chat hooks. First off, how do you make the command effect a player besides yourself. For example,
!kill (player)
2. Can you rotate objects using C++?
3. I have this code...
Quote: | else if (strncmp(Msg3,"!wall",5) == 0) { // change 12 to how many letters command + ! is change !yourcommand to what you want
if (obj){ // LEAVE THIS VERY IMPORTANT
Vector3 Pos = Commands->Get_Position(obj);
Pos.X += 3;
Commands->Create_Object("GDI_Humm-vee_Player",Pos);
Commands->Set_Model("GDI_Humm-vee_Player",obj);
char message[256];
sprintf(message,"ppage %d Wall... Created",ID);
Console_Input(message);
}
}
|
I'm trying to set the model of the Humm-vee to the large_blocker. But this code isn't working. What am I doing wrong?
Creator: AoBFrost
|
|
|
Re: SSGM Help [message #275970 is a reply to message #275968] |
Sat, 28 July 2007 20:28 |
Genesis2001
Messages: 1397 Registered: August 2006
Karma: 0
|
General (1 Star) |
|
|
For killing a player, use:
Commands->Apply_Damage(<game_obj>,99999.0f,"BlamoKiller",<game_obj>);
<game_obj> = the player that you want to be killed.
I'm not 100% sure on the last parameter, but the other parameters I'm sure on.
-MathK1LL
|
|
|
|
|
Re: SSGM Help [message #275976 is a reply to message #275968] |
Sat, 28 July 2007 21:01 |
|
Whitedragon
Messages: 832 Registered: February 2003 Location: California
Karma: 1
|
Colonel |
|
|
Wall command
class WallChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID); //Gets the gameobj of the player using the command.
if (obj) {
Vector3 Pos = Commands->Get_Position(obj);
Pos.X += 3.0f;
GameObject *Wall = Commands->Create_Object("GDI_Humm-vee_Player",Pos);
Commands->Set_Model(Wall,"whatever");
Console_Input(StrFormat("ppage %d Wall... Created",ID).c_str());
}
}
};
ChatCommandRegistrant<WallChatCommand> WallChatCommandReg("!wall",CHATTYPE_ALL,0,GAMEMODE_ALL);
The following will take the first word that comes after the command, treat it as a nick, and try to get the gameobj associated with it.
GameObject *obj = Get_GameObj_By_Player_Name(Text[1].c_str());
Black-Cell.net
Network Administrator (2003 - )
DragonServ, Renegade's first IRC interface bot
Creator and lead coder (2002 - )
Dragonade, Renegade's first server side modification
Lead coder (2005 - )
|
|
|
|
|
Re: SSGM Help [message #275986 is a reply to message #275968] |
Sat, 28 July 2007 21:39 |
|
Whitedragon
Messages: 832 Registered: February 2003 Location: California
Karma: 1
|
Colonel |
|
|
Commands->Set_Facing/Commands->Get_Facing
Black-Cell.net
Network Administrator (2003 - )
DragonServ, Renegade's first IRC interface bot
Creator and lead coder (2002 - )
Dragonade, Renegade's first server side modification
Lead coder (2005 - )
|
|
|
Re: SSGM Help [message #275988 is a reply to message #275976] |
Sat, 28 July 2007 21:51 |
Sn1per74*
Messages: 939 Registered: April 2006
Karma: 0
|
Colonel |
|
|
Whitedragon wrote on Sat, 28 July 2007 23:01 | Wall command
[code]
class WallChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID); //Gets the gameobj of the player using the command.
if (obj) {
Vector3 Pos = Commands->Get_Position(obj);
Pos.X += 3.0f;
GameObject *Wall = Commands->Create_Object("GDI_Humm-vee_Player",Pos);
Commands->Set_Model(Wall,"whatever");
Console_Input(StrFormat("ppage %d Wall... Created",ID).c_str());
}
}
};
|
I dun quite get that. I don't see a ! commands or anything like that in there.
BTW: Thanks a whole lot WD- you da best!
Creator: AoBFrost
[Updated on: Sat, 28 July 2007 21:51] Report message to a moderator
|
|
|
Re: SSGM Help [message #275990 is a reply to message #275968] |
Sat, 28 July 2007 22:06 |
|
Whitedragon
Messages: 832 Registered: February 2003 Location: California
Karma: 1
|
Colonel |
|
|
You missed part of it.
ChatCommandRegistrant<WallChatCommand> WallChatCommandReg("!wall",CHATTYPE_ALL,0,GAMEMODE_ALL);
Black-Cell.net
Network Administrator (2003 - )
DragonServ, Renegade's first IRC interface bot
Creator and lead coder (2002 - )
Dragonade, Renegade's first server side modification
Lead coder (2005 - )
|
|
|
|
|