Hp Shop
Moderatör: Moderatörler
-
Konu Sahibi - Mesajlar: 28
- Kayıt: Sal Mar 03, 2020 3:15 pm
Hp Shop
Merhaba Arkadaslar Hp Shop Calısan Bulamadım Varmı Elinde Olan Veyatta Yapabilecek Calısan Hp Shop Dolar Karsiligi
Link: | |
Linklerini gizle |
-
- Mesajlar: 4518
- Kayıt: Cum Ara 16, 2016 2:14 pm
- Konum: İzmir
-
- Mesajlar: 4518
- Kayıt: Cum Ara 16, 2016 2:14 pm
- Konum: İzmir
Hp Shop
Kod: Tümünü seç
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#define PLUGIN "HP Shop"
#define VERSION "1.0"
#define AUTHOR "Gudik"
new money
new health
new cost100 = 8000
new cost50 = 5000
new cost10 = 1500
new HPSHOP
public plugin_init() {
register_plugin("HP Shop", "1.1", "Gudik");
register_clcmd ("say /HPShop", "HP_menu");
register_cvar ("amx_HPShop", "1");
register_event("HLTV", "event_round_start", "a", "1=0", "2=0");
}
public HP_menu (id) {
HPSHOP = get_cvar_num("amx_HPShop");
if (HPSHOP = 1) {
new menu = menu_create ("HP Shop", "menu_hp");
menu_additem (menu, "100 Health - 8000$", "2", 0);
menu_additem (menu, "50 Health - 5000$", "3", 0);
menu_additem (menu, "10 Health - 1500$" , "4", 0);
menu_setprop (menu, MPROP_EXIT, MEXIT_ALL);
menu_display (id, menu, 0)
}
}
public menu_hp (id, menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy (menu)
return PLUGIN_HANDLED
}
new data [6], iname [64]
new access, callback
menu_item_getinfo (menu, item, access, data, 5, iname, 63, callback)
new key = str_to_num (data)
switch (key)
{
case 1: {
money = cs_get_user_money(id);
health = get_user_health(id);
if (is_user_alive(id)) {
client_print(id, print_chat, "[HP Shop] - You are not dead!");
}
else {
if (money == 16000) {
spawn(id)
set_user_health(id, 100);
client_print(id, print_chat, "[HP Shop] - You just bought yourself to life!");
cs_set_user_money(id, 0);
}
else
{
client_print(id, print_chat, "[HP Shop] - You dont have enough money!");
}
}
}
case 2: {
money = cs_get_user_money(id);
health = get_user_health(id);
if (money <= cost100) {
client_print(id, print_chat, "[HP Shop] - You don't have enough money!");
}
else {
if (is_user_alive(id)) {
set_user_health(id, health +100);
client_print(id, print_chat, "[HP Shop] - You just bought 100 health!");
cs_set_user_money(id, money - cost100);
}
}
}
case 3: {
money = cs_get_user_money(id);
health = get_user_health(id);
if (money <= cost50) {
client_print(id, print_chat, "[HP Shop] - You don't have enough money!");
}
else {
if (is_user_alive(id)) {
set_user_health(id, health +50);
client_print(id, print_chat, "[HP Shop] - You just bought 50 health!");
cs_set_user_money(id, money - cost50);
}
}
}
case 4: {
money = cs_get_user_money(id);
health = get_user_health(id);
if (money <= cost10) {
client_print(id, print_chat, "[HP Shop] - You don't have enough money!");
}
else {
if (is_user_alive(id)) {
set_user_health(id, health +10);
client_print(id, print_chat, "[HP Shop] - You just bought 10 health!");
cs_set_user_money(id, money - cost10);
}
}
}
}
return PLUGIN_HANDLED
}
public event_round_start(id) {
HPSHOP = get_cvar_num("amx_HPShop");
if(HPSHOP = 1) {
client_print(id, print_chat, "This Server is running HP Shop, Type /Hpshop to buy health.");
}
}
Link: | |
Linklerini gizle |