Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release Rules plugin
#1
NOTICE
This plugin does not work with the newest versoin of the server addon
Please wait while I convert them

What is it?
A small plugin that shows the rules when a user types !rules
Haven't gotten the chance to test it (net really sucks) but in theory it should work

[Image: 834vg.png]

How do I install it?
Extract all the folders in the zip to your server
Then go to /addon/ and open the file rules.txt
Here you can change all rules

Changelog
1.0
- Initial release
1.0.0.0.0.0.1
- Fixed command bug
- Made it so that the chat doesn't go to the game

Source
C++ Code
  1. //JariZ's Rules plugin
  2.  
  3. #include "stdafx.h"
  4. #include "windows.h"
  5. #include <ctime>
  6. #include <sstream>
  7. #include <fstream>
  8. #include <iostream>
  9. #include <vector>
  10. using namespace std;
  11. using namespace Server::CPlugin;
  12.  
  13. void con(string ss)
  14. {
  15. ConsolePrint((PCHAR)ss.c_str());
  16. }
  17.  
  18. vector<string> memrules;
  19. vector<string> getRules()
  20. {
  21. vector<string> output;
  22. ifstream rules("addon\\rules.txt");
  23. if(rules.is_open())
  24. {
  25. while(rules.good())
  26. {
  27. string rule = "";
  28. getline(rules, rule);
  29.  
  30. output.push_back(rule);
  31. }
  32. rules.close();
  33. }
  34. else { output.push_back("Rules are not loaded (couldn't open file)"); }
  35. return output;
  36. }
  37. PLUGIN_API_ONSERVERLOAD
  38. {
  39. ConsolePrint("Plugin: " PLUG_NAME " loaded. Author: " PLUG_AUTHOR);
  40. ConsolePrint("Loading rules.txt into memory...");
  41. memrules = getRules();
  42. con("---- Current rules ----");
  43. for each(string s in memrules)
  44. {
  45. con(s);
  46. }
  47. con("-----------------------");
  48. }
  49.  
  50. PLUGIN_API_ONSAY
  51. {
  52. //con(Message);
  53. string s = Message;
  54. //con(s.substr(0, 6));
  55. if(s.substr(0, 6) == "!rules")
  56. {
  57. //con("rules = okay");
  58. for each(string s in memrules)
  59. {
  60. //con(s);
  61. ServerSay((PCHAR)s.c_str(), true);
  62. }
  63. return CHAT_NONE;
  64. }
  65. return CHAT_ALL;
  66. }


Download

.zip   RulesPlugin4.zip (Size: 15.08 KB / Downloads: 59)
Reply

#2
lulz it's broken, will fix it in a few hours
fix'd
Reply

#3
euhm now this will block the whole chat ...

Code:
PLUGIN_API_ONSAY
{
    //con(Message);
    string s = Message;
    //con(s.substr(0, 6));
    if(s.substr(0, 6) == "!rules")
    {
        con("rules = okay");
        for each(string s in memrules)
        {
            //con(s);
            ServerSay((PCHAR)s.c_str(), true);
        }
        return CHAT_NONE;
    }
    return CHAT_ALL;
}

edit: nvm you just fixed it D:
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#4
yep, like I said, hadn't tested it.
Reply

#5
Not working for me
[Image: jace.png]
Reply

#6
Not working (
Reply

#7
Still does not work, after your update.
Reply

#8
Are you sure? It works fine for me...
Explain what's not working please
I really suck at releasing stuff I guess, stupid winrar...
:FUU: :FUU: :FUU: :FUU:
Reuploaded, blame itsmods attachment system and/or winrar
Reply

#9
Imma test later not at computer ill respond if it works if there are still problems with it not working
Reply

#10
FUCK IT BLOCKS THE WHOLE CHAT GODDAMNED Fuu
Fixing it (again)
hold on...
ok fixed, (I HOPE)
didn't thought i'd have this much work on a stupid plugin like this
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Wink Plugin with !ban !kick and !tampban clemi555 3 4,167 11-09-2013, 09:21
Last Post: clemi555
  AntiNoScope Plugin clemi555 5 4,748 11-08-2013, 19:13
Last Post: clemi555
  [Release] Bunker Plugin 1.3 archit 68 41,563 10-30-2013, 11:59
Last Post: clacki
  Help Modifying plugin maverigh 5 5,670 10-19-2013, 10:29
Last Post: Nekochan
Shocked [Request] Switch plugin axel-le-meilleur 6 5,178 10-19-2013, 06:59
Last Post: iRoNinja
  [Release] Yurio Map Plugin Yurio 101 62,284 09-26-2013, 13:38
Last Post: First_Semyon
Brick [Release] v1.1 ChangeMap/NextMap Plugin without any configuration milchshake 23 18,638 09-23-2013, 13:18
Last Post: SgtLegend
  Help !say Plugin (like the !say from GodPlugin) Hallla 0 2,711 09-13-2013, 09:31
Last Post: Hallla
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 33,275 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
  Search Plugin Fluid Killcam N3xT_974 1 3,063 09-10-2013, 20:27
Last Post: Nekochan

Forum Jump:


Users browsing this thread:
3 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.