Advertisement
Guest User

Guide example

a guest
Dec 27th, 2014
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.86 KB | None | 0 0
  1. /*
  2.     + MY OLD PROJECTS +
  3.     -------------------
  4.           _________                _________             __________
  5.         /   _______|             /   _______|          /  _________|
  6.        |  /                     |  /                  |  /
  7.        |  |  ______             |  |  ______          |  |
  8.        |  | |___   |            |  | |___   |         |  |
  9.        |  |     |  |            |  |     |  |         |  |
  10.        |  |____/   |            |  |____/   |         |  \_________
  11.        \__________/  eneration  \__________/  aming   \____________| reation
  12.  
  13.          _________
  14.         |    __   |
  15.         |   |  |  |
  16.         |   |__|  |                                        ____________   _           _
  17.         |   ______|              _                        |  __________| |_|         | |
  18.         |  |__________     _____| |       _       _       | |                        | |    ______
  19.         |    _______  |   |  ___  |      | |     | |      | |_______      _     _____| |   |   _  |
  20.         |   |       | |   | |   | |      | |     | |      |_______  |    | |   |  ___  |   |  |_| |
  21.         |   |       | |   | |   | |  _   | |     | |              | |    | |   | |   | |   |  ____|
  22.         |   |_______| |   | |___| |_| |  | |_____| |       _______| |    | |   | |___| |   | |________
  23.         |_____________|   |___________|  |_______  |      |_________|    |_|   |_______|   |__________|
  24.                                                  | |                                                    Creations
  25.                                           _      | |
  26.                                          | |_____| |                                                    
  27.                                          |_________|
  28.     + MY CURRENT PROJECT +
  29.     ----------------------
  30.             ________________
  31.             \              /
  32.         ___  \            /  ___     _________                 _____________
  33.         \  \  \          /  /  /    |   ___   |               |   _______   |
  34.          \  \  \        /  /  /     |  |   |  |               |  |       |  |
  35.           \  \  \      /  /  /      |  |   |  |               |  |       |__|
  36.            \  \  \    /  /  /       |  |___|  |               |  |
  37.             \  \  \  /  /  /        |   _    _|               |  |
  38.              \  \  \/  /  /         |  | \  \                 |  |        __
  39.               \  \    /  /          |  |  \  \                |  |       |  |
  40.                \  \__/  /           |  |   \  \____           |  |_______|  |
  41.                 \______/ ersus      |__|    \______| oleplay  |_____________| reations
  42.  
  43.  
  44.     ------------------------------
  45.     By:    Adnan Pasic (Denim/Pasa)
  46.     Version:            1.0 - Beta
  47.     Relase date:        27.12.2014
  48.     YT video: http://goo.gl/BcWx2u
  49.     IMGS:     http://goo.gl/RLWIAv
  50.    
  51.     + Contact +
  52.    
  53.     FB:       http://goo.gl/QPAOyP
  54.     Skype:            adnanpasic.1
  55.     ------------------------------
  56.  
  57.     Calbacks:
  58.         + ShowGuide(playerid, GuideID, Header[], LeftBlock[], Text1[], Text2[], Text3[])
  59.  
  60.     Note:
  61.         ++ You need to create a stock function [stock OnGuideResponse(playerid, guideid, response)] in your GM/FS where you use
  62.            the include, otherwise you will get an error (error 017: undefined symbol "OnGuideResponse")
  63.  
  64.         + When you use "ShowGuide" for the first time the variable "_GuideSite[playerid]" is set to 0 (for the sites)
  65. */
  66.  
  67. #include <a_samp>
  68. #include <zcmd>
  69.  
  70. #include "../Include/Guide.inc"
  71. //#include <Guide.inc>
  72.  
  73. new GuideTestSides[][] = {
  74.     "Site 1",
  75.     "Site 2",
  76.     "Site 3",
  77.     "Site 4"
  78. };
  79.  
  80. new GuideSidesText[][] = {
  81.     "This is the text of the first site!",
  82.     "Site two text is this",
  83.     "3th site text",
  84.     "This is the text of the last site.~n~I hope you like my guide system :)"
  85. };
  86.  
  87. stock OnGuideResponse(playerid, guideid, response) {
  88.     /*
  89.         "playerid" - playerid of the player that has the guide showed
  90.         "guideid" - is the id of the guide that you enter in the "ShowGuide" guide function
  91.         "response" - will return false if you press the "N" button
  92.         "response" - will return false if you press the "Y" button
  93.     */
  94.     if(!response) return ToggleGuide(playerid, false);
  95.  
  96.     if(guideid == 0) {
  97.         _GuideSite[playerid]++;
  98.  
  99.         if(_GuideSite[playerid] >= sizeof(GuideTestSides)) _GuideSite[playerid] = 0;
  100.  
  101.         new Sites[150] = "~w~";
  102.         for(new i = 0; i < sizeof(GuideTestSides); i++) {
  103.             if(_GuideSite[playerid] == i) format(Sites, 150, "%s~r~%s~w~~n~", Sites, GuideTestSides[i]);
  104.             else format(Sites, 150, "%s%s~n~", Sites, GuideTestSides[i]);
  105.         }
  106.  
  107.         ShowGuide(playerid, 0, "Test guide", Sites, GuideSidesText[_GuideSite[playerid]], "", "");
  108.     }
  109.     return 1;
  110. }
  111.  
  112. CMD:guide(playerid, params[]) {
  113.     new Sites[150] = "~r~";
  114.  
  115.     for(new i = 0; i < sizeof(GuideTestSides); i++) {
  116.         format(Sites, 150, "%s%s~w~~n~", Sites, GuideTestSides[i]);
  117.     }
  118.  
  119.     ShowGuide(playerid, 0, "Test guide", Sites, GuideSidesText[0], "", "");
  120.     return 1;
  121. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement