Advertisement
Gireada

Hold System

Mar 18th, 2013
689
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 10.41 KB | None | 0 0
  1. /****************************************************************************************************************************************************************************
  2. *****************************************************************************************************************************************************************************
  3. *****************************************************************************************************************************************************************************
  4. ***********************************************************************__________________************************************************************************************
  5. **********************************************************************|    Hold System   |***********************************************************************************
  6. **********************************************************************|                  |***********************************************************************************
  7. **********************************************************************|      By          |***********************************************************************************
  8. **********************************************************************|        Gireada   |***********************************************************************************
  9. **********************************************************************|                  |***********************************************************************************
  10. **********************************************************************|                  |***********************************************************************************
  11. **********************************************************************|                  |***********************************************************************************
  12. **********************************************************************|                  |***********************************************************************************
  13. **********************************************************************|                  |***********************************************************************************
  14. **********************************************************************---------------------************************************************************************************
  15. */
  16.  
  17. //Nu stergeti Creditele.
  18.  
  19.  
  20.  
  21. #include <a_samp>
  22. #include <zcmd>
  23.  
  24. #define Dialog_Hold 55
  25. #define Dialog_Hold2 56
  26. #define Dialog_Hold3 57
  27. #define Dialog_Hold4 58
  28. #define Dialog_Hold5 59
  29. #define Dialog_Hold6 60
  30.  
  31. new ObiectAles[MAX_PLAYERS];
  32. new Slot[MAX_PLAYERS];
  33. new Corp[MAX_PLAYERS];
  34. public OnFilterScriptInit()
  35. {
  36.     print("\n--------------------------------------");
  37.     print(" Hold Sistem by Gireada");
  38.     print("--------------------------------------\n");
  39.     return 1;
  40. }
  41.  
  42. public OnFilterScriptExit()
  43. {
  44.     return 1;
  45. }
  46.  
  47.  
  48. main()
  49. {
  50.     print("\n----------------------------------");
  51.     print(" Hold Sistem by Gireada");
  52.     print("----------------------------------\n");
  53. }
  54.  
  55.  
  56. CMD:hold(playerid, params[])
  57. {
  58.     ShowPlayerDialog(playerid, Dialog_Hold, DIALOG_STYLE_LIST, "{00FB29}Hold", "Creeaza Hold\nEdit Hold", "Accept", "Anulesz");
  59.     return 1;
  60. }
  61.  
  62. public OnPlayerConnect(playerid)
  63. {
  64.     return 1;
  65. }
  66.  
  67. public OnPlayerDisconnect(playerid, reason)
  68. {
  69.     return 1;
  70. }
  71.  
  72. public OnPlayerSpawn(playerid)
  73. {
  74.     return 1;
  75. }
  76.  
  77. public OnPlayerDeath(playerid, killerid, reason)
  78. {
  79.     return 1;
  80. }
  81.  
  82. public OnVehicleSpawn(vehicleid)
  83. {
  84.     return 1;
  85. }
  86.  
  87. public OnVehicleDeath(vehicleid, killerid)
  88. {
  89.     return 1;
  90. }
  91.  
  92. public OnPlayerText(playerid, text[])
  93. {
  94.     return 1;
  95. }
  96.  
  97. public OnPlayerCommandText(playerid, cmdtext[])
  98. {
  99.     if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  100.     {
  101.         // Do something here
  102.         return 1;
  103.     }
  104.     return 0;
  105. }
  106.  
  107. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  108. {
  109.     return 1;
  110. }
  111.  
  112. public OnPlayerExitVehicle(playerid, vehicleid)
  113. {
  114.     return 1;
  115. }
  116.  
  117. public OnPlayerStateChange(playerid, newstate, oldstate)
  118. {
  119.     return 1;
  120. }
  121.  
  122. public OnPlayerEnterCheckpoint(playerid)
  123. {
  124.     return 1;
  125. }
  126.  
  127. public OnPlayerLeaveCheckpoint(playerid)
  128. {
  129.     return 1;
  130. }
  131.  
  132. public OnPlayerEnterRaceCheckpoint(playerid)
  133. {
  134.     return 1;
  135. }
  136.  
  137. public OnPlayerLeaveRaceCheckpoint(playerid)
  138. {
  139.     return 1;
  140. }
  141.  
  142. public OnRconCommand(cmd[])
  143. {
  144.     return 1;
  145. }
  146.  
  147. public OnPlayerRequestSpawn(playerid)
  148. {
  149.     return 1;
  150. }
  151.  
  152. public OnObjectMoved(objectid)
  153. {
  154.     return 1;
  155. }
  156.  
  157. public OnPlayerObjectMoved(playerid, objectid)
  158. {
  159.     return 1;
  160. }
  161.  
  162. public OnPlayerPickUpPickup(playerid, pickupid)
  163. {
  164.     return 1;
  165. }
  166.  
  167. public OnVehicleMod(playerid, vehicleid, componentid)
  168. {
  169.     return 1;
  170. }
  171.  
  172. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  173. {
  174.     return 1;
  175. }
  176.  
  177. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  178. {
  179.     return 1;
  180. }
  181.  
  182. public OnPlayerSelectedMenuRow(playerid, row)
  183. {
  184.     return 1;
  185. }
  186.  
  187. public OnPlayerExitedMenu(playerid)
  188. {
  189.     return 1;
  190. }
  191.  
  192. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  193. {
  194.     return 1;
  195. }
  196.  
  197. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  198. {
  199.     return 1;
  200. }
  201.  
  202. public OnRconLoginAttempt(ip[], password[], success)
  203. {
  204.     return 1;
  205. }
  206.  
  207. public OnPlayerUpdate(playerid)
  208. {
  209.     return 1;
  210. }
  211.  
  212. public OnPlayerStreamIn(playerid, forplayerid)
  213. {
  214.     return 1;
  215. }
  216.  
  217. public OnPlayerStreamOut(playerid, forplayerid)
  218. {
  219.     return 1;
  220. }
  221.  
  222. public OnVehicleStreamIn(vehicleid, forplayerid)
  223. {
  224.     return 1;
  225. }
  226.  
  227. public OnVehicleStreamOut(vehicleid, forplayerid)
  228. {
  229.     return 1;
  230. }
  231.  
  232. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  233. {
  234.     new string[256], string2[1024];
  235.     if(response)
  236.     {
  237.         switch(dialogid)
  238.         {
  239.             case Dialog_Hold:
  240.             {
  241.                 switch(listitem)
  242.                 {
  243.                     case 0:
  244.                     {
  245.                         ShowPlayerDialog(playerid, Dialog_Hold2, DIALOG_STYLE_LIST, "{00FB29}Hold", "{FFFFFF}Introdu ID", "Accept", "Anulez");
  246.                     }
  247.                     case 1:
  248.                     {
  249.                         for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
  250.                         {
  251.                             if(IsPlayerAttachedObjectSlotUsed(playerid, i))
  252.                             {
  253.                                 format(string, sizeof(string), "{FFFFFF}Slot: {009AFB}%d {FFFFFF}| {FB0000}Folosit\n",i);
  254.                                 strcat(string2, string);
  255.                             }
  256.                             else if(!(IsPlayerAttachedObjectSlotUsed(playerid, i)))
  257.                             {
  258.                                 format(string, sizeof(string), "{FFFFFF}Slot: {009AFB}%d {FFFFFF}| {00FB29}Gol\n",i);
  259.                                 strcat(string2, string);
  260.                             }
  261.                         }
  262.                         ShowPlayerDialog(playerid, Dialog_Hold3, DIALOG_STYLE_LIST, "{00FB29}Hold", string2, "Accept", "Anulesz");
  263.                     }
  264.                 }
  265.              }
  266.              case Dialog_Hold2:
  267.              {
  268.                 switch(listitem)
  269.                 {
  270.                     case 0:
  271.                     {
  272.                         ShowPlayerDialog(playerid,Dialog_Hold4, DIALOG_STYLE_INPUT, "{00FB29}Hold", "{FFFFFF}Introdu ID-ul obiectului", "Accept", "Anulez");
  273.                     }
  274.                 }
  275.             }
  276.             case Dialog_Hold3:
  277.             {
  278.                 if(!(IsPlayerAttachedObjectSlotUsed(playerid, listitem)))
  279.                 {
  280.                     for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
  281.                     {
  282.                         if(IsPlayerAttachedObjectSlotUsed(playerid, i))
  283.                         {
  284.                             format(string, sizeof(string), "{FFFFFF}Slot: {009AFB}%d {FFFFFF}| {FB0000}Folosit\n",i);
  285.                             strcat(string2, string);
  286.                         }
  287.                         else if(!(IsPlayerAttachedObjectSlotUsed(playerid, i)))
  288.                         {
  289.                             format(string, sizeof(string), "{FFFFFF}Slot: {009AFB}%d {FFFFFF}| {00FB29}Gol\n",i);
  290.                             strcat(string2, string);
  291.                         }
  292.                     }
  293.                     ShowPlayerDialog(playerid, Dialog_Hold3, DIALOG_STYLE_LIST, "{00FB29}Hold", string2, "Accept", "Anulesz");
  294.                 }
  295.                 else if(IsPlayerAttachedObjectSlotUsed(playerid, listitem))
  296.                 {
  297.                     EditAttachedObject(playerid, listitem);
  298.                 }
  299.             }
  300.             case Dialog_Hold4:
  301.             {
  302.                 if(!(strval(inputtext) > 999 || strval(inputtext) < 19522))
  303.                 {
  304.                     ShowPlayerDialog(playerid,Dialog_Hold4, DIALOG_STYLE_INPUT, "{00FB29}Hold", "{FFFFFF}Introdu ID-ul obiectului", "Accept", "Anulez");
  305.                     SendClientMessage(playerid, 0xFFFFFFFF, "Introdu un numar intre 1000 si 19521");
  306.                 }
  307.                 ObiectAles[playerid] = strval(inputtext);
  308.                 for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
  309.                 {
  310.                     if(IsPlayerAttachedObjectSlotUsed(playerid, i))
  311.                     {
  312.                         format(string, sizeof(string), "{FFFFFF}Slot: {009AFB}%d {FFFFFF}| {FB0000}Folosit\n",i);
  313.                         strcat(string2, string);
  314.                     }
  315.                     else if(!(IsPlayerAttachedObjectSlotUsed(playerid, i)))
  316.                     {
  317.                         format(string, sizeof(string), "{FFFFFF}Slot: {009AFB}%d {FFFFFF}| {00FB29}Gol\n",i);
  318.                         strcat(string2, string);
  319.                     }
  320.                 }
  321.                 ShowPlayerDialog(playerid, Dialog_Hold5, DIALOG_STYLE_LIST, "{00FB29}Alege un Slot", string2, "Accept", "Anulesz");
  322.             }
  323.             case Dialog_Hold5:
  324.             {
  325.                 Slot[playerid] = listitem;
  326.                 strcat(string2, "{FC0202}Spate\n{FC6202}Cap\n{FCC302}Umarul Stang\n{F7FF09}Umarul Drept\n{D6FF09}Mana Stanga\n{A0FF09}Mana Dreapta\n{5FFF09}Coapsa Stanga\n{0BFF8D}Coapsa Dreapta\n{0BFFFB}Picorulu Stang\n");
  327.                 strcat(string2, "{0BC7FF}Piciorul Drept\n{0B8DFF}Gamba Stanga\n{0B45FF}Gamba Dreapta\n{9E52FB}Brat Stang\n{EE74FF}Brat Drept\n{FF00FB}Shouldul Stang\n{FF00C8}Shouldul Drept\n{FF0084}Gat\n{FF0000}Obraz");
  328.                 ShowPlayerDialog(playerid, Dialog_Hold6, DIALOG_STYLE_LIST, "{00FB29}Alege o parte", string2, "Accept", "Anulesz");
  329.             }
  330.             case Dialog_Hold6:
  331.             {
  332.                 Corp[playerid] = listitem+1;
  333.                 SetPlayerAttachedObject(playerid, Slot[playerid], ObiectAles[playerid], Corp[playerid]);
  334.                 EditAttachedObject(playerid, Slot[playerid]);
  335.             }
  336.         }
  337.     }
  338.     return 1;
  339. }
  340.  
  341. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  342. {
  343.     return 1;
  344. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement