Oto kod:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#define PLUGIN "Kupon"
#define VERSION "1.0"
#define AUTHOR "Koksik"
new plugin_on
new gravity_on
new speed_on
new noclip_on
new elite_on
new health_on
new kill_on
new money_on
new price
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_clcmd("say /kupon", "kupon");
plugin_on = register_cvar("amx_kupon_plugin", "1") ;
price = register_cvar("amx_kupon_price", "400") ;
gravity_on = register_cvar("amx_gravity_on", "1") ;
speed_on = register_cvar("amx_speed_on", "1") ;
noclip_on = register_cvar("amx_noclip_on", "1") ;
elite_on = register_cvar("amx_elite_on", "1") ;
health_on = register_cvar("amx_health_on", "1") ;
kill_on = register_cvar("amx_kill_on", "1") ;
money_on = register_cvar("amx_money_on", "1") ;
set_task(30.0, "printer", _, _, _, "b");
}
public kupon(id)
{
new kasa = cs_get_user_money(id)
new zycie = get_user_health(id)
new alajf = is_user_alive(id)
if(kasa < price){
client_print(id, print_chat, "Nie masz kasy, nie losujesz.", price)
}
if(!alajf){
cs_set_user_money(id, kasa - 500)
client_print(id, print_chat, "Nie zyjesz, wiec nie badz taki sprytny. Komenda off. -500 $ Za probe.")
}
if(alajf && plugin_on == 1 && kasa >= price)
{
new rand = random_num(0,6)
switch(rand)
{
case 0: {
if (gravity_on == 1)
{
cs_set_user_money(id, kasa - price)
set_user_gravity(id, 0.50)
client_print(id, print_chat, "Otrzymujesz Grawitacje! Gratulacje.") ;
}
else kupon(id)
}
case 1: {
if(elite_on)
{
cs_set_user_money(id, kasa - price)
give_item(id, "weapon_elite")
give_item(id, "ammo_9mm")
client_print(id, print_chat, "Otrzymujesz Dual Elite's. Gratulacje.") ;
}
else kupon(id)
}
case 2: {
if (money_on == 1)
{
cs_set_user_money(id, kasa - price)
cs_set_user_money(id, kasa + 6000)
client_print(id, print_chat, "Wygrales 6000 $. Gratulacje.") ;
}
else kupon(id)
}
case 3: {
if (noclip_on == 1)
{
cs_set_user_money(id, kasa - price)
set_user_noclip(id, 1)
client_print(id, print_chat, "Otrzymujesz Noclip! Gratulacje.") ;
}
else kupon(id)
}
case 4: {
if (health_on == 1)
{
cs_set_user_money(id, kasa - price)
set_user_health(id, zycie + 50)
client_print(id, print_chat, "Otrzymujesz 50 HP. Gratulacje.") ;
}
else kupon(id)
}
case 5: {
if (kill_on == 1)
{
cs_set_user_money(id, kasa - price)
client_cmd(id, "kill", 0)
client_print(id, print_chat, "Popelniles samobojstwo... Najwyrazniej miales problemy...") ;
}
else kupon(id)
}
case 6: {
if (speed_on == 1)
{
set_user_maxspeed(id, 30.0);
client_print(id, print_chat, "Starosc nie radosc.") ;
cs_set_user_money(id, kasa - price)
}
else kupon(id)
}
}
client_print(id, print_chat, "Losujesz nie pozalujesz. Cena: %s $",price)
}
}
public printer()
{
client_print(0, print_chat, "Chcesz losowac i wygrywac wpisz: say /kupon.")
client_print(0, print_chat, "[Kupon] Zyczymy szczescia w losowaniu.")
}
Proszę o szybką pomoc.