Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include <amxmodx>
- #include <amxmisc>
- #include <colorchat>
- #include <fun>
- #include <cstrike>
- #define PLUGIN "Sansa"
- #define VERSION "1.1"
- #define AUTHOR "Uncut*"
- new cipele, baloni, rvreme, cooldown
- new bool:Cooldown_zavrsen[32]
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_cvar("sansa", "1.0" , (FCVAR_SERVER|FCVAR_SPONLY))
- register_clcmd("say /chance", "sansa")
- register_clcmd("say_team /chance", "sansa")
- rvreme = register_cvar("amx_chance_rvreme", "10.0")
- cipele = register_cvar("amx_chance_cipele", "1.6")
- baloni = register_cvar("amx_chance_baloni", "0.6")
- cooldown = register_cvar("amx_chance_cooldown", "25")
- }
- public client_putinserver(id){
- Cooldown_zavrsen[id] = true
- reset(id)
- }
- public sansa(id){
- if(is_user_alive(id))
- {
- new broj = random_num(1, 7) //random broj izmedju 1 i 7
- new Ime[33]
- get_user_name(id, Ime[id], 32)
- if (!Cooldown_zavrsen[id]){
- ColorChat(id, GREY, "^x04[Chance]^x01 Sacekaj cooldown")
- return PLUGIN_HANDLED
- }
- switch(broj)
- {
- case 1:
- {
- ColorChat(0 ,RED, "^x04[Chance]^x01 %s je dobio ^x03[Teske Metalne Cipele]", Ime[id])
- set_user_gravity(id, get_pcvar_float(cipele))
- set_task(get_pcvar_float(rvreme), "reset", id)
- Cooldown_zavrsen[id] = false
- set_task(get_pcvar_float(cooldown), "rr_cooldown", id)
- }
- case 2:
- {
- ColorChat(0, GREY, "^x04[Chance]^x01 %s je dobio ^x04[Kesicu kolaca]", Ime[id])
- new HP = get_user_health(id)
- if(HP>=71)
- {
- set_user_health(id, 100)
- }
- else if(HP<71)
- {
- set_user_health(id, HP+30)
- }
- Cooldown_zavrsen[id] = false
- set_task(get_pcvar_float(cooldown), "rr_cooldown", id)
- }
- case 3:
- {
- ColorChat(0 ,RED, "^x04[Chance]^x01 %s je dobio ^x03[Pokvareni sok]", Ime[id])
- new HP = get_user_health(id)
- if(HP<=31)
- {
- set_user_health(id, 1)
- }
- else if(HP>31)
- {
- set_user_health(id, HP-30)
- }
- message_begin(MSG_ONE_UNRELIABLE , get_user_msgid("ScreenFade"), {0,0,0} , id)
- write_short( 1<<10 )
- write_short( 1<<10 )
- write_short( 1<<12 )
- write_byte( 102 )
- write_byte( 102 )
- write_byte( 0 )
- write_byte( 125 )
- message_end()
- Cooldown_zavrsen[id] = false
- set_task(get_pcvar_float(cooldown), "rr_cooldown", id)
- }
- case 4:
- {
- ColorChat(0 ,GREY, "^x04[Chance]^x01 %s je dobio ^x04[Balone sa heliumom]", Ime[id])
- set_user_gravity(id, get_pcvar_float(baloni))
- set_task(get_pcvar_float(rvreme), "reset", id)
- Cooldown_zavrsen[id] = false
- set_task(get_pcvar_float(cooldown), "rr_cooldown", id)
- }
- case 5:
- {
- new frag = random_num(1,4)
- ColorChat(0 ,RED, "^x04[Chance]^x01 %s je dobio ^x03[-%d fragova]", Ime[id], frag)
- set_user_frags(id, get_user_frags(id)-frag)
- cs_set_user_deaths(id, cs_get_user_deaths(id))
- Cooldown_zavrsen[id] = false
- set_task(get_pcvar_float(cooldown), "rr_cooldown", id)
- }
- case 6:
- {
- new pare = random_num(500,2000)
- new ipare = cs_get_user_money(id)
- ColorChat(0 ,GREY, "^x04[Chance]^x01 %s received ^x04[+%d $]", Ime[id], pare)
- cs_set_user_money(id, ipare+pare)
- Cooldown_zavrsen[id] = false
- set_task(get_pcvar_float(cooldown), "rr_cooldown", id)
- }
- case 7:
- {
- new pare = random_num(500,2000)
- new ipare = cs_get_user_money(id)
- ColorChat(0 ,RED, "^x04[Chance]^x01 %s je dobio ^x03[-%d $]", Ime[id], pare)
- if(pare > ipare)
- {
- cs_set_user_money(id, 0)
- }
- else
- {
- cs_set_user_money(id, ipare-pare)
- }
- Cooldown_zavrsen[id] = false
- set_task(get_pcvar_float(cooldown), "rr_cooldown", id)
- }
- }
- }
- return PLUGIN_CONTINUE
- }
- public reset(id){
- set_user_gravity(id, 1.0)
- }
- public rr_cooldown(id) Cooldown_zavrsen[id] = true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement