Guest User

Untitled

a guest
Jul 17th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.17 KB | None | 0 0
  1. NetworkClientInfo *ci = this->GetInfo();
  2. switch (action) {
  3. case NETWORK_ACTION_GIVE_MONEY:
  4. if (!Company::IsValidID(ci->client_playas)) break;
  5. /* FALL THROUGH */
  6. case NETWORK_ACTION_CHAT:
  7. // receiveing general Chat
  8. // check if message starts with some "!help"
  9. if ( strncmp( msg, "!help", 5 )==0 ) {
  10. // Message !help sent back to player only
  11. NetworkServerSendChat( NETWORK_ACTION_CHAT_CLIENT, DESTTYPE_CLIENT, ci->client_id, "Helps commands are !rules !go", CLIENT_ID_SERVER );
  12. } else
  13. {
  14. // No !commandn send back chat to players
  15. NetworkServerSendChat(action, desttype, dest, msg, this->client_id, data);
  16. }
  17. break;
  18. case NETWORK_ACTION_CHAT_COMPANY:
  19. NetworkServerSendChat(action, desttype, dest, msg, this->client_id, data);
  20. break;
  21. case NETWORK_ACTION_CHAT_CLIENT:
  22. // Here best place when receiving private chat
  23. // Same here
  24. // check if message starts with some "!help"
  25. if ( strncmp( msg, "!help", 5 )==0 ) {
  26. // Message !help
  27. } else
  28. {
  29. // No !commandn send back chat to players
  30. NetworkServerSendChat(action, desttype, dest, msg, this->client_id, data);
  31. }
  32.  
  33. //------------------------------------------------------------------------------------------------------------------------
  34. case NETWORK_ACTION_CHAT:
  35. // receiveing general Chat
  36. // check if message starts with some "!help"
  37. if ( strncmp( msg, "!rules", 5 )==0 ) {
  38. // Message !help sent back to player only
  39. 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 );
  40. } else
  41. {
  42. // No !commandn send back chat to players
  43. NetworkServerSendChat(action, desttype, dest, msg, this->client_id, data);
  44. }
  45. break;
  46. case NETWORK_ACTION_CHAT_COMPANY:
  47. NetworkServerSendChat(action, desttype, dest, msg, this->client_id, data);
  48. break;
  49. case NETWORK_ACTION_CHAT_CLIENT:
  50. // Here best place when receiving private chat
  51. // Same here
  52. // check if message starts with some "!help"
  53. if ( strncmp( msg, "!rules", 5 )==0 ) {
  54. // Message !help
  55. } else
  56. {
  57. // No !commandn send back chat to players
  58. NetworkServerSendChat(action, desttype, dest, msg, this->client_id, data);
  59. }
Add Comment
Please, Sign In to add comment