Автор: iHaze
Вы сможете купить оружие и наркотики с помощью следующих команд:
- /gndhelp - открывает список команд.
- /pickgun - Открывает диалог со списком оружия на столах. (M4 - Sniper - MP5)
- /pickdrug - Открывает диалог со списком наркотиков на столах. (Weed - кокаин)
- /pickammo - открывает вам боеприпасы для M4 - MP5
- /picksniperammo - дает вам дополнительные боеприпасы для снайпера.
- /enter - Вход
- /exit - Выход
Оружие:
- M4 - 7000$
- Sniper -10000$
- MP5 - 7000$
Наркотики:
- Weed - стоит 60 $ для 5 граммов (100 здоровья)
- Cocaine - стоит 100 $ за 5 грамм (100 Броня)
Патроны:
- General Ammo - стоит 3000 $ - Дает боеприпасы для M4 и MP5
- Sniper Ammo - стоит 5000 $ - Дает вам боеприпасы для снайперки
- Скриншоты
- Код
Code: Select all
/*
################################
# Guns'n'Drugs - By Xaerie #
################################
*/
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
//=====[Dialogs]======//
#define HELP_DIALOG 990
#define DRUGS_DIALOG 991
#define AMMO_DIALOG 992
#define SNIPERAMMO_DIALOG 993
#define GUNS_DIALOG 994
//Color defines.
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_FADE1 0xE6E6E6E6
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E
#define COLOR_GREY 0xAFAFAFFF
#define COLOR_LIGHTGREEN 0xADFF2FFF
#define COLOR_LIGHTRED 0xFF6347FF
#define COLOR_DARKRED 0xAA3333FF
#define COLOR_RED 0xFF0606FF
#define COLOR_LIGHTBLUE 0x33CCFFFF
#define COLOR_GREEN 0x007700FF
#define COLOR_YELLOW 0xFFFF00FF
#define COLOR_PURPLE 0xC2A2DAFF
#define COLOR_ORANGE 0xFF9900FF
#define COLOR_BLUE 0x2641FEFF
#define COLOR_LIME 0x00FF00FF
public OnFilterScriptInit()
{
//============[Guns and drugs house - By Xaerie]=================//
CreateObject(16150,2266.0996094,-1577.0996094,1492.5999756,0.0000000,0.0000000,0.5000000); //object(ufo_barinterior) (1)
CreateObject(941,2268.1999512,-1589.8000488,1493.6999512,0.0000000,0.0000000,0.0000000); //object(cj_df_worktop_3) (1)
CreateObject(941,2265.8000488,-1589.8000488,1493.6999512,0.0000000,0.0000000,0.0000000); //object(cj_df_worktop_3) (2)
CreateObject(941,2263.3999023,-1589.8000488,1493.6999512,0.0000000,0.0000000,0.0000000); //object(cj_df_worktop_3) (3)
CreateObject(2035,2269.1000977,-1589.5000000,1494.1999512,0.0000000,0.0000000,0.0000000); //object(cj_m16) (1)
CreateObject(2035,2269.1000977,-1590.0999756,1494.1999512,0.0000000,0.0000000,0.0000000); //object(cj_m16) (3)
CreateObject(2035,2268.0000000,-1589.5000000,1494.1999512,0.0000000,0.0000000,0.0000000); //object(cj_m16) (4)
CreateObject(2035,2268.0000000,-1590.0999756,1494.1999512,0.0000000,0.0000000,0.0000000); //object(cj_m16) (6)
CreateObject(2036,2266.1999512,-1589.5000000,1494.1999512,0.0000000,0.0000000,0.0000000); //object(cj_psg1) (1)
CreateObject(2036,2266.1999512,-1590.0000000,1494.1999512,0.0000000,0.0000000,0.0000000); //object(cj_psg1) (2)
CreateObject(2044,2264.3999023,-1589.5000000,1494.1999512,0.0000000,0.0000000,0.0000000); //object(cj_mp5k) (1)
CreateObject(2044,2264.3994141,-1590.0996094,1494.1999512,0.0000000,0.0000000,0.0000000); //object(cj_mp5k) (2)
CreateObject(2044,2263.8000488,-1590.0999756,1494.1999512,0.0000000,0.0000000,0.0000000); //object(cj_mp5k) (3)
CreateObject(2044,2263.8000488,-1589.5000000,1494.1999512,0.0000000,0.0000000,0.0000000); //object(cj_mp5k) (4)
CreateObject(2044,2263.1999512,-1589.5000000,1494.1999512,0.0000000,0.0000000,0.0000000); //object(cj_mp5k) (5)
CreateObject(2044,2263.1999512,-1590.0999756,1494.1999512,0.0000000,0.0000000,0.0000000); //object(cj_mp5k) (6)
CreateObject(3052,2263.0000000,-1571.9000244,1493.6999512,0.0000000,0.0000000,0.0000000); //object(db_ammo) (1)
CreateObject(3052,2263.8999023,-1571.9000244,1493.6999512,0.0000000,0.0000000,0.0000000); //object(db_ammo) (2)
CreateObject(2358,2265.3999023,-1571.8000488,1493.6999512,0.0000000,0.0000000,0.0000000); //object(ammo_box_c2) (1)
CreateObject(2358,2266.3000488,-1571.8000488,1493.6999512,0.0000000,0.0000000,0.0000000); //object(ammo_box_c2) (2)
CreateObject(1431,2271.1000977,-1576.4000244,1493.1999512,0.0000000,0.0000000,0.0000000); //object(dyn_box_pile) (1)
CreateObject(1431,2273.3000488,-1576.3000488,1493.1999512,0.0000000,0.0000000,0.0000000); //object(dyn_box_pile) (2)
CreateObject(941,2263.3000488,-1571.8000488,1493.0999756,0.0000000,0.0000000,0.0000000); //object(cj_df_worktop_3) (4)
CreateObject(941,2265.6999512,-1571.8000488,1493.0999756,0.0000000,0.0000000,0.0000000); //object(cj_df_worktop_3) (5)
CreateObject(941,2268.1999512,-1571.8000488,1493.0999756,0.0000000,0.0000000,0.0000000); //object(cj_df_worktop_3) (6)
CreateObject(3013,2267.6000977,-1571.9000244,1493.6999512,0.0000000,0.0000000,0.0000000); //object(cr_ammobox) (1)
CreateObject(3013,2268.0000000,-1571.9000244,1493.6999512,0.0000000,0.0000000,0.0000000); //object(cr_ammobox) (2)
CreateObject(3013,2268.3999023,-1571.9000244,1493.6999512,0.0000000,0.0000000,0.0000000); //object(cr_ammobox) (3)
CreateObject(3013,2268.8000488,-1571.9000244,1493.6999512,0.0000000,0.0000000,0.0000000); //object(cr_ammobox) (4)
CreateObject(3013,2269.1999512,-1571.9000244,1493.6999512,0.0000000,0.0000000,0.0000000); //object(cr_ammobox) (5)
CreateObject(2048,2265.6999512,-1571.3000488,1494.5999756,0.0000000,0.0000000,0.0000000); //object(cj_flag2) (1)
CreateObject(2047,2266.3000488,-1590.3000488,1494.9000244,0.0000000,0.0000000,177.0000000); //object(cj_flag1) (1)
CreateObject(2619,2269.6999512,-1581.6999512,1494.0999756,0.0000000,0.0000000,0.0000000); //object(mp_ammoambient) (1)
CreateObject(2977,2270.6999512,-1583.0000000,1492.5999756,0.0000000,0.0000000,0.0000000); //object(kmilitary_crate) (2)
CreateObject(2977,2271.8000488,-1583.0000000,1492.5999756,0.0000000,0.0000000,0.0000000); //object(kmilitary_crate) (3)
CreateObject(2977,2272.8999023,-1583.0000000,1492.5999756,0.0000000,0.0000000,0.0000000); //object(kmilitary_crate) (4)
CreateObject(2977,2274.0000000,-1583.0000000,1492.5999756,0.0000000,0.0000000,0.0000000); //object(kmilitary_crate) (5)
CreateObject(941,2262.8999023,-1575.0000000,1493.0999756,0.0000000,0.0000000,270.2500000); //object(cj_df_worktop_3) (9)
CreateObject(941,2262.8999023,-1577.4000244,1493.0999756,0.0000000,0.0000000,270.2471924); //object(cj_df_worktop_3) (10)
CreateObject(1575,2263.0000000,-1578.3000488,1493.5999756,0.0000000,0.0000000,0.0000000); //object(drug_white) (3)
CreateObject(1575,2263.0000000,-1577.5999756,1493.5999756,0.0000000,0.0000000,0.0000000); //object(drug_white) (4)
CreateObject(1575,2263.0000000,-1576.9000244,1493.5999756,0.0000000,0.0000000,0.0000000); //object(drug_white) (5)
CreateObject(1578,2263.0000000,-1576.0999756,1493.5999756,0.0000000,0.0000000,0.0000000); //object(drug_green) (2)
CreateObject(1578,2263.0000000,-1575.3000488,1493.5999756,0.0000000,0.0000000,0.0000000); //object(drug_green) (3)
CreateObject(1578,2263.0000000,-1574.5000000,1493.5999756,0.0000000,0.0000000,0.0000000); //object(drug_green) (4)
CreateObject(964,2274.0000000,-1577.9000244,1492.5999756,0.0000000,0.0000000,270.7500000); //object(cj_metal_crate) (1)
CreateObject(964,2274.0000000,-1579.3000488,1492.5999756,0.0000000,0.0000000,270.7470703); //object(cj_metal_crate) (2)
CreateObject(941,2269.1999512,-1577.6999512,1493.0999756,0.0000000,0.0000000,270.2471924); //object(cj_df_worktop_3) (11)
CreateObject(941,2269.1999512,-1575.3000488,1493.0999756,0.0000000,0.0000000,270.2471924); //object(cj_df_worktop_3) (13)
CreateObject(2041,2269.1000977,-1574.6999512,1493.8000488,0.0000000,0.0000000,272.0000000); //object(ammo_box_m2) (2)
CreateObject(2041,2269.1000977,-1575.1999512,1493.8000488,0.0000000,0.0000000,271.9995117); //object(ammo_box_m2) (7)
CreateObject(2041,2269.1000977,-1575.6999512,1493.8000488,0.0000000,0.0000000,271.9995117); //object(ammo_box_m2) (8)
CreateObject(2041,2269.1000977,-1576.1999512,1493.8000488,0.0000000,0.0000000,271.9995117); //object(ammo_box_m2) (9)
CreateObject(2043,2269.1999512,-1577.3000488,1493.6999512,0.0000000,0.0000000,269.9999695); //object(ammo_box_m4) (1)
CreateObject(2043,2269.1999512,-1577.8000488,1493.6999512,0.0000000,0.0000000,269.9945068); //object(ammo_box_m4) (2)
CreateObject(2042,2269.0000000,-1578.5999756,1493.6999512,0.0000000,0.0000000,193.9999542); //object(ammo_box_m3) (1)
CreateObject(2680,2274.6999512,-1580.5999756,1493.4000244,0.0000000,0.0000000,282.0000000); //object(cj_padlock) (1)
CreateObject(2680,2269.6000977,-1573.9000244,1493.4000244,0.0000000,0.0000000,281.9970703); //object(cj_padlock) (2)
CreateObject(2680,2269.6000977,-1572.6999512,1493.4000244,0.0000000,0.0000000,281.9970703); //object(cj_padlock) (3)
CreateObject(2395,2262.3999023,-1583.5999756,1492.5999756,0.0000000,0.0000000,90.2500000); //object(cj_sports_wall) (1)
CreateObject(1508,2262.3999023,-1581.0999756,1494.3000488,0.0000000,0.0000000,0.0000000); //object(dyn_garage_door) (1)
//============[Icons]==========//
CreatePickup(356, 1, 2266.2354,-1588.6969,1494.1938); // Weapons.
Create3DTextLabel("Guns Table\n{FFFF00}/pickgun to pick a gun", COLOR_RED, 2266.2354,-1588.6969,1494.1938, 30, 0, 1);
CreatePickup(1279, 1, 2264.0383,-1576.4703,1493.6078); // Drugs.
Create3DTextLabel("Drugs Table\n{FFFF00}/pickdrug to pick a drug", COLOR_RED, 2264.0383,-1576.4703,1493.6078, 30, 0, 1);
CreatePickup(1252, 1, 2265.7605,-1572.8833,1493.6078); // Ammo 1.
Create3DTextLabel("Ammo Table\n{FFFF00}/pickammo to pick a ammo package", COLOR_RED, 2265.7605,-1572.8833,1493.6078, 30, 0, 1);
CreatePickup(358, 1, 2268.1182,-1576.7301,1493.6078); // Sniper Ammo.
Create3DTextLabel("Sniper Ammo Table\n{FFFF00}/picksniperammo to pick a sniper ammo package", COLOR_RED, 2268.1182,-1576.7301,1493.6078, 30, 0, 1);
CreatePickup(1279, 1, 2262.7461,-1582.6334,1493.6000); // Exit icon.
Create3DTextLabel("Exit\n{FFFF00}/exit to go outside", COLOR_RED, 2262.7461,-1582.6334,1493.6000, 30, 0, 1);
CreatePickup(1279, 1, 2445.4182,-1758.6792,13.5924); // Enter icon
Create3DTextLabel("Guns'n'Drugs House\n{FFFF00}/enter to go inside", COLOR_RED, 2445.4182,-1758.6792,13.5924, 30, 0, 1);
return 1;
}
CMD:gndhelp(playerid, params[])
{
ShowPlayerDialog(playerid, HELP_DIALOG, DIALOG_STYLE_MSGBOX, "Guns 'n' Drugs Help", "/gndhelp\n/pickgun\n/pickammo\n/pickdrug\n/pickammo\n/picksniperammo\n/enter\n/exit", "Close", "Close");
return 1;
}
CMD:pickgun(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 2, 2266.2354,-1588.6969,1494.1938)) return SendClientMessage(playerid, COLOR_GREY, "You are not at the Guns'n'Drugs house.");
ShowPlayerDialog(playerid, GUNS_DIALOG, DIALOG_STYLE_LIST, "Guns 'n' Drugs Weapons", "M4 (7000$)\nSniper Rifle (10000$)\nSMG (5000$)", "Pick", "Close");
return 1;
}
CMD:pickdrug(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 2, 2264.0383,-1576.4703,1493.6078)) return SendClientMessage(playerid, COLOR_GREY, "You are not at the Guns'n'Drugs house.");
ShowPlayerDialog(playerid, DRUGS_DIALOG, DIALOG_STYLE_LIST, "Guns'n'Drugs Drugs", "Weed\nCocaine", "Pick ", "Close");
return 1;
}
CMD:pickammo(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 2, 2265.7605,-1572.8833,1493.6078)) return SendClientMessage(playerid, COLOR_GREY, "You are not at the Guns'n'Drugs house.");
if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid, COLOR_RED, "Guns'n'Drugs: You don't have enough money to buy ammo package.(3000$)");
GivePlayerMoney(playerid, -3000);
GivePlayerWeapon(playerid, 31, 400);
GivePlayerWeapon(playerid, 29, 300);
SendClientMessage(playerid, COLOR_RED, "Guns'n'Drugs: You have bought a weapon package.");
return 1;
}
CMD:picksniperammo(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 2, 2268.1182,-1576.7301,1493.6078)) return SendClientMessage(playerid, COLOR_GREY, "You are not at the Guns'n'Drugs house.");
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, COLOR_RED, "Guns'n'Drugs: You don't have enough money to buy sniper ammo package.(5000$)");
GivePlayerMoney(playerid, -5000);
GivePlayerWeapon(playerid, 32, 20);
SendClientMessage(playerid, COLOR_RED, "Guns'n'Drugs: You have bought a sniper ammo package.");
return 1;
}
CMD:enter(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 2, 2445.4182,-1758.6792,13.5924)) return SendClientMessage(playerid, COLOR_GREY, "You are not near the Guns'n'Drugs house.");
SetPlayerPos(playerid, 2262.7461,-1582.6334,1493.6000);
SetPlayerInterior(playerid, 0);
return 1;
}
CMD:exit(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 2, 2262.7461,-1582.6334,1493.6000)) return SendClientMessage(playerid, COLOR_GREY, "You are not inside the Guns'n'Drugs house.");
SetPlayerPos(playerid, 2445.4182,-1758.6792,13.5924);
SetPlayerInterior(playerid, 0);
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == GUNS_DIALOG)
{
if(response)
{
switch(listitem)
{
case 0: // M4
{
if(GetPlayerMoney(playerid) < 7000) return SendClientMessage(playerid, COLOR_GREY, "Guns'n'Drugs: You don't have enough money to buy a M4. (7000$)");
GivePlayerMoney(playerid, -7000);
GivePlayerWeapon(playerid, 31, 500);
SendClientMessage(playerid, COLOR_RED, "Guns'n'Drugs: You have bought an M4.");
}
case 1: // Sniper
{
if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, COLOR_GREY, "Guns'n'Drugs: You don't have enough money to buy a Sniper. (10000$)");
GivePlayerMoney(playerid, -10000);
GivePlayerWeapon(playerid, 32, 10);
SendClientMessage(playerid, COLOR_RED, "Guns'n'Drugs: You have bought a Sniper Rifle.");
}
case 2: // SMG (MP5)
{
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, COLOR_GREY, "Guns'n'Drugs: You don't have enough money to buy a SMG. (5000$)");
GivePlayerMoney(playerid, -5000);
GivePlayerWeapon(playerid, 29, 400);
SendClientMessage(playerid, COLOR_RED, "Guns'n'Drugs: You have bought a SMG.");
}
}
}
}
else if(dialogid == DRUGS_DIALOG)
{
if(response)
{
switch(listitem)
{
case 0: // Weed
{
if(GetPlayerMoney(playerid) < 60) return SendClientMessage(playerid, COLOR_GREY, "Guns'n'Drugs: You don't have enough money to buy Weed. (60$)");
GivePlayerMoney(playerid, -60);
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, COLOR_RED, "Guns'n'Drugs: You have bought 5 Grams of weed. (100 Health refilled)");
}
case 1: // Cocaine
{
if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid, COLOR_GREY, "Guns'n'Drugs: You don't have enough money to buy Cocaine. (100$)");
GivePlayerMoney(playerid, -100);
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid, COLOR_RED, "Guns'n'Drugs: You have bought 5 Grams of cocaine. (100 Armor refilled)");
}
}
}
}
return 1;
}
P.S. Скрипт на английском языке