Raised This Month: $ Target: $400
 0% 

Help with a Bet Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xeloxded
Member
Join Date: Dec 2016
Old 02-04-2017 , 11:20   Help with a Bet Plugin
Reply With Quote #1

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(PLUGINVERSIONAUTHOR)
    
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(menuMPROP_EXITNAME"Close")
    
menu_display(idmenu0)
    return 
PLUGIN_HANDLED
}
public 
handler_apostar(idmenuitem){
    if(
item == MENU_EXIT) return PLUGIN_HANDLED
    
switch(item){
        case 
0:{
            if(
monety_gracza[id] < 2){
                
ColorChat(idGREEN"Not enough money")
                return 
PLUGIN_HANDLED
            
}
            
randonrandom_num(12)
            
ColorChat(idGREEN"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
(idGREEN"Congratz, you won 4 moneys")
                        return 
PLUGIN_HANDLED
                    
}
                    case 
2:{
                        
monety_gracza[id] += Pozo[id]
                        
Pozo[id] = 0
                        ColorChat
(idGREEN"Congratz, you won the BIG PRIZE")
                        return 
PLUGIN_HANDLED
                    
}
                }
            }
        }
        case 
1:{
            if(
monety_gracza[id] < 4){
                
ColorChat(idGREEN"Not enough money")
                return 
PLUGIN_HANDLED
            
}
            
randonrandom_num(12)
            
ColorChat(idGREEN"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
(idGREEN"Congratz, you won 4 Moneys")
                        return 
PLUGIN_HANDLED
                    
}
                    case 
2:{
                        
monety_gracza[id] += Pozo[id]
                        
Pozo[id] = 0
                        ColorChat
(idGREEN"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)
xeloxded is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:14.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode