Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SpectateSpeedChatCommand : public ChatCommandClass {
- void Triggered(int ID,const TokenClass &Text,int ChatType)
- {
- Console_Output("[BB] blah.\n");
- if (Text.size() > 1 && atof(Text[1].c_str()) )
- {
- GameObject *obj = Get_GameObj(ID);
- const wchar_t* nick = Get_Wide_Player_Name(obj);
- float speed = (float)atof(Text[1].c_str());
- if (IsOnSpectateList(nick))
- {
- Console_Output("[BB] '%ls' is setting their spectate speed to %s.\n", nick, Text[1].c_str());
- char msg[256];
- sprintf(msg,"cmsgp %d 0,255,0 [RxD] Setting your speed to %s.", ID, Text[1].c_str() );
- Console_Input(msg);
- SetMaxSpeed(obj, speed);
- }
- else
- {
- Console_Output("[BB] '%ls' is not in Spectate mode.\n",nick);
- char msg[256];
- sprintf(msg,"cmsgp %d 0,255,0 [RxD] You must be in Spectate Mode to use this command. ", ID );
- Console_Input(msg);
- }
- }
- else
- {
- char msg[256];
- sprintf(msg,"cmsgp %d 0,255,0 [RxD] You must enter a speed amount.", ID );
- Console_Input(msg);
- }
- }
- };
- ChatCommandRegistrant<SpectateSpeedChatCommand> SpectateSpeedChatCommandReg("!SpectateSpeed;!sspeed",CHATTYPE_TEAM,0,GAMEMODE_ALL);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement