Raised This Month: $51 Target: $400
 12% 

[FIXED]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Suntox
Member
Join Date: Nov 2016
Old 06-03-2017 , 18:03   [FIXED]
Reply With Quote #1

FIXED

Last edited by Suntox; 06-22-2017 at 14:39.
Suntox is offline
Suntox
Member
Join Date: Nov 2016
Old 06-04-2017 , 09:07   Re: [REQ]gamble
Reply With Quote #2

Anyone ?
Suntox is offline
Houssam Benmouna
Senior Member
Join Date: Apr 2016
Old 06-04-2017 , 09:15   Re: [REQ]gamble
Reply With Quote #3

Hhhhh Wait...
Houssam Benmouna is offline
Houssam Benmouna
Senior Member
Join Date: Apr 2016
Old 06-04-2017 , 09:44   Re: [REQ]gamble
Reply With Quote #4

Hhhhhh Sorry I Created the plugin but it's so full of bugs
Houssam Benmouna is offline
Suntox
Member
Join Date: Nov 2016
Old 06-04-2017 , 10:01   Re: [REQ]gamble
Reply With Quote #5

lol okay
Suntox is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 06-04-2017 , 11:36   Re: [REQ]gamble
Reply With Quote #6

Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_concmd("gamble", "CmdGamble", _, "usage: gamble <cash>")
    register_clcmd("say /gamble", "CmdGamble")
    register_clcmd("say /gambleall", "CmdGambleAll")
    register_clcmd("say /allin", "CmdGambleAll")
}

public CmdGamble(id) {
    new cash = cs_get_user_money(id)
    new szName[32]; get_user_name(id, szName, charsmax(szName))
    
    if(cash < 300) {
        console_print(id, "|AMXX| You need at least 300$ to gamble.")
        client_print(id, print_chat, "|AMXX| You need at least 300$ to gamble.")
        return PLUGIN_HANDLED
    }
    
    else {
        new argv[35], gamblecash
        read_argv(1, argv, charsmax(argv))
        
        if(!argv[0]) {
            client_print(id, print_chat, "|AMXX| /gamble <ammount>")
            return PLUGIN_HANDLED
        }
        else {
            
            gamblecash = str_to_num(argv)
        
            if(gamblecash < 300) {
                console_print(id, "|AMXX| You need to gamble at least 300$")
                client_print(id, print_chat, "|AMXX| You need to gamble at least 300$.")
                return PLUGIN_HANDLED
            }
        
            if(cash < gamblecash) {
                console_print(id, "|AMXX| You only have %i$", cash)
                client_print(id, print_chat, "|AMXX| You only have %i$", cash)
                return PLUGIN_HANDLED
            }
        
            new dice = random_num(1, 100)
            new woncash = gamblecash * 2
        
            if(dice > 52) {
                cs_set_user_money(id, cash += gamblecash)
                console_print(id, "|AMXX| Congratulations, you won a total of %i$", gamblecash)
                console_print(id, "|AMXX| You now have a total of %i$", cash)
                client_print(0, print_chat, "|AMXX| %s gambled %i$ and WON a total of %i$.", szName, gamblecash, woncash)
                return PLUGIN_HANDLED
            }
        
            else if(dice < 48) {
                cs_set_user_money(id, cash -= gamblecash)
                console_print(id, "|AMXX| Oh no... You lost %i cash", gamblecash)
                console_print(id, "|AMXX| You now have a total of %i", cash)
                client_print(0, print_chat, "|AMXX| %s gambled %i$ and LOST it.", szName, gamblecash)
                return PLUGIN_HANDLED
            }
        }
    }
    return PLUGIN_HANDLED
}

public CmdGambleAll(id) {
    new cash = cs_get_user_money(id)
    
    if(cash < 300) {
        console_print(id, "[GAMBLE] You need at least 300 cash to gamble.")
        return PLUGIN_HANDLED
    }
    
    else {
        new dice = random_num(1, 100)
        
        if(dice > 52) {
            cs_set_user_money(id, cash += cash)
            client_print(id, print_chat, "[GAMBLE] Congratulations, you doubled your money")
        }
        
        else if(dice < 48) {
            cs_set_user_money(id, cash -= cash)
            client_print(id, print_chat, "[GAMBLE] Oh no... You lost all your cash.")
        }
    }
    return PLUGIN_HANDLED
}
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Suntox
Member
Join Date: Nov 2016
Old 06-04-2017 , 11:57   Re: [REQ]gamble
Reply With Quote #7

i want for points not for money
check plugin
Suntox is offline
Houssam Benmouna
Senior Member
Join Date: Apr 2016
Old 06-04-2017 , 14:57   Re: [REQ]gamble
Reply With Quote #8

Suntox I am not really a pawn programmer but :/ here you go the plugins is so full of bugs and i don't know how i must create it

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>

native native_gamble(id)

public 
plugin_init()
{
    
// register plugin
    
register_plugin("Gamble-With-DrPts""0.1""Neo*")
    
    
// register clcmd
    
register_clcmd("say /gamble 5""command"// add any points here like 5
    
}

public 
command()
{
    new 
native_gamble(id)
    
    if( 
native_gamble(id) >= )
    {
        switch( 
random_num0) )
        {
            case 
0,1,4,6:
            {
                (
idnative_gamble(id), (id) + p))
                
            }
            
            case 
2,3,5,7,8,9:
            { 
                (
idnative_gamble(id), (id) - p))
            }
        }
        return 
PLUGIN_HANDLED;
    }
    
client_printidprint_chat"You Don't Have That Price Of PTS" );
    return 
PLUGIN_HANDLED;

Houssam Benmouna is offline
Suntox
Member
Join Date: Nov 2016
Old 06-04-2017 , 15:33   Re: [REQ]gamble
Reply With Quote #9

anyways thanks :d

Last edited by Suntox; 06-04-2017 at 20:05.
Suntox is offline
Houssam Benmouna
Senior Member
Join Date: Apr 2016
Old 06-04-2017 , 16:08   Re: [REQ]gamble
Reply With Quote #10

Hhhhhhhh that's noting, because the plugin is full of bugs and doesn't working
Houssam Benmouna 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 08:53.


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