#include <amxmodx>
#include <cstrike>
public plugin_init() {
register_plugin
("Naber",
"1.0",
"Berk");
register_clcmd("amx_paradenge","beParaDengele")
}
public beParaDengele(bmID) {
new menuz;
menuz = menu_create("\d{\wParaDestek\d} \r# \yTakim Secin","beParaDengele_devam");
menu_additem(menuz,"\yTerrorist","1");
menu_additem(menuz,"\yCounter-Terrorist","2");
menu_setprop(menuz,MPROP_EXITNAME,"\rCikis");
menu_setprop(menuz,MPROP_EXIT,MEXIT_ALL);
menu_display(bmID,menuz,0);
}
public beParaDengele_devam(bmID,bmMenu,bmItem){
if(bmItem == MENU_EXIT){
menu_destroy(bmMenu);
return PLUGIN_HANDLED;
}
new access,callback,data[6],iname[64];
menu_item_getinfo(bmMenu,bmItem,access,data,5,iname,63,callback);
new key = str_to_num(data);
new bmOyuncular[32],bmSayi,bmI;
switch(key){
case 1 : {
get_players(bmOyuncular,bmSayi,"ae","TERRORIST")
for(new i; i < bmSayi; i++){
bmI = bmOyuncular[i];
cs_set_user_money(bmI,cs_get_user_money(bmI)+5000);
for(new j; j < 3; j++){
renkli_yazi(bmI,"!n[ !tTakimDengeleme !n] !gTakimlarin esitlenmesi icin takiminiza !n[!t5000$!n] !gVerildi!n.")
}
}
}
case 2 : {
get_players(bmOyuncular,bmSayi,"ae","CT")
for(new i; i < bmSayi; i++){
bmI = bmOyuncular[i];
cs_set_user_money(bmI,cs_get_user_money(bmI)+5000);
for(new j; j < 3; j++){
renkli_yazi(bmI,"!n[ !tTakimDengeleme !n] !gTakimlarin esitlenmesi icin takiminiza !n[!t5000$!n] !gVerildi!n.")
}
}
}
}
menu_destroy(bmMenu);
return PLUGIN_HANDLED;
}
stock renkli_yazi(const id, const input[], any:...){
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "!n", "^x01"); // Default Renk(Sarı)
replace_all(msg, 190, "!g", "^x04"); // Yeşil Renk
replace_all(msg, 190, "!t", "^x03"); // Takım Renk( CT mavi , T kırmızı )
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();
}
}
}
}