Guest User

Script de chez Orange

a guest
May 13th, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 12.63 KB | None | 0 0
  1. #include <a_samp>
  2. #include <mSelection>
  3. #include <streamer>
  4. #define MENU_ORANGE1        3000
  5. #define MENU_ORANGE2        4000
  6. #define MENU_ORANGE3        5000
  7. #define DIALOGUE_CREDITS    6000
  8. #define CONTRAT_ORDINATEUR  7000
  9. #define CONTRAT_PORTABLE    8000
  10. #define CONTRAT_CASQUE      9000
  11. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  12. #if defined FILTERSCRIPT
  13. public OnFilterScriptInit()
  14. {
  15.     print("\n--------------------------------------");
  16.     print("Orange");
  17.     print("--------------------------------------\n");
  18.     return 1;
  19. }
  20.  
  21. public OnFilterScriptExit()
  22. {
  23.     return 1;
  24. }
  25.  
  26. #else
  27.  
  28. main()
  29. {
  30.     print("\n----------------------------------");
  31.     print("Orange");
  32.     print("----------------------------------\n");
  33. }
  34.  
  35. #endif
  36.  
  37. public OnGameModeInit()
  38. {
  39.     Create3DTextLabel("/acheter\nOrdinateur", 0x0000FFFF, -1948.4587,450.0772,1035.1946, 40.0, 0, 0);
  40.     CreatePickup(1239, 1, -1948.4587,450.0772,1035.1946, -1);
  41.     Create3DTextLabel("/acheter\nPortable", 0x0000FFFF, -1946.1958,450.2138,1035.1946, 40.0, 0, 0);
  42.     CreatePickup(1239, 1, -1946.1958,450.2138,1035.1946, -1);
  43.     Create3DTextLabel("/acheter\nCasque", 0x0000FFFF, -1944.1830,450.3306,1035.1946, 40.0, 0, 0);
  44.     CreatePickup(1239, 1, -1944.1830,450.3306,1035.1946, -1);
  45.     /* Mapping */
  46.  
  47.     CreateDynamicObject(19381, -1945.96838, 446.75568, 1034.10860,   0.00000, 90.00000, 0.00000);
  48.     CreateDynamicObject(19381, -1945.96130, 437.12759, 1034.10860,   0.00000, 90.00000, 0.00000);
  49.     CreateDynamicObject(19446, -1951.24683, 437.10828, 1035.91500,   0.00000, 0.00000, 0.00000);
  50.     CreateDynamicObject(19446, -1951.23999, 449.93539, 1035.91500,   0.00000, 0.00000, 0.00000);
  51.     CreateDynamicObject(19384, -1951.24072, 443.51987, 1035.91500,   0.00000, 0.00000, 0.00000);
  52.     CreateDynamicObject(19446, -1946.35571, 432.38879, 1035.91500,   0.00000, 0.00000, 90.00000);
  53.     CreateDynamicObject(19446, -1941.48999, 437.23074, 1035.91500,   0.00000, 0.00000, 0.00000);
  54.     CreateDynamicObject(19446, -1941.49463, 446.79074, 1035.91500,   0.00000, 0.00000, 0.00000);
  55.     CreateDynamicObject(19446, -1946.36023, 451.60590, 1035.91500,   0.00000, 0.00000, 90.00000);
  56.     CreateDynamicObject(1504, -1951.21362, 442.76944, 1034.16883,   0.00000, 0.00000, 90.00000);
  57.     CreateDynamicObject(2308, -1943.09961, 432.93799, 1034.18210,   0.00000, 0.00000, 0.00000);
  58.     CreateDynamicObject(2308, -1949.65784, 433.93704, 1034.18210,   0.00000, 0.00000, 180.00000);
  59.     CreateDynamicObject(19354, -1946.43860, 433.01193, 1035.91500,   0.00000, 0.00000, 0.00000);
  60.     CreateDynamicObject(19354, -1943.18408, 434.58578, 1035.91500,   0.00000, 0.00000, 90.00000);
  61.     CreateDynamicObject(19384, -1948.03198, 434.58783, 1035.91500,   0.00000, 0.00000, 90.00000);
  62.     CreateDynamicObject(19384, -1945.57654, 434.58276, 1035.91500,   0.00000, 0.00000, 90.00000);
  63.     CreateDynamicObject(19427, -1950.42993, 434.58377, 1035.91500,   0.00000, 0.00000, 90.00000);
  64.     CreateDynamicObject(1491, -1947.27551, 434.62497, 1034.16880,   0.00000, 0.00000, 180.00000);
  65.     CreateDynamicObject(1491, -1946.35596, 434.57874, 1034.16880,   0.00000, 0.00000, 0.00000);
  66.     CreateDynamicObject(18070, -1946.40356, 453.16055, 1034.65376,   0.00000, 0.00000, 0.00000);
  67.     CreateDynamicObject(18865, -1946.82666, 451.03525, 1035.15004,   0.00000, 0.00000, 0.00000);
  68.     CreateDynamicObject(18866, -1946.66565, 451.08392, 1035.15000,   0.00000, 0.00000, 0.00000);
  69.     CreateDynamicObject(18867, -1946.47351, 451.01627, 1035.15000,   0.00000, 0.00000, 0.00000);
  70.     CreateDynamicObject(18867, -1946.33752, 451.08078, 1035.15000,   0.00000, 0.00000, 0.00000);
  71.     CreateDynamicObject(18868, -1946.20825, 451.02045, 1035.15000,   0.00000, 0.00000, 0.00000);
  72.     CreateDynamicObject(18869, -1946.08459, 451.11133, 1035.15000,   0.00000, 0.00000, 0.00000);
  73.     CreateDynamicObject(18870, -1945.96936, 451.01370, 1035.15000,   0.00000, 0.00000, 0.00000);
  74.     CreateDynamicObject(18871, -1945.84509, 451.13034, 1035.15000,   0.00000, 0.00000, 0.00000);
  75.     CreateDynamicObject(18872, -1945.72473, 451.03882, 1035.15000,   0.00000, 0.00000, 0.00000);
  76.     CreateDynamicObject(18873, -1945.59277, 451.14349, 1035.15000,   0.00000, 0.00000, 0.00000);
  77.     CreateDynamicObject(18874, -1945.47388, 451.03711, 1035.15000,   0.00000, 0.00000, 0.00000);
  78.     CreateDynamicObject(2190, -1949.34583, 451.28638, 1035.15753,   0.00000, 0.00000, 0.00000);
  79.     CreateDynamicObject(2190, -1948.58459, 451.28799, 1035.15753,   0.00000, 0.00000, 0.00000);
  80.     CreateDynamicObject(2190, -1947.84534, 451.28845, 1035.15753,   0.00000, 0.00000, 0.00000);
  81.     CreateDynamicObject(2190, -1947.08093, 451.30411, 1035.15753,   0.00000, 0.00000, 0.00000);
  82.     CreateDynamicObject(19421, -1944.59180, 451.00958, 1035.16918,   0.00000, 0.00000, 0.00000);
  83.     CreateDynamicObject(19422, -1944.28003, 450.93530, 1035.16920,   0.00000, 0.00000, 0.00000);
  84.     CreateDynamicObject(19422, -1943.94763, 451.06409, 1035.16920,   0.00000, 0.00000, 0.00000);
  85.     CreateDynamicObject(19423, -1943.67810, 450.91919, 1035.16920,   0.00000, 0.00000, 0.00000);
  86.     CreateDynamicObject(19384, -1944.69751, 440.92828, 1035.91500,   0.00000, 0.00000, 0.00000);
  87.     CreateDynamicObject(19354, -1943.00793, 445.59979, 1035.91500,   0.00000, 0.00000, 90.00000);
  88.     CreateDynamicObject(19354, -1944.69446, 444.08368, 1035.91500,   0.00000, 0.00000, 0.00000);
  89.     CreateDynamicObject(19384, -1943.00061, 442.45819, 1035.91500,   0.00000, 0.00000, 90.00000);
  90.     CreateDynamicObject(19354, -1944.68738, 437.82303, 1035.91500,   0.00000, 0.00000, 0.00000);
  91.     CreateDynamicObject(1491, -1944.71619, 440.18250, 1034.16880,   0.00000, 0.00000, 90.00000);
  92.     CreateDynamicObject(1491, -1943.78882, 442.46896, 1034.16880,   0.00000, 0.00000, 0.00000);
  93.     CreateDynamicObject(19384, -1942.99402, 439.72311, 1035.91500,   0.00000, 0.00000, 90.00000);
  94.     CreateDynamicObject(1491, -1943.76660, 439.71985, 1034.16880,   0.00000, 0.00000, 0.00000);
  95.     CreateDynamicObject(2602, -1943.78162, 435.05780, 1033.97656,   0.00000, 0.00000, 180.00000);
  96.     CreateDynamicObject(19354, -1944.68518, 436.20386, 1035.91500,   0.00000, 0.00000, 0.00000);
  97.     CreateDynamicObject(19354, -1943.07288, 436.17703, 1035.91500,   0.00000, 0.00000, 0.00000);
  98.     CreateDynamicObject(2602, -1942.03552, 435.05292, 1033.97656,   0.00000, 0.00000, 180.00000);
  99.     CreateDynamicObject(2738, -1942.94666, 445.15613, 1034.77864,   0.00000, 0.00000, 0.00000);
  100.     CreateDynamicObject(2523, -1943.69458, 443.01486, 1034.19440,   0.00000, 0.00000, 180.00000);
  101.     CreateDynamicObject(2523, -1942.58142, 438.53030, 1034.19440,   0.00000, 0.00000, 180.00000);
  102.     CreateDynamicObject(19427, -1943.07031, 437.92270, 1035.91500,   0.00000, 0.00000, 90.00000);
  103.     CreateDynamicObject(19379, -1945.96130, 437.12759, 1037.50260,   0.00000, 90.00000, 0.00000);
  104.     CreateDynamicObject(19379, -1945.96838, 446.75571, 1037.50260,   0.00000, 90.00000, 0.00000);
  105.     CreateDynamicObject(19354, -1950.51721, 441.04105, 1035.91500,   0.00000, 0.00000, 90.00000);
  106.     CreateDynamicObject(1491, -1948.99707, 438.67545, 1034.16880,   0.00000, 0.00000, 90.00000);
  107.     CreateDynamicObject(19384, -1949.00195, 439.41519, 1035.91500,   0.00000, 0.00000, 0.00000);
  108.     CreateDynamicObject(19354, -1948.99524, 436.20505, 1035.91500,   0.00000, 0.00000, 0.00000);
  109.     CreateDynamicObject(2308, -1950.54590, 436.14682, 1034.18210,   0.00000, 0.00000, -90.00000);
  110.  
  111.     return 1;
  112. }
  113.  
  114. public OnPlayerCommandText(playerid, cmdtext[])
  115. {
  116.     if(!strcmp(cmdtext,"/lieu",true))
  117.     {
  118.         SetPlayerPos(playerid,-1950.5940,443.4616,1035.5147);
  119.         return 1;
  120.     }
  121.     if(!strcmp(cmdtext,"/contrat",true))
  122.     {
  123.         if(PlayerToPoint(1, playerid,-1944.1212,433.4503,1035.1946)) // Ordinateur
  124.         {
  125.             ShowPlayerDialog(playerid, CONTRAT_ORDINATEUR, DIALOG_STYLE_MSGBOX, "Ordinateur", "{0000FF}Votre ordinateur vous couteras {50B54A}1050€\n{0000FF}Ecrant tactile {50B54A}17,3pouces 43,9cm\n{0000FF}Système d'exploitation : {50B54A}Windows 8\n{0000FF}Carte graphique : {50B54A}Intel Core I-5", "Accepter", "Refuser");
  126.         }
  127.         else if(PlayerToPoint(1, playerid,-1948.8120,433.4081,1035.1946)) // Téléphone
  128.         {
  129.             ShowPlayerDialog(playerid, CONTRAT_PORTABLE, DIALOG_STYLE_MSGBOX, "Téléphone", "{0000FF}Votre téléphone vous couteras {50B54A}520€", "Accepter", "Refuser");
  130.         }
  131.         else if(PlayerToPoint(1, playerid,-1950.1018,437.0076,1035.1946)) // Casque
  132.         {
  133.             ShowPlayerDialog(playerid, CONTRAT_CASQUE, DIALOG_STYLE_MSGBOX, "Casque", "{0000FF}Votre Beat's vous couteras {50B54A}399€", "Accepter", "Refuser");
  134.         }
  135.         return 1;
  136.     }
  137.     if(!strcmp(cmdtext,"/credits",true))
  138.     {
  139.         ShowPlayerDialog(playerid, DIALOGUE_CREDITS, DIALOG_STYLE_MSGBOX, "{E61FFC}Les crédits", "{0000FF}Chris53340 {FF8000}# {0000FF}Kiki53\n{FF8000}Ainsi que {0000FF}la communauté francophone de SAMP{FF8000}.", "Fermer", "");
  140.         return 1;
  141.     }
  142.     if(!strcmp(cmdtext,"/acheter", true))
  143.     {
  144.         if(PlayerToPoint(1, playerid,-1948.4587,450.0772,1035.1946))
  145.         {
  146.               new Ordinateur[1];
  147.             Ordinateur[0] = 2190;
  148.             ShowModelSelectionMenuEx(playerid, Ordinateur, 1, "Choisie bien l'Ordinateur.", MENU_ORANGE1, 0.0, 0.0, 180.0);
  149.         }
  150.         else if(PlayerToPoint(1, playerid,-1946.1958,450.2138,1035.1946))
  151.         {
  152.             new Portable[10];
  153.             Portable[0] = 18865;
  154.             Portable[1] = 18866;
  155.             Portable[2] = 18867;
  156.             Portable[3] = 18868;
  157.             Portable[4] = 18869;
  158.             Portable[5] = 18870;
  159.             Portable[6] = 18871;
  160.             Portable[7] = 18872;
  161.             Portable[8] = 18873;
  162.             Portable[9] = 18874;
  163.             ShowModelSelectionMenuEx(playerid, Portable, 10, "Quelle portable souhaite-tu?", MENU_ORANGE2, 90.0, 180.0, 0.0);
  164.         }
  165.         else if(PlayerToPoint(1, playerid,-1944.1830,450.3306,1035.1946))
  166.         {
  167.             new Casque[4];
  168.             Casque[0] = 19421;
  169.             Casque[1] = 19422;
  170.             Casque[2] = 19423;
  171.             Casque[3] = 19424;
  172.             ShowModelSelectionMenuEx(playerid, Casque, 4, "Choisie la couleur de ton casque audio.", MENU_ORANGE3, 90.0, 90.0, 0.0);
  173.         }
  174.     }
  175.     return 1;
  176. }
  177.  
  178. public OnPlayerModelSelectionEx(playerid, response, extraid, modelid)
  179. {
  180.     if(extraid == MENU_ORANGE1)
  181.     {
  182.         if(response)
  183.         {
  184.             SendClientMessage(playerid, 0xFF0000FF, "La responsable clientelle t'attend, va la voir dans le bureau.");
  185.             CreatePickup(1318, 15, -1945.5288,435.3924,1035.1946, -1);
  186.             CreatePickup(1239, 15, -1944.1212,433.4503,1035.1946, -1);
  187.             CreateDynamicObject(modelid, -1942.93604, 433.12875, 1034.99130,   0.00000, 0.00000, -90.00000);// ID du carton pour le PC :1221
  188.         }
  189.         else
  190.         {
  191.             SendClientMessage(playerid, 0xFF0000FF, "Tu n'a rien choisie.");
  192.         }
  193.     }
  194.     if(extraid == MENU_ORANGE2)
  195.     {
  196.         if(response)
  197.         {
  198.             SendClientMessage(playerid, 0xFF0000FF, "La responsable clientelle t'attend, va la voir dans le bureau.");
  199.             CreatePickup(1318, 15, -1948.0116,435.2344,1035.1946, -1);
  200.             CreatePickup(1239, 15, -1948.8120,433.4081,1035.1946, -1);
  201.             CreateDynamicObject(modelid, -1949.48730, 433.70953, 1034.95730,   0.00000, 0.00000, 90.00000);
  202.         }
  203.         else
  204.         {
  205.             SendClientMessage(playerid, 0xFF0000FF, "Tu n'a rien choisie.");
  206.         }
  207.     }
  208.     if(extraid == MENU_ORANGE3)
  209.     {
  210.         if(response)
  211.         {
  212.             SendClientMessage(playerid, 0xFF0000FF, "La responsable clientelle t'attend, va la voir dans le bureau.");
  213.             CreatePickup(1318, 15, -1948.3815,439.4629,1035.1946, -1);
  214.             CreatePickup(1239, 15, -1950.1018,437.0076,1035.1946, -1);
  215.             CreateDynamicObject(modelid, -1950.07642, 436.30948, 1034.98014, 0.00000, 0.00000, 180.00000);
  216.         }
  217.         else
  218.         {
  219.             SendClientMessage(playerid, 0xFF0000FF, "Tu n'a rien choisie.");
  220.         }
  221.     }
  222.     return 1;
  223. }
  224. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  225. {
  226.     if(IsPlayerConnected(playerid))
  227.     {
  228.         new Float:oldposx, Float:oldposy, Float:oldposz;
  229.         new Float:tempposx, Float:tempposy, Float:tempposz;
  230.         GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  231.         tempposx = (oldposx -x);
  232.         tempposy = (oldposy -y);
  233.         tempposz = (oldposz -z);
  234.         if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  235.         {
  236.             return 1;
  237.         }
  238.     }
  239.     return 0;
  240. }
Advertisement
Add Comment
Please, Sign In to add comment