Hi i have this plugin adapted to my Mod
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <ColorChat>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
new monety_gracza[33], Pozo[33], randon
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /bet", "menu_apostar")
}
public menu_apostar(id){
new menu = menu_create("\r[\y Bet Menu\r ]", "handler_apostar")
menu_additem(menu, "Bet 2 Moneys", "0", 0)
menu_additem(menu, "Bet 4 Moneys", "1", 0)
menu_setprop(menu, MPROP_EXITNAME, "Close")
menu_display(id, menu, 0)
return PLUGIN_HANDLED
}
public handler_apostar(id, menu, item){
if(item == MENU_EXIT) return PLUGIN_HANDLED
switch(item){
case 0:{
if(monety_gracza[id] < 2){
ColorChat(id, GREEN, "Not enough money")
return PLUGIN_HANDLED
}
randon= random_num(1, 2)
ColorChat(id, GREEN, "Sad, you lost your bet and was send into the betting pool")
Pozo[id] += 2
monety_gracza[id] -= 2
if(randon == 2){
monety_gracza[id] -= 2
switch(random_num(1,2)){
case 1:{
monety_gracza[id] += 4
ColorChat(id, GREEN, "Congratz, you won 4 moneys")
return PLUGIN_HANDLED
}
case 2:{
monety_gracza[id] += Pozo[id]
Pozo[id] = 0
ColorChat(id, GREEN, "Congratz, you won the BIG PRIZE")
return PLUGIN_HANDLED
}
}
}
}
case 1:{
if(monety_gracza[id] < 4){
ColorChat(id, GREEN, "Not enough money")
return PLUGIN_HANDLED
}
randon= random_num(1, 2)
ColorChat(id, GREEN, "Sad, you lost your bet and was send into the betting pool")
Pozo[id] += 4
monety_gracza[id] -= 4
if(randon == 2){
monety_gracza[id] -= 4
switch(random_num(1,2)){
case 1:{
monety_gracza[id] += 8
ColorChat(id, GREEN, "Congratz, you won 4 Moneys")
return PLUGIN_HANDLED
}
case 2:{
monety_gracza[id] += Pozo[id]
Pozo[id] = 0
ColorChat(id, GREEN, "Congratz, you won the BIG PRIZE!")
return PLUGIN_HANDLED
}
}
}
}
}
return PLUGIN_HANDLED
}
It doesnt work like intended, like Bet 4 then you won, but you won 4 again = No profit
Sometimes if you bet, you can lose and win at the same time.
And i need to know how to add a formatex or a HUD that show whats the current bet pool (Amount of coins lost between all players (BIG PRIZE = Lost moneys between all players that have bet and lost their currency)