PHP- Kodu:
/* pawN is - Game[R] */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#define PLUGIN "Yeni Plugin"
#define VERSION "1.0"
#define AUTHOR "Game[R]"
new SG
new HG
new FB
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /hnshop","Menu")
SG = register_cvar("sg_para","10000")
HG = register_cvar("hg_para","16000")
FB = register_cvar("fb_para","5000")
}
public Menu(id) {
if(get_user_team(id) != 1) {
return PLUGIN_HANDLED
}
if(!is_user_alive(id)) return PLUGIN_HANDLED
new menu = menu_create("\rHNS \d-= SHOP =-", "menu_handler")
menu_additem(menu, "\wHe Grenade [ 16000 $ ]", "1");
menu_additem(menu, "\wSmokeGrenade [ 10000 $ ]", "2");
menu_additem(menu, "\wFlashBang [ 5000 $ ]", "3");
menu_setprop(menu, MPROP_NEXTNAME, "\rIleri");
menu_setprop(menu, MPROP_BACKNAME, "\rGeri");
menu_setprop(menu, MPROP_EXITNAME, "\yMenuyu Kapat");
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
return PLUGIN_HANDLED;
}
public menu_handler(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);
new nick[32]
get_user_name(id,nick,31)
switch(key)
{
case 1: {
if(cs_get_user_money(id) < get_pcvar_num(HG)) {
chat_color(id,"!gHeGrenade !yAlmak Icin Yeterli !tParan YOK! !gGereken Para: !t16000 $")
return PLUGIN_HANDLED
}
cs_set_user_money(id,cs_get_user_money(id) - get_pcvar_num(HG))
give_item(id,"weapon_hegrenade")
chat_color(id,"!t 16000 $ Verdin Ve !gHe Grenade !yAldin.")
return PLUGIN_HANDLED
}
case 2: {
if(cs_get_user_money(id) < get_pcvar_num(SG)) {
chat_color(id,"!gSmokeGrenade !yAlmak Icin Yeterli !tParan YOK! !gGereken Para: !t10000 $")
return PLUGIN_HANDLED
}
cs_set_user_money(id,cs_get_user_money(id) - get_pcvar_num(SG))
give_item(id,"weapon_smokegrenade")
chat_color(id,"!t 10000 $ Verdin Ve !gSmoke Grenade !yAldin.")
return PLUGIN_HANDLED
}
case 3: {
if(cs_get_user_money(id) < get_pcvar_num(FB)) {
chat_color(id,"!gFlashBang !yAlmak Icin Yeterli !tParan YOK! !gGereken Para: !t5000 $")
return PLUGIN_HANDLED
}
cs_set_user_money(id,cs_get_user_money(id) - get_pcvar_num(FB))
give_item(id,"weapon_flashbang")
give_item(id,"weapon_flashbang")
chat_color(id,"!t 5000 $ Verdin Ve !gFlashBang !yAldin.")
}
}
return PLUGIN_HANDLED
}
public client_connect(id)
{
client_cmd(id,"bind r ^"+reload;say /hnshop^"")
}
//----------------------------------- Renkli Yazi --------------------------------//
stock chat_color(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!t", "^3")
replace_all(msg, 190, "!team2", "^0")
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}