say menu ... to get in ... he is the first menu
public Showbuyitem(id) {
show_menu(id, Keysbuyitem, "\y [28WL] BuyMenu \w^n^n 1. Handgun^n 2. Shotgun^n 3. Sub-Machine Gun^n 4. Rifle^n 5. Machine Gun^n^n 6. Primary weapon ammo 1000^n 7. Secondary weapon ammo 600^n^n 8. Equipment^n^n 0. \yExit^n", -1, "buyitem") // Display menu
}
public Pressedbuyitem(id, key) {
/* Menu:
* [28WL] BuyMenu
*
* 1. Handgun
* 2. Shotgun
* 3. Sub-Machine Gun
* 4. Rifle
* 5. Machine Gun
*
* 6. Primary weapon ammo
* 7. Secondary weapon ammo
*
* 8. Equipment
*
* 0. Exit
*/
switch (key) {
case 0: { // 1
if(!is_user_alive(id))
{
client_print(id,print_chat,"Your not alive")
return PLUGIN_HANDLED
}
Showhandgun(id)
}
case 1: { // 2
if(!is_user_alive(id))
{
client_print(id,print_chat,"Your not alive")
return PLUGIN_HANDLED
}
Showshotgun(id)
}
case 2: { // 3
if(!is_user_alive(id))
{
client_print(id,print_chat,"Your not alive")
return PLUGIN_HANDLED
}
Showsubgun(id)
}
case 3: { // 4
if(!is_user_alive(id) )
{
client_print(id,print_chat,"Your not alive")
return PLUGIN_HANDLED
}
Showguns(id)
}
case 4: { // 5
if(!is_user_alive(id))
{
client_print(id,print_chat,"Your not alive")
return PLUGIN_HANDLED
}
Showmachinegun(id)
}
case 5: { // 6
if(!is_user_alive(id))
{
client_print(id,print_chat,"Your not alive")
return PLUGIN_HANDLED
}
if((cs_get_user_money(id) - 100) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
return PLUGIN_HANDLED
}
cs_set_user_money(id, cs_get_user_money(id) - 100)
Showbuyitem(id)
priammo(id)
}
case 6: { // 7
if(!is_user_alive(id))
{
client_print(id,print_chat,"Your not alive")
return PLUGIN_HANDLED
}
if((cs_get_user_money(id) - 100) < 0)
{
client_print(id,print_center,"[Buy Menu] Sorry you do not have enough money")
return PLUGIN_HANDLED
}
cs_set_user_money(id, cs_get_user_money(id) - 100)
Showbuyitem(id)
secammo(id)
}
case 7: { // 8
if(!is_user_alive(id))
{
client_print(id,print_chat,"Your not alive")
return PLUGIN_HANDLED
}
Showequipment(id)
}
case 9: { // 0
client_print(id,print_chat,"[BuyMenu] Type menu for this menu again.")
}
}
return PLUGIN_CONTINUE
}
|