Existing user? Sign in
Sign up
Games
Servers
Useful
User
Pass
2FA
[PLUGIN Cs1.6] Bet Menu
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins
Author
Message
1352
destroi112
[DEV]
Status: Offline
(since 12-03-2020 22:13)
Joined: 24 May 2014
Posts: 4042
,
Topics: 119
Location:
---------
Reputation:
515.9
Votes
: 118
Posted: 03-09-2016, 06:34:57
| Translate post to:
... (
Click for more languages
)
Descriere : Dupa ce mori iti apare automat un meniu de pariat unde poti alege una din 2 echipe si poti vedea cati au ales echipa x si y, pentru a nu alege fix inainte de a se termina runda am pus un timer dupa care meniul o sa dispara.
Autor: D3luxe
Download :
Spoiler:
#include <amxmodx>
#include <cstrike>
#define PLUGIN "BetMenu"
#define VERSION "1.2"
#define AUTHOR "D3luxe"
enum BET_TEAM
{
WIN_CT,
WIN_T
};
new const TeamName[2][] =
{
"Counter-Terorist",
"Terorist"
};
new g_winteam[33][BET_TEAM],count_votes[BET_TEAM],bool:g_once[33];
new time_cancel,cost,menu;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_event("HLTV", "reset_all", "a", "1=0", "2=0");
register_event( "SendAudio", "ev_TerroristWin", "a", "2&%!MRAD_terwin" );
register_event( "SendAudio", "ev_CtWin", "a", "2&%!MRAD_ctwin" );
time_cancel = register_cvar("voting_time","20");
cost = register_cvar("cost_participare","1000");
set_task(1.0,"search_player",_,_,_,"b");
}
public reset_all()
{
new Players[32],num,id;
get_players(Players,num,"b");
for(new i = 0; i < num; i++)
{
id = Players[id];
g_once[id] = false;
g_winteam[id][WIN_CT] = false;
g_winteam[id][WIN_T] = false
}
count_votes[WIN_CT] = 0;
count_votes[WIN_T] = 0;
}
public search_player()
{
new Players[32],num,id;
get_players(Players,num,"b");
for(new i = 0; i < num; i++)
{
id = Players[i];
if(!g_once[id] && get_user_team(id) == 1 || get_user_team(id) == 2 && !is_user_alive(id) && players_still_alive() >= 2)
set_task(1.0,"bet_menu",id);
}
}
public bet_menu(id)
{
if(is_user_alive(id) || players_still_alive() < 2 || g_once[id])
return PLUGIN_HANDLED;
g_once[id] = true;
set_task(get_pcvar_float(time_cancel),"cancel_this",id);
new Text[555 char];
formatex(Text,charsmax(Text),"\rBet Menu \w| \yCost Bet [ \r%d $ \y]",get_pcvar_num(cost));
menu = menu_create(Text, "bet_handler")
formatex(Text,charsmax(Text),"\rPariaza pe \w%s \y[ \r%d \y]",TeamName[0],count_votes[WIN_CT]);
menu_additem(menu, Text, "1")
formatex(Text,charsmax(Text),"\rPariaza pe \w%s \y[ \r%d \y]",TeamName[1],count_votes[WIN_T]);
menu_additem(menu, Text, "2")
menu_setprop( menu, MPROP_EXITNAME, "\rNu vreau sa pariez")
menu_display(id, menu);
return PLUGIN_HANDLED;
}
public bet_handler(id,item)
{
if(item == MENU_EXIT || is_user_alive(id) || players_still_alive() < 2 || g_once[id])
{
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:
{
count_votes[WIN_CT]++;
g_winteam[id][WIN_CT] = true;
cs_set_user_money(id,cs_get_user_money(id) - get_pcvar_num(cost));
set_hudmessage(0, 0, 255, -1.0, -1.0)
show_hudmessage(id, "Ai pariat pe echipa %s.",TeamName[0])
}
case 2:
{
count_votes[WIN_T]++;
g_winteam[id][WIN_T] = true;
cs_set_user_money(id,cs_get_user_money(id) - get_pcvar_num(cost));
set_hudmessage(0, 0, 255, -1.0, -1.0)
show_hudmessage(id, "Ai pariat pe echipa %s.",TeamName[1])
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public cancel_this(id)
{
menu_destroy(menu);
}
public ev_TerroristWin()
{
new Players[32],num,id;
get_players(Players,num,"b");
for(new i = 0; i < num; i++)
{
id = Players[i];
if(g_winteam[id][WIN_CT])
{
set_hudmessage(0, 0, 255, -1.0, -1.0)
show_hudmessage(id, "Ai pierdut pariul.")
}else if(g_winteam[id][WIN_T])
{
new winbet = (get_pcvar_num(cost) * count_votes[WIN_T]) - count_votes[WIN_CT]
cs_set_user_money(id,cs_get_user_money(id) + winbet);
set_hudmessage(0, 0, 255, -1.0, -1.0)
show_hudmessage(id, "Felicitari,ai castigat %d $ la pariu.",winbet)
}
}
}
public ev_CtWin(){
new Players[32],num,id;
get_players(Players,num,"b");
for(new i = 0; i < num; i++)
{
id = Players[i];
if(g_winteam[id][WIN_T])
{
set_hudmessage(0, 0, 255, -1.0, -1.0)
show_hudmessage(id, "Ai pierdut pariul.")
}else if(g_winteam[id][WIN_CT])
{
new winbet = (get_pcvar_num(cost) * count_votes[WIN_CT]) - count_votes[WIN_T]
cs_set_user_money(id,cs_get_user_money(id) + winbet);
set_hudmessage(0, 0, 255, -1.0, -1.0)
show_hudmessage(id, "Felicitari,ai castigat %d $ la pariu.",winbet)
}
}
}
stock players_still_alive()
{
new count;
new Player[32],num,id;
get_players(Player,num,"b");
for(new i = 0;i < num; i++)
{
id = Player[i];
if(!is_user_connected(id))
continue;
if(!is_user_alive(id))
continue;
count++;
}
return count;
}
Retired from Amxmodx
0
0
Back to top
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins
The time now is 10-01-2025, 20:54:35
Copyright info
Based on phpBB
ro
/
com
B
Login
I forgot my password
World of Warcraft
Login for more...
Download WoW 7.3.5
Misc
eSports
Achievements
Buy reputation with votes
Reputation trades
Forum rules
Ban list
Members list
User guide (FAQ)
World of Warcraft
View details