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(1, arg, charsmax(arg));
if( !strlen(arg) || str_to_num(arg) < 200 )
{
client_print(id, print_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(id, print_console, "%s Sorry You dont have that amount of jbcash", TAG)
return PLUGIN_HANDLED
}
/* Start the game */
JbShop_GameRTD(id, Num)
return PLUGIN_HANDLED;
}
public JbShop_GameRTD(id, cash)
{
if(is_user_connected(id))
{
new Number = random_num(1, 100)
new strName[32]
get_user_name(id, strName, 31)
if(Number <= 35)
{
client_print(id, print_console, "%s You won %i$.", TAG, cash)
if(cash >= 15000)
{
ColorChat(0, GREY, "^4%s^3 %s^1 gamble^3 %i^1 and won.", TAG, strName, cash)
}
g_Cash[id] += cash;
}
else
{
client_print(id, print_console, "%s You lost %i$.", TAG, cash)
if(cash >= 15000)
{
ColorChat(0, GREY, "^4%s^3 %s^1 gamble^3 %i^1 and lost.", TAG, strName, cash)
}
g_Cash[id] -= cash;
}
Save(id)
}
}