Advertisement
Xaviour212

Lzy Skin Shop edited by Dirza

Apr 16th, 2011
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.47 KB | None | 0 0
  1. // ==============================Skin System=====================
  2. // =============================Credits to Lzy===================
  3. // ============================Edited By Accardo=================
  4. //#define FILTERSCRIPT
  5.  
  6. #include <a_samp>
  7. #pragma tabsize 0
  8. //Color
  9. #define COLOR_RED 0xAA3333AA
  10. #define COLOR_GREEN 0x33AA33AA
  11.  
  12. //Dialog
  13. #define DIALOG_STYLES 0
  14.  
  15. #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
  16.  
  17. forward IsAtClothesShop(playerid);
  18. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  19.  
  20. public OnFilterScriptInit()
  21. {
  22.     print("\n--------------------------------------");
  23.     print("Accardo Clothes System");
  24.     print("Credits To Lzy");
  25.     print("--------------------------------------\n");
  26.     return 1;
  27. }
  28.  
  29. public OnFilterScriptExit()
  30. {
  31.     return 1;
  32. }
  33.  
  34. public OnPlayerSpawn(playerid)
  35. {
  36.     return 1;
  37. }
  38.  
  39. public OnPlayerCommandText(playerid, cmdtext[])
  40. {
  41.     dcmd(buyclothes,10,cmdtext);
  42.    
  43.     return 0;
  44. }
  45.  
  46. dcmd_buyclothes(playerid, params[])
  47. {
  48.     #pragma unused pragma
  49.     if(!IsAtClothesShop(playerid)) return SendClientMessage(playerid, COLOR_RED, "You must in clothes shop)
  50.     ShowPlayerDialog(playerid,55,DIALOG_STYLE_INPUT,"Clothes Shop","Enter Skin ID | $500","Ok","Cancel");
  51.     return 1;
  52. }
  53.  
  54. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  55. {
  56.     if(dialogid == 55 && response == 1)
  57.     {
  58.         if(GetPlayerMoney(playerid)>500)
  59.             {
  60.             if(IsValidSkin(strval(inputtext)))
  61.                 {
  62.                 SetPlayerSkin(playerid, strval(inputtext));
  63.                 GivePlayerMoney(playerid,-5000);
  64.                 SendClientMessage(playerid,0x33AA33AA,"You Used $500 To Buy A Clothes");
  65.                 }
  66.             else
  67.                 {
  68.                 SendClientMessage(playerid,0xAA3333AA,"Invalid Skin ID");
  69.                 }
  70.             }
  71.         else
  72.             {
  73.                 SendClientMessage(playerid,0xAA3333AA,"You Dont Have Money To Buy Any Clothes");
  74.             }
  75.     }
  76.  return 1;
  77. }
  78.  
  79. stock IsNumeric(string[])
  80. {
  81.        for (new i = 0, j = strlen(string); i < j; i++)
  82.        {
  83.                if (string[i] > '9' || string[i] < '0') return 0;
  84.        }
  85.        return 1;
  86. }
  87. stock IsValidSkin(SkinID)
  88. {
  89.        if((SkinID >= 0) && (SkinID <= 3)||(SkinID == 7)||(SkinID >= 9 && SkinID <= 41)||(SkinID >= 43 && SkinID <= 64)||(SkinID >= 66 && SkinID <= 73)||(SkinID >= 75 && SkinID <= 85)||(SkinID >= 87 && SkinID <= 118)||(SkinID >= 120 && SkinID <= 148)||(SkinID >= 150 && SkinID <= 207)||(SkinID >= 209 && SkinID <= 264)||(SkinID >= 274 && SkinID <= 288)||(SkinID >= 290 && SkinID <= 299)) return true;
  90.        else return false;
  91. }
  92.  
  93. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  94. {
  95.     new Float:oldposx, Float:oldposy, Float:oldposz;
  96.     new Float:tempposx, Float:tempposy, Float:tempposz;
  97.     GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  98.     tempposx = (oldposx -x); tempposy = (oldposy -y); tempposz = (oldposz -z);
  99.     if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  100.     { return true; }
  101.     return false;
  102. }
  103.  
  104. public IsAtClothesShop(playerid)
  105. {
  106.     if(PlayerToPoint(20,playerid,161.5236, -83.3203, 1001.8047) ||
  107.     PlayerToPoint(20,playerid,207.7182,-100.9436,1005.2578) ||
  108.     PlayerToPoint(20,playerid,203.9261,-43.2656,1001.8047) ||
  109.     PlayerToPoint(20,playerid,206.3746,-8.1824,1001.2109) ||
  110.     PlayerToPoint(20,playerid,207.0685,-129.1833,1003.5078))
  111.     { return true; }
  112.     return false;
  113. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement