Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define FILTERSCRIPT
- #define GREY 0x99999999
- #define ORANGE 0xFF6600FF
- #define RED 0xFF0000FF
- #define GREEN 0x00FF00FF
- #define BLUE 0x0000FFFF
- #define WHITE 0xFFFFFFFF
- #define BLACK 0x000000AA
- #define BLUE1 0x1229FAFF
- #if defined FILTERSCRIPT
- new Menu: HIMenu;
- new shop[MAX_PLAYERS] = 0;
- public OnFilterScriptInit()
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(shop[playerid] == 1)
- {
- HIMenu = CreateMenu("The Shop",1,40,150,230,0);
- AddMenuItem(HIMenu,0,"$ 15.000 - ~g~M4");
- AddMenuItem(HIMenu,0,"$ 10.000 - ~g~MP5");
- AddMenuItem(HIMenu,0,"$ 8.000 - ~g~Country Rifle");
- AddMenuItem(HIMenu,0,"$ 9.000 - ~g~Sniper Rifle");
- AddMenuItem(HIMenu,0,"$ 12.000 - ~g~Desert Eagle");
- AddMenuItem(HIMenu,0,"$ 20.000 - ~g~Shotgun");
- AddMenuItem(HIMenu,0,"$ 6.000 - ~g~9mm");
- AddMenuItem(HIMenu,0,"Done");
- TogglePlayerControllable(playerid,0);
- ShowMenuForPlayer(HIMenu,playerid);
- SetPlayerInterior(playerid,6);
- SetPlayerPos(playerid,310.7842,-165.3932,999.6010);
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/shop",cmdtext,true,10) == 0)
- {
- SendClientMessage(playerid,WHITE,"You'll go to the shop when you respawn");
- SetPlayerCameraPos(playerid,311.7842,-165.3932,999.6010);
- SetPlayerCameraLookAt(playerid,311.5911,-166.1371,999.6010);
- shop[playerid] = 1;
- return 1;
- }
- return 0;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- new Menu: Current = GetPlayerMenu(playerid);
- if (Current == HIMenu)
- {
- switch(row)
- {
- case 0:
- {
- GivePlayerWeapon(playerid, 31, 500);
- GivePlayerMoney(playerid, -15000);
- ShowMenuForPlayer(HIMenu,playerid);
- TogglePlayerControllable(playerid,0);
- }
- case 1:
- {
- GivePlayerWeapon(playerid, 29, 500);
- GivePlayerMoney(playerid, -15000);
- ShowMenuForPlayer(HIMenu,playerid);
- TogglePlayerControllable(playerid,0);
- }
- case 2:
- {
- GivePlayerWeapon(playerid, 33, 500);
- GivePlayerMoney(playerid, -15000);
- ShowMenuForPlayer(HIMenu,playerid);
- TogglePlayerControllable(playerid,0);
- }
- case 3:
- {
- GivePlayerWeapon(playerid, 34, 500);
- GivePlayerMoney(playerid, -15000);
- ShowMenuForPlayer(HIMenu,playerid);
- TogglePlayerControllable(playerid,0);
- }
- case 4:
- {
- GivePlayerWeapon(playerid, 24, 500);
- GivePlayerMoney(playerid, -15000);
- ShowMenuForPlayer(HIMenu,playerid);
- TogglePlayerControllable(playerid,0);
- }
- case 5:
- {
- GivePlayerWeapon(playerid, 25, 500);
- GivePlayerMoney(playerid, -15000);
- ShowMenuForPlayer(HIMenu,playerid);
- TogglePlayerControllable(playerid,0);
- }
- case 6:
- {
- GivePlayerWeapon(playerid, 22, 500);
- GivePlayerMoney(playerid, -15000);
- ShowMenuForPlayer(HIMenu,playerid);
- TogglePlayerControllable(playerid,0);
- }
- case 7:
- {
- shop[playerid] = 0;
- }
- }
- }
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- new Menu:Current = GetPlayerMenu(playerid);
- if (Current == HIMenu)
- {
- HideMenuForPlayer(HIMenu,playerid);
- TogglePlayerControllable(playerid,1);
- }
- else
- {
- ShowMenuForPlayer(HIMenu,playerid);
- TogglePlayerControllable(playerid,0);
- }
- return 1;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment