Gameplay Addons
-
Raheem
- Mod Developer


- Posts: 1972
- Joined: 2 Years Ago
- Location: Egypt
-
Has thanked:
32 times
-
Been thanked:
108 times
- Age: 22
-
Contact:
#1
Post
by Raheem » 10 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:
/*
* A gamble system, just for FUN - RAHEEM
*/
#include <zombie_escape>
#define MINIMUM_VALUE 250 // Minimum Escape Coins to be gambled
new g_szCommand[] = "gamble" // Change cmd if needed
public plugin_init()
{
register_plugin("Gamble System", "1.0", "Raheem")
register_clcmd("say", "SayHandler");
register_clcmd("say_team", "SayHandler")
}
public SayHandler(id)
{
new szMessage[192]
read_args(szMessage, charsmax(szMessage))
remove_quotes(szMessage) // Important to remove quotes, so parse function works correctly
new szCommand[32], szValue[32]
parse(szMessage, szCommand, charsmax(szCommand), szValue, charsmax(szValue)) //Split the string
if (!equali(g_szCommand, szCommand))
return PLUGIN_CONTINUE;
new iValue = str_to_num(szValue)
if ((ze_get_escape_coins(id) < iValue) && (iValue >= MINIMUM_VALUE))
{
client_print_color(id, print_team_default, "^1[^4Gamble-System^1] ^3You have no enough escape coins^1!")
return PLUGIN_CONTINUE
}
if (iValue < MINIMUM_VALUE)
{
client_print_color(id, print_team_default, "^1[^4Gamble-System^1] ^3Minimum value to gamble is ^4%i ^3EC^1.", MINIMUM_VALUE)
return PLUGIN_CONTINUE
}
new iRandomNum = random_num(1, 100) // 50% lose, 50% win
if (iRandomNum >= 1 && iRandomNum < 50)
{
// WIN
client_print_color(id, print_team_default, "^1[^4Gamble-System^1] ^3You WON ^1!")
ze_set_escape_coins(id, ze_get_escape_coins(id) + iValue)
}
else
{
// LOSE
client_print_color(id, print_team_default, "^1[^4Gamble-System^1] ^3You LOST ^1!")
ze_set_escape_coins(id, ze_get_escape_coins(id) - iValue)
}
return PLUGIN_CONTINUE
}
You don't know? Learn and you will know.
-
Muhammet20
- Veteran Member


- Posts: 408
- Joined: 1 Year Ago
- Location: Turkey
-
Has thanked:
36 times
-
Been thanked:
5 times
- Age: 15
-
Contact:
#2
Post
by Muhammet20 » 5 Months Ago
Raheem wrote: ↑10 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:
/*
* A gamble system, just for FUN - RAHEEM
*/
#include <zombie_escape>
#define MINIMUM_VALUE 250 // Minimum Escape Coins to be gambled
new g_szCommand[] = "gamble" // Change cmd if needed
public plugin_init()
{
register_plugin("Gamble System", "1.0", "Raheem")
register_clcmd("say", "SayHandler");
register_clcmd("say_team", "SayHandler")
}
public SayHandler(id)
{
new szMessage[192]
read_args(szMessage, charsmax(szMessage))
remove_quotes(szMessage) // Important to remove quotes, so parse function works correctly
new szCommand[32], szValue[32]
parse(szMessage, szCommand, charsmax(szCommand), szValue, charsmax(szValue)) //Split the string
if (!equali(g_szCommand, szCommand))
return PLUGIN_CONTINUE;
new iValue = str_to_num(szValue)
if ((ze_get_escape_coins(id) < iValue) && (iValue >= MINIMUM_VALUE))
{
client_print_color(id, print_team_default, "^1[^4Gamble-System^1] ^3You have no enough escape coins^1!")
return PLUGIN_CONTINUE
}
if (iValue < MINIMUM_VALUE)
{
client_print_color(id, print_team_default, "^1[^4Gamble-System^1] ^3Minimum value to gamble is ^4%i ^3EC^1.", MINIMUM_VALUE)
return PLUGIN_CONTINUE
}
new iRandomNum = random_num(1, 100) // 50% lose, 50% win
if (iRandomNum >= 1 && iRandomNum < 50)
{
// WIN
client_print_color(id, print_team_default, "^1[^4Gamble-System^1] ^3You WON ^1!")
ze_set_escape_coins(id, ze_get_escape_coins(id) + iValue)
}
else
{
// LOSE
client_print_color(id, print_team_default, "^1[^4Gamble-System^1] ^3You LOST ^1!")
ze_set_escape_coins(id, ze_get_escape_coins(id) - iValue)
}
return PLUGIN_CONTINUE
}
Nice but i dont love it
[ Post made via Android ]
[Learning HTML coding language]
[Learning Unreal Engine 4]
[Learning Adobe programs]
-
Raheem
- Mod Developer


- Posts: 1972
- Joined: 2 Years Ago
- Location: Egypt
-
Has thanked:
32 times
-
Been thanked:
108 times
- Age: 22
-
Contact:
#3
Post
by Raheem » 5 Months Ago
Why

You don't know? Learn and you will know.
-
Muhammet20
- Veteran Member


- Posts: 408
- Joined: 1 Year Ago
- Location: Turkey
-
Has thanked:
36 times
-
Been thanked:
5 times
- Age: 15
-
Contact:
#4
Post
by Muhammet20 » 5 Months Ago
IDK

[Learning HTML coding language]
[Learning Unreal Engine 4]
[Learning Adobe programs]
Users browsing this forum: No registered users and 2 guests