Advertisement
friezakinght

Furniture System

Aug 1st, 2014
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 18.38 KB | None | 0 0
  1. //Link: http://forum.sa-mp.com/showthread.php?t=346371
  2. #define FILTERSCRIPT
  3.  
  4. #include <a_samp> // Credits to the SA:MP Developement Team
  5. #include <sscanf2> // Credits to Y_Less
  6. #include <YSI\y_ini> // Credits to Y_Less
  7. #include <ZCMD> // Credits to Zeex
  8. #include <streamer> // Credits to Incognito
  9. #include <foreach> // Credits to Y_Less
  10.  
  11. //furniture shit
  12. new Object;
  13. new oModel;
  14. #define OBJECT_FILE_NAME        "DObjects.txt"
  15. #define COLOR_YELLOW    0xD8D8D8FF
  16. #define COLOR_FADE1     0xE6E6E6E6
  17. #define COLOR_FADE2     0xC8C8C8C8
  18. #define COLOR_FADE3     0xAAAAAAAA
  19. #define COLOR_FADE4     0x8C8C8C8C
  20. #define COLOR_FADE5     0x6E6E6E6E
  21. #define COLOR_FADE      0xC8C8C8C8
  22. #define COLOR_WHITE     0xFFFFFFAA
  23. #define COLOR_GRAD2     0xBFC0C2FF
  24. #define COLOR_DARKRED   0x8B0000AA
  25. #define COLOR_RED       0xFF0000AA
  26. #define COLOR_LIGHTBLUE 0x33CCFFAA
  27. #define COLOR_GREY      0xAFAFAFAA
  28. #define COLOR_PINK      0xDC00DDAA
  29. #define COLOR_BLUE      0x0259EAAA
  30. #define COLOR_GREEN     0x00A800AA
  31. #define COLOR_ORANGE    0xFF8000AA
  32. #define COLOR_CYAN      0xFF8080AA
  33. #define COLOR_WHITE     0xFFFFFFAA
  34. #define COLOR_DARKBLUE  0x0000A0AA
  35. #define COLOR_BLACK     0x000000AA
  36. #define COLOR_DARKGOLD  0x808000AA
  37. #define COLOR_PURPLE    0xC2A2DAAA
  38. #define COLOR_BROWN     0x804000AA
  39. #define COLOR_BLACK2    0x000000ff
  40. #define COLOR_GRAD2 0xBFC0C2FF
  41.  
  42. public OnFilterScriptInit()
  43. {
  44.     print("\n--------------------------------------");
  45.     print(" Blank Filterscript by your name here");
  46.     print("--------------------------------------\n");
  47.     new Line[60], Veh;
  48.     AddObjectFromFile(OBJECT_FILE_NAME);
  49.     format(Line, sizeof(Line), "** %i\t<->\tObjects Loaded From\t<->\tDObjects.txt **", Veh);
  50.     printf(Line);
  51.     return 1;
  52. }
  53.  
  54. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  55. {
  56.     switch(dialogid)
  57.     {
  58.         case 509:
  59.         {
  60.             if(!response)
  61.             {
  62.                 SendClientMessage(playerid, 0x42F3F198, "You canceled the dialog.");
  63.                 return 1;
  64.             }
  65.             switch(listitem)
  66.             {
  67.                 case 0:
  68.                 {
  69.                     ShowPlayerDialog(playerid, 510, DIALOG_STYLE_LIST, "Furniture Chairs", "Chair1\nChair2\nChair3\nChair4", "Ok", "Cancel");
  70.                 }
  71.                 case 1:
  72.                 {
  73.                     ShowPlayerDialog(playerid, 511, DIALOG_STYLE_LIST, "Furniture Beds", "Bed1\nBed2\nBed3\nBed4", "Ok", "Cancel");
  74.                 }
  75.                 case 2:
  76.                 {
  77.                     ShowPlayerDialog(playerid, 512, DIALOG_STYLE_LIST, "Furniture Tables", "Table1\nTable2\nTable3", "Ok", "Cancel");
  78.                 }
  79.                 case 3:
  80.                 {
  81.                     ShowPlayerDialog(playerid, 513, DIALOG_STYLE_LIST, "Furniture T.V", "TV1\n TV2\n TV3", "Ok", "Cancel");
  82.                 }
  83.                 case 4:
  84.                 {
  85.                     ShowPlayerDialog(playerid, 514, DIALOG_STYLE_LIST, "Furniture Cabinet", "Cabinet 1", "Ok", "Cancel");
  86.                 }
  87.                 case 5:
  88.                 {
  89.                     ShowPlayerDialog(playerid, 515, DIALOG_STYLE_LIST, "Furniture Misc", "Basket Ball net\nClothes\nEaster Egg", "Ok", "Cancel");
  90.                 }
  91. //You can continue cases here but make sure you make a new line in the ShowPlayerDialog on /mp3 command \r\n4. 4th \r\n5. 5th channel etc..
  92.             }
  93.         }
  94.     }
  95.     switch(dialogid)
  96.     {
  97.         case 510:
  98.         {
  99.             if(!response)
  100.             {
  101.                 SendClientMessage(playerid, 0x42F3F198, "You canceled the dialog.");
  102.                 return 1;
  103.             }
  104.             switch(listitem)
  105.             {
  106.                 case 0:
  107.                 {
  108.                     new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ;
  109.                     GetPlayerPos(playerid, OX, OY, OZ);
  110.                     oModel = 1723;
  111.                     ORX = 0.0;
  112.                     ORY = 0.0;
  113.                     ORZ = 0.0;
  114.                     Object = CreateObject(1723, OX+2, OY, OZ, ORX, ORY, ORZ); //Object will render at its default distance.
  115.                     SendClientMessage(playerid, 0xD8D8D8FF, "Object spawned now move it");
  116.                     EditObject(playerid, Object);
  117.                 }
  118.                 case 1:
  119.                 {
  120.                     new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ;
  121.                     GetPlayerPos(playerid, OX, OY, OZ);
  122.                     oModel = 1704;
  123.                     ORX = 0.0;
  124.                     ORY = 0.0;
  125.                     ORZ = 0.0;
  126.                     Object = CreateObject(1704, OX+2, OY, OZ, ORX, ORY, ORZ); //Object will render at its default distance.
  127.                     SendClientMessage(playerid, 0xD8D8D8FF, "Object spawned now move it");
  128.                     EditObject(playerid, Object);
  129.                 }
  130.                 case 2:
  131.                 {
  132.                     new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ;
  133.                     GetPlayerPos(playerid, OX, OY, OZ);
  134.                     oModel = 11665;
  135.                     ORX = 0.0;
  136.                     ORY = 0.0;
  137.                     ORZ = 0.0;
  138.                     Object = CreateObject(11665, OX+2, OY, OZ, ORX, ORY, ORZ); //Object will render at its default distance.
  139.                     SendClientMessage(playerid, 0xD8D8D8FF, "Object spawned now move it");
  140.                     EditObject(playerid, Object);
  141.                 }
  142.                 case 3:
  143.                 {
  144.                     new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ;
  145.                     GetPlayerPos(playerid, OX, OY, OZ);
  146.                     oModel = 1705;
  147.                     ORX = 0.0;
  148.                     ORY = 0.0;
  149.                     ORZ = 0.0;
  150.                     Object = CreateObject(1705, OX+2, OY, OZ, ORX, ORY, ORZ); //Object will render at its default distance.
  151.                     SendClientMessage(playerid, 0xD8D8D8FF, "Object spawned now move it");
  152.                     EditObject(playerid, Object);
  153.                 }
  154. //You can continue cases here but make sure you make a new line in the ShowPlayerDialog on /mp3 command \r\n4. 4th \r\n5. 5th channel etc..
  155.             }
  156.         }
  157.     }
  158.     switch(dialogid)
  159.     {
  160.         case 511:
  161.         {
  162.             if(!response)
  163.             {
  164.                 SendClientMessage(playerid, 0x42F3F198, "You canceled the dialog.");
  165.                 return 1;
  166.             }
  167.             switch(listitem)
  168.             {
  169.                 case 0:
  170.                 {
  171.                     new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ;
  172.                     GetPlayerPos(playerid, OX, OY, OZ);
  173.                     oModel = 1745;
  174.                     ORX = 0.0;
  175.                     ORY = 0.0;
  176.                     ORZ = 0.0;
  177.                     Object = CreateObject(1745, OX+2, OY, OZ, ORX, ORY, ORZ); //Object will render at its default distance.
  178.                     SendClientMessage(playerid, 0xD8D8D8FF, "Object spawned now move it");
  179.                     EditObject(playerid, Object);
  180.                 }
  181.                 case 1:
  182.                 {
  183.                     new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ;
  184.                     GetPlayerPos(playerid, OX, OY, OZ);
  185.                     oModel = 1794;
  186.                     ORX = 0.0;
  187.                     ORY = 0.0;
  188.                     ORZ = 0.0;
  189.                     Object = CreateObject(1794, OX+2, OY, OZ, ORX, ORY, ORZ); //Object will render at its default distance.
  190.                     SendClientMessage(playerid, 0xD8D8D8FF, "Object spawned now move it");
  191.                     EditObject(playerid, Object);
  192.                 }
  193.                 case 2:
  194.                 {
  195.                     new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ;
  196.                     GetPlayerPos(playerid, OX, OY, OZ);
  197.                     oModel = 1797;
  198.                     ORX = 0.0;
  199.                     ORY = 0.0;
  200.                     ORZ = 0.0;
  201.                     Object = CreateObject(1797, OX+2, OY, OZ, ORX, ORY, ORZ); //Object will render at its default distance.
  202.                     SendClientMessage(playerid, 0xD8D8D8FF, "Object spawned now move it");
  203.                     EditObject(playerid, Object);
  204.                 }
  205.                 case 3:
  206.                 {
  207.                     new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ;
  208.                     GetPlayerPos(playerid, OX, OY, OZ);
  209.                     oModel = 2566;
  210.                     ORX = 0.0;
  211.                     ORY = 0.0;
  212.                     ORZ = 0.0;
  213.                     Object = CreateObject(2566, OX+2, OY, OZ, ORX, ORY, ORZ); //Object will render at its default distance.
  214.                     SendClientMessage(playerid, 0xD8D8D8FF, "Object spawned now move it");
  215.                     EditObject(playerid, Object);
  216.                 }
  217. //You can continue cases here but make sure you make a new line in the ShowPlayerDialog on /mp3 command \r\n4. 4th \r\n5. 5th channel etc..
  218.             }
  219.         }
  220.     }
  221.     switch(dialogid)
  222.     {
  223.         case 512:
  224.         {
  225.             if(!response)
  226.             {
  227.                 SendClientMessage(playerid, 0x42F3F198, "You canceled the dialog.");
  228.                 return 1;
  229.             }
  230.             switch(listitem)
  231.             {
  232.                 case 0:
  233.                 {
  234.                     new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ;
  235.                     GetPlayerPos(playerid, OX, OY, OZ);
  236.                     oModel = 1281;
  237.                     ORX = 0.0;
  238.                     ORY = 0.0;
  239.                     ORZ = 0.0;
  240.                     Object = CreateObject(1281, OX+2, OY, OZ, ORX, ORY, ORZ); //Object will render at its default distance.
  241.                     SendClientMessage(playerid, 0xD8D8D8FF, "Object spawned now move it");
  242.                     EditObject(playerid, Object);
  243.                 }
  244.                 case 1:
  245.                 {
  246.                     new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ;
  247.                     GetPlayerPos(playerid, OX, OY, OZ);
  248.                     oModel = 2311;
  249.                     ORX = 0.0;
  250.                     ORY = 0.0;
  251.                     ORZ = 0.0;
  252.                     Object = CreateObject(2311, OX+2, OY, OZ, ORX, ORY, ORZ); //Object will render at its default distance.
  253.                     SendClientMessage(playerid, 0xD8D8D8FF, "Object spawned now move it");
  254.                     EditObject(playerid, Object);
  255.                 }
  256.                 case 2:
  257.                 {
  258.                     new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ;
  259.                     GetPlayerPos(playerid, OX, OY, OZ);
  260.                     oModel = 1825;
  261.                     ORX = 0.0;
  262.                     ORY = 0.0;
  263.                     ORZ = 0.0;
  264.                     Object = CreateObject(1825, OX+2, OY, OZ, ORX, ORY, ORZ); //Object will render at its default distance.
  265.                     SendClientMessage(playerid, 0xD8D8D8FF, "Object spawned now move it");
  266.                     EditObject(playerid, Object);
  267.                 }
  268. //You can continue cases here but make sure you make a new line in the ShowPlayerDialog on /mp3 command \r\n4. 4th \r\n5. 5th channel etc..
  269.             }
  270.         }
  271.     }
  272.     switch(dialogid)
  273.     {
  274.         case 513:
  275.         {
  276.             if(!response)
  277.             {
  278.                 SendClientMessage(playerid, 0x42F3F198, "You canceled the dialog.");
  279.                 return 1;
  280.             }
  281.             switch(listitem)
  282.             {
  283.                 case 0:
  284.                 {
  285.                     new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ;
  286.                     GetPlayerPos(playerid, OX, OY, OZ);
  287.                     oModel = 2297;
  288.                     ORX = 0.0;
  289.                     ORY = 0.0;
  290.                     ORZ = 0.0;
  291.                     Object = CreateObject(2297, OX+2, OY, OZ, ORX, ORY, ORZ); //Object will render at its default distance.
  292.                     SendClientMessage(playerid, 0xD8D8D8FF, "Object spawned now move it");
  293.                     EditObject(playerid, Object);
  294.                 }
  295.                 case 1:
  296.                 {
  297.                     new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ;
  298.                     GetPlayerPos(playerid, OX, OY, OZ);
  299.                     oModel = 2296;
  300.                     ORX = 0.0;
  301.                     ORY = 0.0;
  302.                     ORZ = 0.0;
  303.                     Object = CreateObject(2296, OX+2, OY, OZ, ORX, ORY, ORZ); //Object will render at its default distance.
  304.                     SendClientMessage(playerid, 0xD8D8D8FF, "Object spawned now move it");
  305.                     EditObject(playerid, Object);
  306.                 }
  307.                 case 2:
  308.                 {
  309.                     new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ;
  310.                     GetPlayerPos(playerid, OX, OY, OZ);
  311.                     oModel = 2595;
  312.                     ORX = 0.0;
  313.                     ORY = 0.0;
  314.                     ORZ = 0.0;
  315.                     Object = CreateObject(2595, OX+2, OY, OZ, ORX, ORY, ORZ); //Object will render at its default distance.
  316.                     SendClientMessage(playerid, 0xD8D8D8FF, "Object spawned now move it");
  317.                     EditObject(playerid, Object);
  318.                 }
  319. //You can continue cases here but make sure you make a new line in the ShowPlayerDialog on /mp3 command \r\n4. 4th \r\n5. 5th channel etc..
  320.             }
  321.         }
  322.     }
  323.     switch(dialogid)
  324.     {
  325.         case 514:
  326.         {
  327.             if(!response)
  328.             {
  329.                 SendClientMessage(playerid, 0x42F3F198, "You canceled the dialog.");
  330.                 return 1;
  331.             }
  332.             switch(listitem)
  333.             {
  334.                 case 0:
  335.                 {
  336.                     new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ;
  337.                     GetPlayerPos(playerid, OX, OY, OZ);
  338.                     oModel = 2078;
  339.                     ORX = 0.0;
  340.                     ORY = 0.0;
  341.                     ORZ = 0.0;
  342.                     Object = CreateObject(2078, OX+2, OY, OZ, ORX, ORY, ORZ); //Object will render at its default distance.
  343.                     SendClientMessage(playerid, 0xD8D8D8FF, "Object spawned now move it");
  344.                     EditObject(playerid, Object);
  345.                 }
  346. //You can continue cases here but make sure you make a new line in the ShowPlayerDialog on /mp3 command \r\n4. 4th \r\n5. 5th channel etc..
  347.             }
  348.         }
  349.     }
  350.     switch(dialogid)
  351.     {
  352.         case 515:
  353.         {
  354.             if(!response)
  355.             {
  356.                 SendClientMessage(playerid, 0x42F3F198, "You canceled the dialog.");
  357.                 return 1;
  358.             }
  359.             switch(listitem)
  360.             {
  361.                 case 0:
  362.                 {
  363.                     new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ;
  364.                     GetPlayerPos(playerid, OX, OY, OZ);
  365.                     oModel = 3496;
  366.                     ORX = 0.0;
  367.                     ORY = 0.0;
  368.                     ORZ = 0.0;
  369.                     Object = CreateObject(3496, OX+2, OY, OZ, ORX, ORY, ORZ); //Object will render at its default distance.
  370.                     SendClientMessage(playerid, 0xD8D8D8FF, "Object spawned now move it");
  371.                     EditObject(playerid, Object);
  372.                 }
  373.                 case 1:
  374.                 {
  375.                     new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ;
  376.                     GetPlayerPos(playerid, OX, OY, OZ);
  377.                     oModel = 2844;
  378.                     ORX = 0.0;
  379.                     ORY = 0.0;
  380.                     ORZ = 0.0;
  381.                     Object = CreateObject(2844, OX+2, OY, OZ, ORX, ORY, ORZ); //Object will render at its default distance.
  382.                     SendClientMessage(playerid, 0xD8D8D8FF, "Object spawned now move it");
  383.                     EditObject(playerid, Object);
  384.                 }
  385.                 case 2:
  386.                 {
  387.                     new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ;
  388.                     GetPlayerPos(playerid, OX, OY, OZ);
  389.                     oModel = 19343;
  390.                     ORX = 0.0;
  391.                     ORY = 0.0;
  392.                     ORZ = 0.0;
  393.                     Object = CreateObject(19343, OX+2, OY, OZ, ORX, ORY, ORZ); //Object will render at its default distance.
  394.                     SendClientMessage(playerid, 0xD8D8D8FF, "Object spawned now move it");
  395.                     EditObject(playerid, Object);
  396.                 }
  397. //You can continue cases here but make sure you make a new line in the ShowPlayerDialog on /mp3 command \r\n4. 4th \r\n5. 5th channel etc..
  398.             }
  399.         }
  400.     }
  401.     return 1;
  402. }
  403.  
  404. stock AddObjectFromFile(DFileName[])
  405. {
  406.     if(!fexist(DFileName)) return 0;
  407.  
  408.     new File:ObjectFile, Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ, OVW, OINT, oTotal, Line[128];
  409.  
  410.     ObjectFile = fopen(DFileName, io_read);
  411.     while(fread(ObjectFile, Line))
  412.     {
  413.         if(Line[0] == '/' || isnull(Line)) continue;
  414.         unformat(Line, "ffffffiii", OX, OY, OZ, ORX, ORY, ORZ, OVW, OINT, oModel);
  415.         CreateDynamicObject(oModel, Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ, OVW, OINT, -1, 200.0);
  416.         oTotal++;
  417.     }
  418.     fclose(ObjectFile);
  419.     return oTotal;
  420. }
  421.  
  422. stock AddObjectToFile(DFileName[], Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ, OVW, OINT)
  423. {
  424.     new File:ObjectFile, Line[128];
  425.  
  426.     format(Line, sizeof(Line), "%f %f %f %f %f %f %i %i %i\r\n", OX, OY, OZ, ORX, ORY, ORZ, OVW, OINT, oModel);
  427.     ObjectFile = fopen(DFileName, io_append);
  428.     fwrite(ObjectFile, Line);
  429.     fclose(ObjectFile);
  430.     return 1;
  431. }
  432.  
  433. public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
  434. {
  435.     new Float:oldX, Float:oldY, Float:oldZ,
  436.         Float:oldRotX, Float:oldRotY, Float:oldRotZ;
  437.     GetObjectPos(objectid, oldX, oldY, oldZ);
  438.     GetObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
  439.     new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ, OVW, OINT;
  440.     if(!playerobject) // If this is a global object, move it for other players
  441.     {
  442.         if(!IsValidObject(objectid)) return;
  443.         MoveObject(objectid, fX, fY, fZ, 10.0, fRotX, fRotY, fRotZ);
  444.     }
  445.  
  446.     if(response == EDIT_RESPONSE_FINAL)
  447.     {
  448.         new string[254];
  449.         OVW = GetPlayerVirtualWorld(playerid);
  450.         OINT = GetPlayerInterior(playerid);
  451.         GetObjectPos(objectid, OX, OY, OZ);
  452.         GetObjectRot(objectid, ORX, ORY, ORZ);
  453.         AddObjectToFile(OBJECT_FILE_NAME, OX, OY, OZ, ORX, ORY, ORZ, OVW, OINT);
  454.         SendClientMessage(playerid, COLOR_BLUE, "Object Saved, Please add more if you wish");
  455.         format(string, sizeof(string), "Object model %i spawned at %f, %f, %f, with rotation %f, %f, %f,", oModel, OX, OY, OZ, ORX, ORY, ORZ);
  456.         SendClientMessage(playerid, 0xD8D8D8FF, string);
  457.         format(string, sizeof(string), "Object world %i interior id %i", OVW, OINT);
  458.         SendClientMessage(playerid, 0xD8D8D8FF, string);
  459.         CreateDynamicObject(oModel, Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ, OVW, OINT, -1, 200.0);
  460.         DestroyObject(Object);
  461.     }
  462.  
  463.     if(response == EDIT_RESPONSE_CANCEL)
  464.     {
  465.         //The player cancelled, so put the object back to it's old position
  466.         if(!playerobject) //Object is not a playerobject
  467.         {
  468.             SetObjectPos(objectid, oldX, oldY, oldZ);
  469.             SetObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
  470.         }
  471.         else
  472.         {
  473.             SetPlayerObjectPos(playerid, objectid, oldX, oldY, oldZ);
  474.             SetPlayerObjectRot(playerid, objectid, oldRotX, oldRotY, oldRotZ);
  475.         }
  476.     }
  477. }
  478.  
  479. CMD:furniture(playerid, params[])
  480. {
  481.     ShowPlayerDialog(playerid, 509, DIALOG_STYLE_LIST, "Furniture", "Chairs\nBeds\nTables\nTvs\nCabinets\nFuns tuff\n", "Ok", "Cancel");
  482.     return 1;
  483. }
  484.  
  485. CMD:fhelp(playerid, params[])
  486. {
  487.     SendClientMessage(playerid, COLOR_ORANGE, "This system was scripted by jueix, Type /furniture to plant furniture in your house");
  488.     SendClientMessage(playerid, COLOR_ORANGE, "If the furniture is not in /furniture that you want please type /fplant then the object id.");
  489.     SendClientMessage(playerid, COLOR_ORANGE, "Thank you for using Jueix's furniture system.");
  490.     return 1;
  491. }
  492.  
  493. COMMAND:fplant(playerid, params[])
  494. {
  495.     new objectid;
  496.     if(!sscanf(params, "i", objectid))
  497.     {
  498.         if(objectid >= 1 && objectid <= 11000)
  499.         {
  500.             new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ;
  501.             GetPlayerPos(playerid, OX, OY, OZ);
  502.             oModel = objectid;
  503.             ORX = 0.0;
  504.             ORY = 0.0;
  505.             ORZ = 0.0;
  506.             Object = CreateObject(oModel, OX, OY, OZ, ORX, ORY, ORZ); //Object will render at its default distance.
  507.             SendClientMessage(playerid, 0xD8D8D8FF, "Object spawned now move it");
  508.             EditObject(playerid, Object);
  509.             return 1;
  510.         }
  511.         else return SendClientMessage(playerid, 0xD8D8D8FF, "Only id's between 1 and 11000 are avaliable.");
  512.     }
  513.     else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /fplant[objectid]");
  514. }
  515.  
  516. public OnFilterScriptExit()
  517. {
  518.     return 1;
  519. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement