Advertisement
Private200

Skin Changer - Private200

May 23rd, 2013
534
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3.  
  4. /* Skin Dialog
  5. by
  6. Private200 */
  7.  
  8. //=======================[Colors]====================
  9.  
  10. #define COLOR_LIGHTBLUE 0x33CCFFAA
  11.  
  12. //=======================[Shortcuts]====================
  13.  
  14. #define SCM SendClientMessage
  15.  
  16. //=======================[Defines]====================
  17.  
  18. new CanChangeSkin[MAX_PLAYERS];
  19.  
  20. public OnFilterScriptInit()
  21. {
  22. print("\n--------------------------------------");
  23. print(" Skin FS by Private200");
  24. print("--------------------------------------\n");
  25. return 1;
  26. }
  27.  
  28. COMMAND:changeskin(playerid, cmdtext[])
  29. {
  30. if(!IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_LIGHTBLUE, "You must be an admin to use this command.");
  31. if(CanChangeSkin[playerid] == 0)
  32. {
  33. ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_INPUT, "{33CCFF}Skins", "{FFFFFF}We allow you to change your skin by\n{FFFFFF}typing below the skin ID you want.\n{FF0000}(AVAILABLE ARE FROM 0-299):", "Request", "Close");
  34. }
  35. else
  36. {
  37. SendClientMessage(playerid, COLOR_LIGHTBLUE, "You've changed your skin already in these last 30 minutes. Please wait some more time.");
  38. return 0;
  39. }
  40. return 1;
  41. }
  42.  
  43. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  44. {
  45. if(dialogid == 5000)
  46. {
  47. if(response)
  48. {
  49. new skinid, message[64];
  50. skinid = strval(inputtext);
  51. if(skinid < 0 || skinid > 299)
  52. {
  53. SendClientMessage(playerid, 0xFFFFFFFF, "The skin ID entered is not from 0 to 299");
  54. }
  55. else
  56. {
  57. SetPlayerSkin(playerid, skinid);
  58. format(message, sizeof(message), "We've provided you with the skin ID %d.", skinid);
  59. ChangingSkin(playerid);
  60. SendClientMessage(playerid, 0xFFFFFFFF, message);
  61. }
  62. }
  63. return 1;
  64. }
  65. return 0;
  66. }
  67.  
  68. stock ChangingSkin(playerid)
  69. {
  70. SetTimer("SkinChangerTimer", 10000, false);
  71. CanChangeSkin[playerid] = 1;
  72. return 1;
  73. }
  74.  
  75. forward SkinChangerTimer(playerid);
  76. public SkinChangerTimer(playerid)
  77. {
  78. SendClientMessage(playerid, COLOR_LIGHTBLUE, "You're now available to change your skin again.");
  79. CanChangeSkin[playerid] = 0;
  80. return 1;
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement