Guest User

Biz Maker for GTA-O

a guest
May 2nd, 2010
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 11.14 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. /*===================================================================================
  4. Ceci est un Biz Maker, s'est pour les gens qui ne savent pas comment rajouter des Biz
  5. Donc ce FS vas vous faciliter la tache ;)
  6. Créateur Rodion_Smith
  7. Adresse e-Mail: [email protected]
  8. =====================================================================================*/
  9.  
  10. #define FILTERSCRIPT
  11. #define COLOR_LIGHTBLUE 0x33CCFFAA
  12. forward split(const strsrc[], strdest[][], delimiter);
  13.  
  14. new Menu:Biz;
  15. new SetWorld;
  16.  
  17. strtok(const string[], &index)
  18. {
  19.     new length = strlen(string);
  20.     while ((index < length) && (string[index] <= ' '))
  21.     {
  22.         index++;
  23.     }
  24.  
  25.     new offset = index;
  26.     new result[20];
  27.     while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  28.     {
  29.         result[index - offset] = string[index];
  30.         index++;
  31.     }
  32.     result[index - offset] = EOS;
  33.     return result;
  34. }
  35.  
  36.  
  37. public split(const strsrc[], strdest[][], delimiter)
  38. {
  39.     new i, li;
  40.     new aNum;
  41.     new len;
  42.     while(i <= strlen(strsrc)){
  43.         if(strsrc[i]==delimiter || i==strlen(strsrc)){
  44.             len = strmid(strdest[aNum], strsrc, li, i, 128);
  45.             strdest[aNum][len] = 0;
  46.             li = i+1;
  47.             aNum++;
  48.         }
  49.         i++;
  50.     }
  51.     return 1;
  52. }
  53.  
  54. public OnFilterScriptInit()
  55. {
  56.     print("\n--------------------------------------");
  57.     print(" In-Game Biz Maker , By Rodion_Smith!");
  58.     print("--------------------------------------\n");
  59.     Biz = CreateMenu("Biz", 1, 50.0, 180.0, 200.0, 200.0);
  60.     SetMenuColumnHeader(Menu:Biz, 0, "Biz");
  61.     AddMenuItem(Menu:Biz, 0, "Gun Shop 1");
  62.     AddMenuItem(Menu:Biz, 0, "Gun Shop 2");
  63.     AddMenuItem(Menu:Biz, 0, "Restaurant");
  64.     AddMenuItem(Menu:Biz, 0, "Police Armurie");
  65.     AddMenuItem(Menu:Biz, 0, "City Bank");
  66.     AddMenuItem(Menu:Biz, 0, "Bar");
  67.     AddMenuItem(Menu:Biz, 0, "Hotel");
  68.     AddMenuItem(Menu:Biz, 0, "Restaurant Life");
  69.     AddMenuItem(Menu:Biz, 0, "Casino");
  70.     AddMenuItem(Menu:Biz, 0, "Magasin Vetements 1");
  71.     AddMenuItem(Menu:Biz, 0, "Magasin Vetements 2");
  72.     AddMenuItem(Menu:Biz, 0, "Magasin Vetements 3");
  73.     AddMenuItem(Menu:Biz, 0, "Magasin Vetements 4");
  74.     AddMenuItem(Menu:Biz, 0, "Choisir un Biz");
  75.     return 1;
  76. }
  77.  
  78. public OnFilterScriptExit()
  79. {
  80.     return 1;
  81. }
  82.  
  83. main()
  84. {
  85.     print("\n----------------------------------");
  86.     print(" In-Game Biz Maker , By Rodion Smith!");
  87.     print("----------------------------------\n");
  88. }
  89.  
  90. public OnPlayerCommandText(playerid, cmdtext[])
  91. {
  92.     new string[256];
  93.     new cmd[256];
  94.     new tmp[256];
  95.     new idx;
  96.     cmd = strtok(cmdtext, idx);
  97. //----------------------------------------------Ne sert à rien-----------------------------------------------------
  98.     if(strcmp(cmd, "/setbizworld", true) == 0)
  99.     {
  100.         if(IsPlayerConnected(playerid))
  101.         {
  102.             tmp = strtok(cmdtext, idx);
  103.             if(!strlen(tmp))
  104.             {
  105.                 SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /SetbizWorld [World]");
  106.                 return 1;
  107.             }
  108.             new level;
  109.             level = strval(tmp);
  110.             {
  111.                     SetWorld = level;
  112.                     format(string, sizeof(string), "Biz World est mis à %d", SetWorld);
  113.                     SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  114.             }
  115.         }
  116.         return 1;
  117.     }
  118. //----------------------------------------------Ajouter Biz-----------------------------------------------------
  119.     if(strcmp(cmd, "/ajouterbiz", true) == 0)
  120.         {
  121.             TogglePlayerControllable(playerid, 0);
  122.             ShowMenuForPlayer(Menu:Biz, playerid);
  123.             return 1;
  124.         }
  125.     return 0;
  126. }
  127.  
  128. public OnPlayerSelectedMenuRow(playerid, row)
  129. {
  130.     new Menu:CurrentMenu = GetPlayerMenu(playerid);
  131.     new entry[252];
  132.     if(CurrentMenu == Menu:Biz)
  133.     {
  134.         switch(row)
  135.         {
  136.             case 0:
  137.                 {
  138.                 new Float:X, Float:Y, Float:Z;
  139.                 new File:hFile;
  140.                 GetPlayerPos(playerid, X, Y, Z);
  141.                 AddStaticPickup(1272, 2, X, Y, Z);
  142.                 format(entry, 250, "0|The State|~w~Gun Shop 1|Personne|%.2f|%.2f|%.2f|459.679107|-88.644302|999.554687|5|50000|0|0|1|4|500|500|1", X, Y, Z);
  143.                 hFile = fopen("bizz.cfg", io_append);
  144.                 fwrite(hFile, entry);
  145.                 fclose(hFile);
  146.                 HideMenuForPlayer(Menu:Biz, playerid);
  147.                 TogglePlayerControllable(playerid, 1);
  148.                 }
  149.             case 1:
  150.                 {
  151.                 new Float:X, Float:Y, Float:Z;
  152.                 new File:hFile;
  153.                 GetPlayerPos(playerid, X, Y, Z);
  154.                 AddStaticPickup(1272, 2, X, Y, Z);
  155.                 format(entry, 250, "0|The State|~w~Gun Shop 2|Personne|%.2f|%.2f|%.2f|2170.278076|1618.818237|999.976623|5|50000|5|163910|0|1|493|500|10", X, Y, Z);
  156.                 hFile = fopen("bizz.cfg", io_append);
  157.                 fwrite(hFile, entry);
  158.                 fclose(hFile);
  159.                 HideMenuForPlayer(Menu:Biz, playerid);
  160.                 TogglePlayerControllable(playerid, 1);
  161.                  }
  162.             case 2:
  163.                 {
  164.                 new Float:X, Float:Y, Float:Z;
  165.                 new File:hFile;
  166.                 GetPlayerPos(playerid, X, Y, Z);
  167.                 AddStaticPickup(1272, 2, X, Y, Z);
  168.                 format(entry, 250, "0|The State|~w~Restaurant|Personne|%.2f|%.2f|%.2f|-794.936218|490.632385|1376.195312|5|50000|0|67500|1|1|500|500|100", X, Y, Z);
  169.                 hFile = fopen("bizz.cfg", io_append);
  170.                 fwrite(hFile, entry);
  171.                 fclose(hFile);
  172.                 HideMenuForPlayer(Menu:Biz, playerid);
  173.                 TogglePlayerControllable(playerid, 1);
  174.                 }
  175.             case 3:
  176.                 {
  177.                 new Float:X, Float:Y, Float:Z;
  178.                 new File:hFile;
  179.                 GetPlayerPos(playerid, X, Y, Z);
  180.                 AddStaticPickup(1272, 2, X, Y, Z);
  181.                 format(entry, 250, "0|The State|~w~Police Armurie|Personne|%.2f|%.2f|%.2f|246.376007|109.246002|1003.218811|5|50000|0|8143120|0|10|457|500|100", X, Y, Z);
  182.                 hFile = fopen("bizz.cfg", io_append);
  183.                 fwrite(hFile, entry);
  184.                 fclose(hFile);
  185.                 HideMenuForPlayer(Menu:Biz, playerid);
  186.                 TogglePlayerControllable(playerid, 1);
  187.                 }
  188.             case 4:
  189.                 {
  190.                 new Float:X, Float:Y, Float:Z;
  191.                 new File:hFile;
  192.                 GetPlayerPos(playerid, X, Y, Z);
  193.                 AddStaticPickup(1272, 2, X, Y, Z);
  194.                 format(entry, 250, "0|The State|~w~City Bank|Personne|%.2f|%.2f|%.2f|2305.688964|-16.088100|26.749599|5|5000000|0|10000|0|0|99983|100000|100", X, Y, Z);
  195.                 hFile = fopen("bizz.cfg", io_append);
  196.                 fwrite(hFile, entry);
  197.                 fclose(hFile);
  198.                 HideMenuForPlayer(Menu:Biz, playerid);
  199.                 TogglePlayerControllable(playerid, 1);
  200.                 }
  201.             case 5:
  202.                 {
  203.                 new Float:X, Float:Y, Float:Z;
  204.                 new File:hFile;
  205.                 GetPlayerPos(playerid, X, Y, Z);
  206.                 AddStaticPickup(1272, 2, X, Y, Z);
  207.                 format(entry, 250, "0|The State|~w~Bar|Personne|%.2f|%.2f|%.2f|-227.027999|1401.229980|27.765600|5|25000|100|99600|1|18|500|500|100", X, Y, Z);
  208.                 hFile = fopen("bizz.cfg", io_append);
  209.                 fwrite(hFile, entry);
  210.                 fclose(hFile);
  211.                 HideMenuForPlayer(Menu:Biz, playerid);
  212.                 TogglePlayerControllable(playerid, 1);
  213.                 }
  214.             case 6:
  215.                 {
  216.                 new Float:X, Float:Y, Float:Z;
  217.                 new File:hFile;
  218.                 GetPlayerPos(playerid, X, Y, Z);
  219.                 AddStaticPickup(1272, 2, X, Y, Z);
  220.                 format(entry, 250, "0|The State|~w~Hotel|Personne|%.2f|%.2f|%.2f|2217.240478|-1150.798461|1025.855957|12|100000|50|100000|1|15|500|500|100", X, Y, Z);
  221.                 hFile = fopen("bizz.cfg", io_append);
  222.                 fwrite(hFile, entry);
  223.                 fclose(hFile);
  224.                 HideMenuForPlayer(Menu:Biz, playerid);
  225.                 TogglePlayerControllable(playerid, 1);
  226.                 }
  227.             case 7:
  228.                 {
  229.                 new Float:X, Float:Y, Float:Z;
  230.                 new File:hFile;
  231.                 GetPlayerPos(playerid, X, Y, Z);
  232.                 AddStaticPickup(1272, 2, X, Y, Z);
  233.                 format(entry, 250, "0|The State|~w~Restaurant Life|Personne|%.2f|%.2f|%.2f|452.462799|-18.247299|1001.132812|8|847000|25|100000|1|1|50|50|100", X, Y, Z);
  234.                 hFile = fopen("bizz.cfg", io_append);
  235.                 fwrite(hFile, entry);
  236.                 fclose(hFile);
  237.                 HideMenuForPlayer(Menu:Biz, playerid);
  238.                 TogglePlayerControllable(playerid, 1);
  239.                 }
  240.             case 8:
  241.                 {
  242.                 new Float:X, Float:Y, Float:Z;
  243.                 new File:hFile;
  244.                 GetPlayerPos(playerid, X, Y, Z);
  245.                 AddStaticPickup(1272, 2, X, Y, Z);
  246.                 format(entry, 250, "0|The State|~w~Casino|Personne|%.2f|%.2f|%.2f|1133.068237|-15.832798|1000.679687|8|2000000|25|100000|1|12|50|50|100", X, Y, Z);
  247.                 hFile = fopen("bizz.cfg", io_append);
  248.                 fwrite(hFile, entry);
  249.                 fclose(hFile);
  250.                 HideMenuForPlayer(Menu:Biz, playerid);
  251.                 TogglePlayerControllable(playerid, 1);
  252.                 }
  253.             case 9:
  254.                 {
  255.                 new Float:X, Float:Y, Float:Z;
  256.                 new File:hFile;
  257.                 GetPlayerPos(playerid, X, Y, Z);
  258.                 AddStaticPickup(1272, 2, X, Y, Z);
  259.                 format(entry, 250, "0|The State|~w~Magasin de vêtements 1|Personne|%.2f|%.2f|%.2f|227.2902|-8.1511|1002.2109|4|25000|25|100000|1|5|50|50|100", X, Y, Z);
  260.                 hFile = fopen("bizz.cfg", io_append);
  261.                 fwrite(hFile, entry);
  262.                 fclose(hFile);
  263.                 HideMenuForPlayer(Menu:Biz, playerid);
  264.                 TogglePlayerControllable(playerid, 1);
  265.                 }
  266.             case 10:
  267.                 {
  268.                 new Float:X, Float:Y, Float:Z;
  269.                 new File:hFile;
  270.                 GetPlayerPos(playerid, X, Y, Z);
  271.                 AddStaticPickup(1272, 2, X, Y, Z);
  272.                 format(entry, 250, "0|The State|~w~Magasin de vêtements 2|Personne|%.2f|%.2f|%.2f|203.7756|-50.6623|1001.8047|4|25000|25|100000|1|1|50|50|100", X, Y, Z);
  273.                 hFile = fopen("bizz.cfg", io_append);
  274.                 fwrite(hFile, entry);
  275.                 fclose(hFile);
  276.                 HideMenuForPlayer(Menu:Biz, playerid);
  277.                 TogglePlayerControllable(playerid, 1);
  278.                 }
  279.             case 11:
  280.                 {
  281.                 new Float:X, Float:Y, Float:Z;
  282.                 new File:hFile;
  283.                 GetPlayerPos(playerid, X, Y, Z);
  284.                 AddStaticPickup(1272, 2, X, Y, Z);
  285.                 format(entry, 250, "0|The State|~w~Magasin de vêtements 3|Personne|%.2f|%.2f|%.2f|161.4524|-96.9166|1001.8047|4|25000|25|100000|1|18|50|50|100", X, Y, Z);
  286.                 hFile = fopen("bizz.cfg", io_append);
  287.                 fwrite(hFile, entry);
  288.                 fclose(hFile);
  289.                 HideMenuForPlayer(Menu:Biz, playerid);
  290.                 TogglePlayerControllable(playerid, 1);
  291.                 }
  292.             case 12:
  293.                 {
  294.                 new Float:X, Float:Y, Float:Z;
  295.                 new File:hFile;
  296.                 GetPlayerPos(playerid, X, Y, Z);
  297.                 AddStaticPickup(1272, 2, X, Y, Z);
  298.                 format(entry, 250, "0|The State|~w~Magasin de vêtements 4|Personne|%.2f|%.2f|%.2f|204.4921|-168.8605|1000.5234|4|25000|25|100000|1|14|50|50|100", X, Y, Z);
  299.                 hFile = fopen("bizz.cfg", io_append);
  300.                 fwrite(hFile, entry);
  301.                 fclose(hFile);
  302.                 HideMenuForPlayer(Menu:Biz, playerid);
  303.                 TogglePlayerControllable(playerid, 1);
  304.                 }
  305.         }
  306.     }
  307.     return 1;
  308. }
  309.  
  310. public OnPlayerExitedMenu(playerid)
  311. {
  312.     return 1;
  313. }
Advertisement
Add Comment
Please, Sign In to add comment