PHP код:
if(PRESSED(KEY_CTRL_BACK))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, -2908.8135, 497.3521, 5.2000))
{
ShowPlayerDialog(playerid, 34, DIALOG_STYLE_TABLIST_HEADERS, "Shop",
"Item\tPrice\n\
Medkit\t$2000\n\
Medic Pack\t$3000\n\
Ammokit\t$6500\n\
Ammo Pack\t$2500\n\
Smoke\t$500(each)\n\
Reinforced Kevlar\t$12500\n\
Laser\t$5000\n\
Silencer\t$2500",
"Buy","");
}
}
if(HOLDING(KEY_WALK))
{
if(IsPlayerInRangeOfPoint(playerid, 1.5, 276.7643, 4050.3779, 28.5322))
{
if(HUnderBomb[CASTLE] == 0 && gTeam[playerid] == TEAM_DEFENDERS) return SendClientMessage(playerid, COLOR_RED, "There is no bomb planted yet!");
if(HBombed[CASTLE] == 1 && gTeam[playerid] == TEAM_ATTACKERS) return SendClientMessage(playerid, COLOR_RED, "This area has already been bombed by someone!");
if(HUnderBomb[CASTLE] == 1 && gTeam[playerid] == TEAM_ATTACKERS) return SendClientMessage(playerid, COLOR_RED, "The area is already underbomb!");
if(IsPlayerInAnyVehicle(playerid) && gTeam[playerid] == TEAM_DEFENDERS) return SendClientMessage(playerid, COLOR_RED, "You can not defuse the bomb while you are in a vehicle");
if(IsPlayerInAnyVehicle(playerid) && gTeam[playerid] == TEAM_ATTACKERS) return SendClientMessage(playerid, COLOR_RED, "You can not plant a bomb while you are in a vehicle!");
if(gTeam[playerid] == TEAM_ATTACKERS && HBombed[CASTLE] == 0)
{
HIsPlayerBombing[playerid][CASTLE] = 1;
HBombed[CASTLE] = 0;
HUnderBomb[CASTLE] = 0;
SendClientMessage(playerid, COLOR_LIGHTERBLUE, "Planting...");
Timer[castle1] = SetTimerEx("castlebomb", 1000, false, "i", playerid);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
}
if(gTeam[playerid] == TEAM_DEFENDERS && HUnderBomb[CASTLE] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTERBLUE, "Defusing...");
HIsPlayerBombing[playerid][CASTLE] = 1;
HUnderBomb[playerid] = 1;
Timer[castled1] = SetTimerEx("castledefusebomb", 1000, false, "i", playerid);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
}
}
}