https://ibb.co/QfZ7911
Код за потвърждение: Избери целия код
#include <amxmodx>
#include <amxmisc>
#include <zombieplague>
#include <dhudmessage>
#define PLUGIN "Get Ammo Packs"
#define VERSION "1.0"
#define AUTHOR "X3"
new bool:lotto[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /lotto", "freeap")
}
public freeap(id)
{
new ap = zp_get_user_ammo_packs(id)
if(lotto[id])
{
client_print_color(id, "!y[!gZP!y] !tYou have used your Chance!y. !tTry again next Map!y.")
}
else
{
new irandom = random_num(0,100)
new szName[32]
get_user_name(id, szName, charsmax(szName))
switch(irandom)
{
case 0 .. 10:
{
client_print_color(id, "!y[!gZP!y] !tBad Luck!y. !tYou win Nothing!y. !tTry Next Map!y.")
}
case 11 .. 20:
{
client_print_color(id, "!y[!gZP!y] You got !gone !yon the lotto and won !g20 AmmoPacks!")
zp_set_user_ammo_packs(id, ap + 20)
}
case 21 .. 30:
{
client_print_color(id, "!y[!gZP!y] You got !gtwo !yon the lotto and won !g75 AmmoPacks!")
zp_set_user_ammo_packs(id, ap + 75)
}
case 31 .. 40:
{
client_print_color(id, "!y[!gZP!y] You got !gthree !yon the lotto and won !g100 AmmoPacks!")
zp_set_user_ammo_packs(id, ap + 100)
}
case 41 .. 50:
{
client_print_color(id, "!y[!gZP!y] You got !gfour !yon the lotto and won !g135 AmmoPacks!")
zp_set_user_ammo_packs(id, ap + 135)
}
case 51 .. 60:
{
client_print_color(id, "!y[!gZP!y] You got !gfive !yon the lotto and won !g200 AmmoPacks!")
zp_set_user_ammo_packs(id, ap + 200)
}
case 61 .. 70:
{
client_print_color(id, "!y[!gZP!y] You got !gSIX !yon the lotto and won !g250 AmmoPacks!")
client_print_color(0, "!y[!gZP!y] !g%s has got SIX on lotto and he won !g250 AP! !tTry Your luck say /lotto",szName)
set_dhudmessage(255, 145, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0)
show_dhudmessage(id,"BRAVO! You won SIX^n+250 Ammo packs")
zp_set_user_ammo_packs(id, ap + 250)
}
case 71 .. 80:
{
client_print_color(id, "!y[!gZP!y] You got !gSEVEN !yon the lotto and won !g500 AmmoPacks!")
client_print_color(0, "!y[!gZP!y] !g%s has got SEVEN on lotto and he won !g500 AP! !tTry Your luck say /lotto",szName)
set_dhudmessage(255, 145, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0)
show_dhudmessage(id,"BRAVO! You won SEVEN^n+500 Ammo packs")
zp_set_user_ammo_packs(id, ap + 500)
}
case 81 .. 90:
{
client_print_color(id, "!y[!gZP!y] You got !gEIGHT !yon the lotto and won !g650 AmmoPacks!")
client_print_color(0, "!y[!gZP!y] !g%s has got EIGHT on lotto and he won !g500 AP! !tTry Your luck say /lotto",szName)
set_dhudmessage(255, 145, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0)
show_dhudmessage(id,"BRAVO! You won EIGHT^n+650 Ammo packs")
zp_set_user_ammo_packs(id, ap + 650)
}
case 91 .. 100:
{
client_print_color(id, "!y[!gZP!y] You got !gNINE !yon the lotto and won !g750 AmmoPacks!")
client_print_color(0, "!y[!gZP!y] !g%s has got NINE on lotto and he won !g750 AP! !tTry Your luck say /lotto",szName)
set_dhudmessage(255, 145, 0, -1.0, 0.7, 1, 0.0, 5.0, 1.0, 1.0)
show_dhudmessage(id,"BRAVO! You won NINE^n+750 Ammo packs")
zp_set_user_ammo_packs(id, ap + 750)
}
}
lotto[id] = true
}
}
stock client_print_color(const id, const input[], any:...)
{
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "!g", "^x04"); // Green Color
replace_all(msg, 190, "!y", "^x01"); // Default Color
replace_all(msg, 190, "!t", "^x03"); // Team Color
if (id) players[0] = id; else get_players(players, count, "ch");
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}