Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Filterscript jBinco.
- Date: 2011-12-13.
- Author: Johurt(Edgar, ES.^)
- Filterscript created specially for www.gta-online.lt and www.pawno.ru
- */
- #define FILTERSCRIPT
- #include <a_samp>
- forward CheckKeyPress(playerid);
- forward ChangingAngle(playerid);
- new Pickup[2], bPickup,
- Shop[MAX_PLAYERS], Selected[MAX_PLAYERS],
- Last[MAX_PLAYERS], ShopTimer[MAX_PLAYERS][2],
- Text:bText[MAX_PLAYERS][2];
- // SkinID, SkinCost.
- new mSkin[29][2] =
- {
- {22, 300},
- {18, 80},
- {19, 150},
- {20, 100},
- {21, 70},
- {28, 100},
- {29, 110},
- {30, 40} ,
- {45, 30},
- {46, 160},
- {59, 200},
- {83, 500},
- {98, 60},
- {96, 70},
- {111, 400},
- {120, 700},
- {124, 20},
- {126, 100},
- {185, 70},
- {184, 80},
- {240, 130},
- {252, 20},
- {254, 180},
- {293, 100},
- {292, 30},
- {294, 300},
- {299, 210},
- {181, 100},
- {171, 100}
- };
- new fSkin[22][2] =
- {
- {11, 80},
- {12, 100},
- {13, 100},
- {40, 200},
- {55, 120},
- {64, 150},
- {76, 170},
- {91, 400},
- {140, 60},
- {150, 140},
- {169, 149},
- {172, 119},
- {190, 70},
- {192, 50},
- {193, 70},
- {195, 147},
- {214, 319},
- {216, 297},
- {226, 40},
- {233, 297},
- {237, 600},
- {263, 269}
- };
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------------");
- print("[FS]jBinco - Clothes Store by Johurt loaded.");
- print("--------------------------------------------\n");
- Pickup[0] = CreatePickup(1318, 1, -2374.3047, 910.1966, 45.4453);
- Pickup[1] = CreatePickup(1318, 1, 207.7075, -110.8018, 1005.1328);
- bPickup = CreatePickup(1275, 2, 208.9108, -100.6917, 1005.2578);
- for(new p = 0; p < MAX_PLAYERS; p++)
- {
- Clear(p);
- bText[p][0] = TextDrawCreate(258.000000, 361.000000, "DoNotChange");
- TextDrawBackgroundColor(bText[p][0], 255);
- TextDrawFont(bText[p][0], 1);
- TextDrawLetterSize(bText[p][0], 0.000000, 4.999997);
- TextDrawColor(bText[p][0], 102);
- TextDrawSetOutline(bText[p][0], 0);
- TextDrawSetProportional(bText[p][0], 1);
- TextDrawSetShadow(bText[p][0], 1);
- TextDrawUseBox(bText[p][0], 1);
- TextDrawBoxColor(bText[p][0], 102);
- TextDrawTextSize(bText[p][0], 404.000000, 0.000000);
- bText[p][1] = TextDrawCreate(260.000000, 365.000000, " ");
- TextDrawBackgroundColor(bText[p][1], 255);
- TextDrawFont(bText[p][1], 2);
- TextDrawLetterSize(bText[p][1], 0.190000, 1.000000);
- TextDrawColor(bText[p][1], -1);
- TextDrawSetOutline(bText[p][1], 0);
- TextDrawSetProportional(bText[p][1], 1);
- TextDrawSetShadow(bText[p][1], 1);
- }
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n----------------------------------------------");
- print("[FS]jBinco - Clothes Store by Johurt unloaded.");
- print("----------------------------------------------\n");
- DestroyPickup(Pickup[0]); DestroyPickup(Pickup[1]); DestroyPickup(bPickup);
- for(new p = 0; p < MAX_PLAYERS; p++)
- {
- Clear(p);
- TextDrawHideForPlayer(p, bText[p][0]);
- TextDrawHideForPlayer(p, bText[p][1]);
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- Clear(playerid);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- Clear(playerid);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(Shop[playerid] > 0) Clear(playerid);
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == bPickup) ShowPlayerDialog(playerid, 1500, DIALOG_STYLE_LIST, "{e38400}Binco", "{6fa7fb}Male clothes.\n{E01B98}Female clothes.", "Select", "Close");
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(oldkeys == KEY_SECONDARY_ATTACK)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, -2374.3047, 910.1966, 45.4453))
- {
- SetPlayerInterior(playerid, 15);
- SetPlayerPos(playerid, 207.7075, -110.8018, 1005.1328);
- SetPlayerFacingAngle(playerid, 0.1588);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, 207.7075, -110.8018, 1005.1328))
- {
- SetPlayerInterior(playerid, 0);
- SetPlayerPos(playerid, -2374.3047, 910.1966, 45.4453);
- SetPlayerFacingAngle(playerid, 88.0822);
- }
- else if(Shop[playerid] > 0)
- {
- ShowPlayerDialog(playerid, 1501, DIALOG_STYLE_LIST, "{e38400}Binco", "Buy clothes.\nBack.\nExit.", "Select", "Back");
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 1500)
- {
- if(response)
- {
- Last[playerid] = GetPlayerSkin(playerid);
- ShopTimer[playerid][0] = SetTimerEx("CheckKeyPress", 200, true, "i", playerid);
- ShopTimer[playerid][1] = SetTimerEx("ChangingAngle", 500, true, "i", playerid);
- SetPlayerPos(playerid, 218.0869, -98.4392, 1005.2578);
- SetPlayerFacingAngle(playerid, 301.0973);
- TogglePlayerControllable(playerid, 0);
- SetPlayerVirtualWorld(playerid, playerid + 500);
- Selected[playerid] = -1;
- SetPlayerCameraPos(playerid, 215.1282, -100.2218, 1006.6323);
- SetPlayerCameraLookAt(playerid, 218.0869, -98.4392, 1005.2578);
- SendClientMessage(playerid, 0x1586c850, "Hi buyer, choose the clothes.");
- switch(listitem)
- {
- switch(listitem)
- {
- case 0: Shop[playerid] = 1;
- case 1: Shop[playerid] = 2;
- }
- }
- }
- return 1;
- }
- if(dialogid == 1501)
- {
- if(response)
- {
- if(Shop[playerid] > 0)
- {
- switch(listitem)
- {
- case 0:
- {
- new id, cost;
- switch(Shop[playerid])
- {
- case 1:id = mSkin[Selected[playerid]][0], cost = mSkin[Selected[playerid]][1];
- case 2:id = fSkin[Selected[playerid]][0], cost = fSkin[Selected[playerid]][1];
- }
- if(cost > GetPlayerMoney(playerid)) return SendClientMessage(playerid, 0xfe930450, "You don't have not enough money to pay for clothes.");
- GivePlayerMoney(playerid, - cost);
- SetCameraBehindPlayer(playerid);
- SetPlayerInterior(playerid, 15);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, 208.9334, -102.3423, 1005.2578);
- SetPlayerFacingAngle(playerid, 180.4720);
- SetPlayerSkin(playerid, id);
- Clear(playerid);
- SendClientMessage(playerid, 0x8fcf2650, "Thanks for purchase.");
- return 1;
- }
- case 2:
- {
- if(Shop[playerid] >= 1)
- {
- SetCameraBehindPlayer(playerid);
- SetPlayerInterior(playerid, 15);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, 208.9334, -102.3423, 1005.2578);
- SetPlayerFacingAngle(playerid, 180.4720);
- SetPlayerSkin(playerid, Last[playerid]);
- Clear(playerid);
- return 1;
- }
- }
- }
- }
- }
- return 1;
- }
- return 1;
- }
- public CheckKeyPress(playerid)
- {
- if(Shop[playerid] != 0)
- {
- TogglePlayerControllable(playerid, 0);
- new keys, updown, leftright, string[105];
- if(Shop[playerid] == 1)
- {
- TextDrawShowForPlayer(playerid, bText[playerid][0]);
- TextDrawShowForPlayer(playerid, bText[playerid][1]);
- if(Selected[playerid] < 0)
- {
- Selected[playerid] = 0;
- SetPlayerSkin(playerid, mSkin[Selected[playerid]][0]);
- format(string, sizeof(string),"~w~Clothes ID: ~g~%d~n~~w~Price: ~g~%d~n~~w~Buy/Exit: ~g~ENTER~n~~w~To change clothes: ~g~~<~ ~>~", mSkin[Selected[playerid]][0], mSkin[Selected[playerid]][1]);
- TextDrawSetString(bText[playerid][1], string);
- }
- GetPlayerKeys(playerid, keys, updown, leftright);
- if(leftright > 0)
- {
- Selected[playerid] ++;
- if(Selected[playerid] >= sizeof(mSkin)) Selected[playerid] = 0;
- SetPlayerSkin(playerid, mSkin[Selected[playerid]][0]);
- format(string, sizeof(string),"~w~Clothes ID: ~g~%d~n~~w~Price: ~g~%d~n~~w~Buy/Exit: ~g~ENTER~n~~w~To change clothes: ~g~~<~ ~>~", mSkin[Selected[playerid]][0], mSkin[Selected[playerid]][1]);
- TextDrawSetString(bText[playerid][1], string);
- }
- else if(leftright < 0)
- {
- Selected[playerid] --;
- if(Selected[playerid] < 0) Selected[playerid] = sizeof(mSkin) - 1;
- SetPlayerSkin(playerid, mSkin[Selected[playerid]][0]);
- format(string, sizeof(string),"~w~Clothes ID: ~g~%d~n~~w~Price: ~g~%d~n~~w~Buy/Exit: ~g~ENTER~n~~w~To change clothes: ~g~~<~ ~>~", mSkin[Selected[playerid]][0], mSkin[Selected[playerid]][1]);
- TextDrawSetString(bText[playerid][1], string);
- }
- }
- else if(Shop[playerid] == 2)
- {
- TextDrawShowForPlayer(playerid, bText[playerid][0]);
- TextDrawShowForPlayer(playerid, bText[playerid][1]);
- if(Selected[playerid] < 0)
- {
- Selected[playerid] = 0;
- SetPlayerSkin(playerid, fSkin[Selected[playerid]][0]);
- format(string, sizeof(string),"~w~Clothes ID: ~g~%d~n~~w~Price: ~g~%d~n~~w~Buy/Exit: ~g~ENTER~n~~w~To change clothes: ~g~~<~ ~>~", fSkin[Selected[playerid]][0], fSkin[Selected[playerid]][1]);
- TextDrawSetString(bText[playerid][1], string);
- }
- GetPlayerKeys(playerid, keys,updown, leftright);
- if(leftright > 0)
- {
- Selected[playerid] ++;
- if(Selected[playerid] >= sizeof(fSkin)) Selected[playerid] = 0;
- SetPlayerSkin(playerid, fSkin[Selected[playerid]][0]);
- format(string, sizeof(string),"~w~Clothes ID: ~g~%d~n~~w~Price: ~g~%d~n~~w~Buy/Exit: ~g~ENTER~n~~w~To change clothes: ~g~~<~ ~>~", fSkin[Selected[playerid]][0], fSkin[Selected[playerid]][1]);
- TextDrawSetString(bText[playerid][1], string);
- }
- else if(leftright < 0)
- {
- Selected[playerid] --;
- if(Selected[playerid] < 0) Selected[playerid] = sizeof(fSkin) - 1;
- SetPlayerSkin(playerid, fSkin[Selected[playerid]][0]);
- format(string, sizeof(string),"~w~Clothes ID: ~g~%d~n~~w~Price: ~g~%d~n~~w~Buy/Exit: ~g~ENTER~n~~w~To change clothes: ~g~~<~ ~>~", fSkin[Selected[playerid]][0], fSkin[Selected[playerid]][1]);
- TextDrawSetString(bText[playerid][1], string);
- }
- }
- }
- else
- {
- Clear(playerid);
- }
- return 1;
- }
- public ChangingAngle(playerid)
- {
- if(Shop[playerid] >= 1)
- {
- new Float:A;
- GetPlayerFacingAngle(playerid, A);
- SetPlayerFacingAngle(playerid, A + 5.0);
- }
- return 1;
- }
- stock Clear(playerid)
- {
- Shop[playerid] = 0;
- Selected[playerid] = -1;
- Last[playerid] = 0;
- KillTimer(ShopTimer[playerid][0]);
- KillTimer(ShopTimer[playerid][1]);
- TextDrawHideForPlayer(playerid, bText[playerid][0]);
- TextDrawHideForPlayer(playerid, bText[playerid][1]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement