Raised This Month: $ Target: $400
 0% 

Need code For plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
asdfdsdf
AlliedModders Donor
Join Date: Aug 2010
Location: Belgium
Old 09-01-2013 , 17:20   Need code For plugin
Reply With Quote #1

HEllo i need someone that can help me adding in this code its from a jailbreakshop so they only can gamble 5time per 10min because otherwise it gets spammed if someone can help me grtz heres the code

PHP Code:
public handle_gamble(id) {
    static 
arg[10];
    
read_argv(1argcharsmax(arg));
    
    if( !
strlen(arg) || str_to_num(arg) < 200 
    {
        
client_print(idprint_console"%s That amount wont work, min. 200$"TAG)
        return 
PLUGIN_HANDLED
    
}
    new 
Num str_to_num(arg)
    if(
g_Cash[id] < Num) {
        
client_print(idprint_console"%s Sorry You dont have that amount of jbcash"TAG)
        return 
PLUGIN_HANDLED
    
}
    
    
/* Start the game */
    
JbShop_GameRTD(idNum)
    return 
PLUGIN_HANDLED;
}
public 
JbShop_GameRTD(idcash)
{
    if(
is_user_connected(id))
    {
        new 
Number random_num(1100
        
        new 
strName[32]
        
get_user_name(idstrName31)
        
        if(
Number <= 35)
        {
            
client_print(idprint_console"%s You won %i$."TAGcash)
            
            if(
cash >= 15000)
            {
                
ColorChat(0GREY"^4%s^3 %s^1 gamble^3 %i^1 and won."TAGstrNamecash)
            }
            
            
g_Cash[id] += cash;
            
        }
        else
        {
            
client_print(idprint_console"%s You lost %i$."TAGcash)
            
            if(
cash >= 15000)
            {
                
ColorChat(0GREY"^4%s^3 %s^1 gamble^3 %i^1 and lost."TAGstrNamecash)
            }
            
            
g_Cash[id] -= cash;
        }
        
Save(id)
    }

asdfdsdf is offline
 


Thread Tools
Display Modes

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 19:11.


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