Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==============================Skin System=====================
- // =============================Credits to Lzy===================
- // ============================Edited By Accardo=================
- //#define FILTERSCRIPT
- #include <a_samp>
- #pragma tabsize 0
- //Color
- #define COLOR_RED 0xAA3333AA
- #define COLOR_GREEN 0x33AA33AA
- //Dialog
- #define DIALOG_STYLES 0
- #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
- forward IsAtClothesShop(playerid);
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("Accardo Clothes System");
- print("Credits To Lzy");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- dcmd(buyclothes,10,cmdtext);
- return 0;
- }
- dcmd_buyclothes(playerid, params[])
- {
- #pragma unused pragma
- if(!IsAtClothesShop(playerid)) return SendClientMessage(playerid, COLOR_RED, "You must in clothes shop)
- ShowPlayerDialog(playerid,55,DIALOG_STYLE_INPUT,"Clothes Shop","Enter Skin ID | $500","Ok","Cancel");
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 55 && response == 1)
- {
- if(GetPlayerMoney(playerid)>500)
- {
- if(IsValidSkin(strval(inputtext)))
- {
- SetPlayerSkin(playerid, strval(inputtext));
- GivePlayerMoney(playerid,-5000);
- SendClientMessage(playerid,0x33AA33AA,"You Used $500 To Buy A Clothes");
- }
- else
- {
- SendClientMessage(playerid,0xAA3333AA,"Invalid Skin ID");
- }
- }
- else
- {
- SendClientMessage(playerid,0xAA3333AA,"You Dont Have Money To Buy Any Clothes");
- }
- }
- return 1;
- }
- stock IsNumeric(string[])
- {
- for (new i = 0, j = strlen(string); i < j; i++)
- {
- if (string[i] > '9' || string[i] < '0') return 0;
- }
- return 1;
- }
- stock IsValidSkin(SkinID)
- {
- 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;
- else return false;
- }
- public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x); tempposy = (oldposy -y); tempposz = (oldposz -z);
- if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- { return true; }
- return false;
- }
- public IsAtClothesShop(playerid)
- {
- if(PlayerToPoint(20,playerid,161.5236, -83.3203, 1001.8047) ||
- PlayerToPoint(20,playerid,207.7182,-100.9436,1005.2578) ||
- PlayerToPoint(20,playerid,203.9261,-43.2656,1001.8047) ||
- PlayerToPoint(20,playerid,206.3746,-8.1824,1001.2109) ||
- PlayerToPoint(20,playerid,207.0685,-129.1833,1003.5078))
- { return true; }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement