Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NetworkClientInfo *ci = this->GetInfo();
- switch (action) {
- case NETWORK_ACTION_GIVE_MONEY:
- if (!Company::IsValidID(ci->client_playas)) break;
- /* FALL THROUGH */
- case NETWORK_ACTION_CHAT:
- // receiveing general Chat
- // check if message starts with some "!help"
- if ( strncmp( msg, "!help", 5 )==0 ) {
- // Message !help sent back to player only
- NetworkServerSendChat( NETWORK_ACTION_CHAT_CLIENT, DESTTYPE_CLIENT, ci->client_id, "Helps commands are !rules !go", CLIENT_ID_SERVER );
- } else
- {
- // No !commandn send back chat to players
- NetworkServerSendChat(action, desttype, dest, msg, this->client_id, data);
- }
- break;
- case NETWORK_ACTION_CHAT_COMPANY:
- NetworkServerSendChat(action, desttype, dest, msg, this->client_id, data);
- break;
- case NETWORK_ACTION_CHAT_CLIENT:
- // Here best place when receiving private chat
- // Same here
- // check if message starts with some "!help"
- if ( strncmp( msg, "!help", 5 )==0 ) {
- // Message !help
- } else
- {
- // No !commandn send back chat to players
- NetworkServerSendChat(action, desttype, dest, msg, this->client_id, data);
- }
- //------------------------------------------------------------------------------------------------------------------------
- case NETWORK_ACTION_CHAT:
- // receiveing general Chat
- // check if message starts with some "!help"
- if ( strncmp( msg, "!rules", 5 )==0 ) {
- // Message !help sent back to player only
- NetworkServerSendChat( NETWORK_ACTION_CHAT_CLIENT, DESTTYPE_CLIENT, ci->client_id, "The rules of the Server are 1. Dont Block Other Player, 2. Dont steal from other Players, only Passengers and Mail 3. HAVE FUN !!!", CLIENT_ID_SERVER );
- } else
- {
- // No !commandn send back chat to players
- NetworkServerSendChat(action, desttype, dest, msg, this->client_id, data);
- }
- break;
- case NETWORK_ACTION_CHAT_COMPANY:
- NetworkServerSendChat(action, desttype, dest, msg, this->client_id, data);
- break;
- case NETWORK_ACTION_CHAT_CLIENT:
- // Here best place when receiving private chat
- // Same here
- // check if message starts with some "!help"
- if ( strncmp( msg, "!rules", 5 )==0 ) {
- // Message !help
- } else
- {
- // No !commandn send back chat to players
- NetworkServerSendChat(action, desttype, dest, msg, this->client_id, data);
- }
Add Comment
Please, Sign In to add comment