Approved Coins Gamble

Gameplay Addons
Post Reply
User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1958
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 21
Contact:

Coins Gamble

#1

Post by Raheem » 6 Months Ago

Coins Gamble

Description:
  • This plugin will allow players to gamble with their coins, example gamble 500 there is 50% you will win 500 or you will lose them. This plugin just for fun.
Commands:
  • say gamble "value" or say_team gamble "value" any player can gamble any amount he needs in chat, the value should be higher than MINIMUM_VALUE.
Code:
    1. /*
    2. *    A gamble system, just for FUN - RAHEEM
    3. */
    4.  
    5. #include <zombie_escape>
    6.  
    7. #define MINIMUM_VALUE 250 // Minimum Escape Coins to be gambled
    8.  
    9. new g_szCommand[] = "gamble" // Change cmd if needed
    10.  
    11. public plugin_init()
    12. {
    13.     register_plugin("Gamble System", "1.0", "Raheem")
    14.    
    15.     register_clcmd("say", "SayHandler");
    16.     register_clcmd("say_team", "SayHandler")
    17. }
    18.  
    19. public SayHandler(id)
    20. {
    21.     new szMessage[192]
    22.     read_args(szMessage, charsmax(szMessage))
    23.    
    24.     remove_quotes(szMessage) // Important to remove quotes, so parse function works correctly
    25.    
    26.     new szCommand[32], szValue[32]
    27.     parse(szMessage, szCommand, charsmax(szCommand), szValue, charsmax(szValue)) //Split the string
    28.    
    29.     if (!equali(g_szCommand, szCommand))
    30.         return PLUGIN_CONTINUE;
    31.    
    32.     new iValue = str_to_num(szValue)
    33.    
    34.     if ((ze_get_escape_coins(id) < iValue) && (iValue >= MINIMUM_VALUE))
    35.     {
    36.         client_print_color(id, print_team_default, "^1[^4Gamble-System^1] ^3You have no enough escape coins^1!")
    37.        
    38.         return PLUGIN_CONTINUE
    39.     }
    40.    
    41.     if (iValue < MINIMUM_VALUE)
    42.     {
    43.         client_print_color(id, print_team_default, "^1[^4Gamble-System^1] ^3Minimum value to gamble is ^4%i ^3EC^1.", MINIMUM_VALUE)
    44.        
    45.         return PLUGIN_CONTINUE
    46.     }
    47.    
    48.     new iRandomNum = random_num(1, 100) // 50% lose, 50% win
    49.    
    50.     if (iRandomNum >= 1 && iRandomNum < 50)
    51.     {
    52.         // WIN
    53.         client_print_color(id, print_team_default, "^1[^4Gamble-System^1] ^3You WON ^1!")
    54.         ze_set_escape_coins(id, ze_get_escape_coins(id) + iValue)
    55.     }
    56.     else
    57.     {
    58.         // LOSE
    59.         client_print_color(id, print_team_default, "^1[^4Gamble-System^1] ^3You LOST ^1!")
    60.         ze_set_escape_coins(id, ze_get_escape_coins(id) - iValue)
    61.     }
    62.    
    63.     return PLUGIN_CONTINUE
    64. }
You don't know? Learn and you will know.

User avatar
Muhammet20
Veteran Member
Veteran Member
Syria
Posts: 358
Joined: 11 Months Ago
Location: Turkey
Has thanked: 36 times
Been thanked: 5 times
Age: 13
Contact:

#2

Post by Muhammet20 » 1 Month Ago

Raheem wrote:
6 Months Ago
Coins Gamble

Description:
  • This plugin will allow players to gamble with their coins, example gamble 500 there is 50% you will win 500 or you will lose them. This plugin just for fun.
Commands:
  • say gamble "value" or say_team gamble "value" any player can gamble any amount he needs in chat, the value should be higher than MINIMUM_VALUE.
Code:
    1. /*
    2. *    A gamble system, just for FUN - RAHEEM
    3. */
    4.  
    5. #include <zombie_escape>
    6.  
    7. #define MINIMUM_VALUE 250 // Minimum Escape Coins to be gambled
    8.  
    9. new g_szCommand[] = "gamble" // Change cmd if needed
    10.  
    11. public plugin_init()
    12. {
    13.     register_plugin("Gamble System", "1.0", "Raheem")
    14.    
    15.     register_clcmd("say", "SayHandler");
    16.     register_clcmd("say_team", "SayHandler")
    17. }
    18.  
    19. public SayHandler(id)
    20. {
    21.     new szMessage[192]
    22.     read_args(szMessage, charsmax(szMessage))
    23.    
    24.     remove_quotes(szMessage) // Important to remove quotes, so parse function works correctly
    25.    
    26.     new szCommand[32], szValue[32]
    27.     parse(szMessage, szCommand, charsmax(szCommand), szValue, charsmax(szValue)) //Split the string
    28.    
    29.     if (!equali(g_szCommand, szCommand))
    30.         return PLUGIN_CONTINUE;
    31.    
    32.     new iValue = str_to_num(szValue)
    33.    
    34.     if ((ze_get_escape_coins(id) < iValue) && (iValue >= MINIMUM_VALUE))
    35.     {
    36.         client_print_color(id, print_team_default, "^1[^4Gamble-System^1] ^3You have no enough escape coins^1!")
    37.        
    38.         return PLUGIN_CONTINUE
    39.     }
    40.    
    41.     if (iValue < MINIMUM_VALUE)
    42.     {
    43.         client_print_color(id, print_team_default, "^1[^4Gamble-System^1] ^3Minimum value to gamble is ^4%i ^3EC^1.", MINIMUM_VALUE)
    44.        
    45.         return PLUGIN_CONTINUE
    46.     }
    47.    
    48.     new iRandomNum = random_num(1, 100) // 50% lose, 50% win
    49.    
    50.     if (iRandomNum >= 1 && iRandomNum < 50)
    51.     {
    52.         // WIN
    53.         client_print_color(id, print_team_default, "^1[^4Gamble-System^1] ^3You WON ^1!")
    54.         ze_set_escape_coins(id, ze_get_escape_coins(id) + iValue)
    55.     }
    56.     else
    57.     {
    58.         // LOSE
    59.         client_print_color(id, print_team_default, "^1[^4Gamble-System^1] ^3You LOST ^1!")
    60.         ze_set_escape_coins(id, ze_get_escape_coins(id) - iValue)
    61.     }
    62.    
    63.     return PLUGIN_CONTINUE
    64. }
Nice but i dont love it

[ Post made via Android ]
.::Kaya Gaming || Never Give Up || Zombie Escape::.
https://kaya-gaming.ga/index.php

I just believe in two things, First thing is who i see in the mirror, second thing is who i don't see in the sky.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1958
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 21
Contact:

#3

Post by Raheem » 1 Month Ago

Why :laughing:
You don't know? Learn and you will know.

User avatar
Muhammet20
Veteran Member
Veteran Member
Syria
Posts: 358
Joined: 11 Months Ago
Location: Turkey
Has thanked: 36 times
Been thanked: 5 times
Age: 13
Contact:

#4

Post by Muhammet20 » 1 Month Ago

Raheem wrote:
1 Month Ago
Why :laughing:
IDK :D
.::Kaya Gaming || Never Give Up || Zombie Escape::.
https://kaya-gaming.ga/index.php

I just believe in two things, First thing is who i see in the mirror, second thing is who i don't see in the sky.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests