SSGM Help [message #275968] |
Sat, 28 July 2007 20:21 ![Go to next message Go to next message](/theme/Renegade_Forums/images/down.png) |
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?
![http://i4.photobucket.com/albums/y133/FMAROCKS/sniper74halosigsnipedontforgettogiv.png](http://i4.photobucket.com/albums/y133/FMAROCKS/sniper74halosigsnipedontforgettogiv.png)
Creator: AoBFrost
|
|
|
Re: SSGM Help [message #275970 is a reply to message #275968] |
Sat, 28 July 2007 20:28 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) ![Go to next message Go to next message](/theme/Renegade_Forums/images/down.png) |
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 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) ![Go to next message Go to next message](/theme/Renegade_Forums/images/down.png) |
![](http://renegadeforums.com/images/custom_avatars/27.png) |
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 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) ![Go to next message Go to next message](/theme/Renegade_Forums/images/down.png) |
![](http://renegadeforums.com/images/custom_avatars/27.png) |
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 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) ![Go to next message Go to next message](/theme/Renegade_Forums/images/down.png) |
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!
![http://i4.photobucket.com/albums/y133/FMAROCKS/sniper74halosigsnipedontforgettogiv.png](http://i4.photobucket.com/albums/y133/FMAROCKS/sniper74halosigsnipedontforgettogiv.png)
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 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) ![Go to next message Go to next message](/theme/Renegade_Forums/images/down.png) |
![](http://renegadeforums.com/images/custom_avatars/27.png) |
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 - )
|
|
|
|
|