Skip to content

Commit 67fadba

Browse files
authored
Add files via upload
1 parent 22c166a commit 67fadba

1 file changed

Lines changed: 170 additions & 0 deletions

File tree

menufl.pwn

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
#define FILTERSCRIPT
2+
#include <a_samp>
3+
#include <zcmd>
4+
#include <menu-floating>
5+
6+
enum
7+
{
8+
MENU_FLOATING_HOSPITAL,
9+
MENU_FLOATING_TELEPORTES,
10+
MENU_FLOATING_WEAPONS,
11+
}
12+
13+
CMD:hospital(playerid)
14+
{
15+
static const items[][] =
16+
{
17+
"Atencion",
18+
"Ver historial ~p~nuevo!"
19+
};
20+
ShowMenuFloatingForPlayer(playerid, MENU_FLOATING_HOSPITAL, "Hospital", 0xDA2B2BFF, items);
21+
return 1;
22+
}
23+
24+
CMD:teleportes(playerid)
25+
{
26+
static const items[][] =
27+
{
28+
"Los Santos",
29+
"San Fierro",
30+
"Las Venturas"
31+
};
32+
ShowMenuFloatingForPlayer(playerid, MENU_FLOATING_TELEPORTES, "Teleportes", 0x445750FF, items);
33+
return 1;
34+
}
35+
36+
37+
CMD:weapons(playerid)
38+
{
39+
static const items[][] =
40+
{
41+
"Tec-9",
42+
"Micro Uzi",
43+
"M4A1_____________~g~~h~~h~100$",
44+
"MP5______________~g~~h~~h~350$",
45+
"Desert Eagle"
46+
};
47+
ShowMenuFloatingForPlayer(playerid, MENU_FLOATING_WEAPONS, "Weapons", 0xDA2B2BFF, items);
48+
return 1;
49+
}
50+
51+
52+
public OnPlayerMenuFloatingResponse(playerid, extraid, bool:response, listitem)
53+
{
54+
/*new string[128];
55+
format(string, sizeof string, "[DEBUG] extraid = %i, response = %s, listitem = %i", extraid, response ? ("true") : ("false"), listitem);
56+
SendClientMessage(playerid, 0xCDCDCDFF, string);*/
57+
58+
switch (extraid)
59+
{
60+
//--------------------------------------------------------------------//
61+
case MENU_FLOATING_HOSPITAL:
62+
{
63+
if (!response)
64+
return 0;
65+
66+
switch (listitem)
67+
{
68+
case 0: SendClientMessage(playerid, -1, "* Atencion");
69+
case 1: SendClientMessage(playerid, -1, "* Historial");
70+
}
71+
}
72+
//--------------------------------------------------------------------//
73+
case MENU_FLOATING_TELEPORTES:
74+
{
75+
if (!response)
76+
return 0;
77+
78+
HideMenuFloatingForPlayer(playerid);
79+
80+
switch (listitem)
81+
{
82+
case 0:
83+
{
84+
SetPlayerPos(playerid, 1547.2209, -1681.7416, 13.5588);
85+
SetPlayerFacingAngle(playerid, 90.0);
86+
}
87+
case 1:
88+
{
89+
SetPlayerPos(playerid, -1583.6185, 809.6888, 6.8203);
90+
SetPlayerFacingAngle(playerid, 270.0);
91+
}
92+
case 2:
93+
{
94+
SetPlayerPos(playerid, 1592.3444, 1817.8513, 10.8203);
95+
SetPlayerFacingAngle(playerid, 360.0);
96+
}
97+
}
98+
99+
SetPlayerInterior(playerid, 0);
100+
SetPlayerVirtualWorld(playerid, 0);
101+
}
102+
//--------------------------------------------------------------------//
103+
case MENU_FLOATING_WEAPONS:
104+
{
105+
if (!response)
106+
return 0;
107+
108+
HideMenuFloatingForPlayer(playerid);
109+
110+
switch (listitem)
111+
{
112+
case 0: // Tec-9 - gratis
113+
{
114+
GivePlayerWeapon(playerid, 32, 164);
115+
SendClientMessage(playerid, -1, "* Has obtenido una Tec-9 Gratis!");
116+
}
117+
case 1: // Micro Uzi - gratis
118+
{
119+
GivePlayerWeapon(playerid, 28, 1000);
120+
SendClientMessage(playerid, -1, "* Has obtenido una Micro Uzi Gratis!");
121+
}
122+
case 2: // M4A1 - 100$
123+
{
124+
new precio = 100;
125+
new dinero = GetPlayerMoney(playerid);
126+
127+
if (dinero >= precio)
128+
{
129+
GivePlayerWeapon(playerid, 31, 500); // M4A1
130+
GivePlayerMoney(playerid, -precio);
131+
SendClientMessage(playerid, -1, "* Has comprado un M4A1 por 100$");
132+
}
133+
else
134+
{
135+
new faltante = precio - dinero;
136+
new msg[64];
137+
format(msg, sizeof msg, "* Te falta %d$ para comprar el M4A1", faltante);
138+
SendClientMessage(playerid, 0xFF0000FF, msg);
139+
}
140+
}
141+
case 3: // MP5 - 350$
142+
{
143+
new precio = 350;
144+
new dinero = GetPlayerMoney(playerid);
145+
146+
if (dinero >= precio)
147+
{
148+
GivePlayerWeapon(playerid, 29, 500); // MP5
149+
GivePlayerMoney(playerid, -precio);
150+
SendClientMessage(playerid, -1, "* Has comprado un MP5 por 350$");
151+
}
152+
else
153+
{
154+
new faltante = precio - dinero;
155+
new msg[64];
156+
format(msg, sizeof msg, "* Te falta %d$ para comprar el MP5", faltante);
157+
SendClientMessage(playerid, 0xFF0000FF, msg);
158+
}
159+
}
160+
case 4: // Desert Eagle - gratis
161+
{
162+
GivePlayerWeapon(playerid, 24, 1000);
163+
SendClientMessage(playerid, -1, "* Has obtenido una Desert Eagle Gratis!");
164+
}
165+
}
166+
}
167+
//--------------------------------------------------------------------//
168+
}
169+
return 1;
170+
}

0 commit comments

Comments
 (0)