Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <mSelection>
- #include <zcmd>
- #define DIALOG_ITEMS_SHOP 1
- new
- skinlist = mS_INVALID_LISTID,
- Gogglelist = mS_INVALID_LISTID,
- Hatslist = mS_INVALID_LISTID;
- public OnFilterScriptInit()
- {
- skinlist = LoadModelSelectionMenu("skins.txt");
- Gogglelist = LoadModelSelectionMenu("goggles.txt");
- Hatslist = LoadModelSelectionMenu("Hats.txt");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- CMD:shop(playerid,params[])
- {
- ShowPlayerDialog(playerid, DIALOG_ITEMS_SHOP, DIALOG_STYLE_LIST, "Items Shops", "Buy a skin\nBuy glasses\nBuy hats", "select","");
- return 1;
- }
- public OnPlayerModelSelection(playerid, response, listid, modelid)
- {
- if(listid == skinlist)
- {
- if(response)
- {
- SendClientMessage(playerid, -1, "You have selected your cloths!");
- SetPlayerSkin(playerid, modelid);
- PlayerPlaySound(playerid,5453,0.0,0.0,0.0);
- //GivePlayerMoney(playerid, amount) If you want charge player just uncomment this and put your value instead of "amount"
- }
- else SendClientMessage(playerid, -1, "You Canceled Skin Shop Menu");
- return 1;
- }
- if(listid == Gogglelist)
- {
- if(response)
- {
- SendClientMessage(playerid, -1, "You have selected your goggles!");
- SetPlayerAttachedObject(playerid, 2, modelid, 2,0.1,0.04,0.0,60.0,85.0,25.0,1.0,1.0,1.0);
- //GivePlayerMoney(playerid, amount) If you want charge player just uncomment this and put your value instead of "amount"
- }
- else SendClientMessage(playerid, -1, "You Canceled Skin Shop Menu");
- return 1;
- }
- if(listid == Hatslist)
- {
- if(response)
- {
- SendClientMessage(playerid, -1, "You have selected your hat!");
- SetPlayerAttachedObject(playerid, 3, modelid, 2, 0.094485, 0.007215, 0.0, 0.000000, 0.000000, 0.000000, 1.200000, 1.200000, 1.200000);
- //GivePlayerMoney(playerid, amount) If you want charge player just uncomment this and put your value instead of "amount"oinsCounter(playerid);
- }
- else SendClientMessage(playerid, -1, "You Canceled Skin Shop Menu");
- return 1;
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case DIALOG_ITEMS_SHOP:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- //if(GetPlayerMoney(playerid) < 1 ) return SendClientMessage(playerid, -2, "You do not have enough coins");
- //uncomment line above if you're charging player
- ShowModelSelectionMenu(playerid, skinlist, "Skins");
- }
- case 1:
- {
- //if(GetPlayerMoney(playerid) < 1 ) return SendClientMessage(playerid, -1, "You do not have enough coins");
- //uncomment line above if you're charging player
- ShowModelSelectionMenu(playerid, Gogglelist, "Goggles");
- }
- case 2:
- {
- //if(GetPlayerMoney(playerid) < 1 ) return SendClientMessage(playerid, -1, "You do not have enough coins");
- //uncomment line above if you're charging player
- ShowModelSelectionMenu(playerid, Hatslist, "Hats");
- }
- }
- }
- } }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment