Raised This Month: $12 Target: $400
 3% 

Life


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
layka_LUBII
Senior Member
Join Date: Jul 2012
Old 04-08-2013 , 07:58   Life
Reply With Quote #1

Hello,, I need to help plugins a respawn deathrun
Plugins have a 4 life but when dead before 4life on 1life
I need to 4 life
I have respawan
3Life
I have respawan
2LIFE
I have respawan
1 LIFE
I have respwan
You don´t life
thank you

Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>

#define PLUGIN "RESPAWN MENU"
#define VERSION "1.0"
#define AUTHOR "*Slavomírek*"

#define ZADANIE_HUD 98211

new g_HudSyncObj
new zivoty[33]
new g_PocetZivotov
new const g_Sound[] = "sound/misc/oziveni.mp3"

public plugin_init() 
{
   register_plugin(PLUGIN, VERSION, AUTHOR)
   register_event("DeathMsg", "eDeath", "a") 
   RegisterHam(Ham_Killed, "player", "respawn")
   g_HudSyncObj = CreateHudSyncObj();
   g_PocetZivotov = register_cvar("Pocet zivotov po pripojeni","4")
}

public client_connect( id ) 
{
   new nzivoty = get_pcvar_num(g_PocetZivotov)
   zivoty[id] = nzivoty
}


public eDeath(  )
{
   new victim = read_data(2)
   
   if(zivoty[victim] > 0)
   {
      menu1( victim )   
   }
   
}

public plugin_precache()
{
   precache_generic(g_Sound)
}

public client_authorized(id)
{
        set_task(6.0,"Message_Hud",id + ZADANIE_HUD)
}

public Message_Hud(id)
{
        id-= ZADANIE_HUD;
        set_hudmessage(0, 255, 0, 0.10, 0.70, 0, 6.0, 12.0);
        ShowSyncHudMsg(id, g_HudSyncObj, "Celkom mas %i zivoty!",zivoty[id]) 
        set_task(0.1,"Message_Hud",id + ZADANIE_HUD)
}

public menu1(id)
{
new menu = menu_create("Chces sa respawnut ?","menu1_handle")
menu_additem(menu, "Ano")
menu_additem(menu, "Nie")
menu_display(id, menu)
}
public menu1_handle(id,menu,item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
switch(item)
{
case 0:
{
zivoty[id] -= 1
ExecuteHamB(Ham_CS_RoundRespawn,id)
client_print(id,print_center,"Bol si respawnuty")
client_cmd(id,"mp3 play %s",g_Sound)
}

case 1: menu_destroy(menu)
   
}
return PLUGIN_HANDLED 
}
public respawn(victim,shouldgib)
{
if(!is_user_alive(victim))
{
menu1(victim)
}
}
layka_LUBII is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-08-2013 , 09:35   Re: Life
Reply With Quote #2

Seems that you haven't provided the whole code.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Old 04-08-2013, 10:06
EM styrka
This message has been deleted by YamiKaitou. Reason: English Only
Old 04-08-2013, 10:16
layka_LUBII
This message has been deleted by YamiKaitou. Reason: English Only
layka_LUBII
Senior Member
Join Date: Jul 2012
Old 04-08-2013 , 11:58   Re: Life
Reply With Quote #3

My code work to life 4,3,2,....1....I haven´t life
But on new round to life 1 please...I need to next round to 4 life

Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>

#define PLUGIN "RESPAWN MENU"
#define VERSION "1.0"
#define AUTHOR "*Slavomírek*"

#define ZADANIE_HUD 98211

new g_HudSyncObj
new zivoty[33]
new g_PocetZivotov
new const g_Sound[] = "sound/misc/oziveni.mp3"

public plugin_init() 
{
   register_plugin(PLUGIN, VERSION, AUTHOR)
   register_event("DeathMsg", "eDeath", "a") 
   RegisterHam(Ham_Killed, "player", "respawn")
   g_PocetZivotov = register_cvar("Pocet zivotov po pripojeni","4")
   g_HudSyncObj = CreateHudSyncObj();
}

public client_connect( id ) 
{
   new nzivoty = get_pcvar_num(g_PocetZivotov)
   zivoty[id] = nzivoty
}

public eDeath(  )
{
   new victim = read_data(2)

   if(zivoty[victim] > 0)
   {
      menu1( victim )   
   }
   
}

public plugin_precache()
{
   precache_generic(g_Sound)
}

public client_authorized(id)
{
        set_task(6.0,"Message_Hud",id + ZADANIE_HUD)
}

public Message_Hud(id)
{
        id-= ZADANIE_HUD;
        set_hudmessage(0, 255, 0, 0.10, 0.70, 0, 6.0, 12.0);
        ShowSyncHudMsg(id, g_HudSyncObj, "Celkom mas %i zivoty!",zivoty[id]) 
        set_task(0.1,"Message_Hud",id + ZADANIE_HUD)
}

public menu1(id)
{
new menu = menu_create("Chces sa respawnut ?","menu1_handle")
menu_additem(menu, "Ano")
menu_additem(menu, "Nie")
menu_display(id, menu)
}
public menu1_handle(id,menu,item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
switch(item)
{
case 0:
{
if(zivoty[id] > 1)
{
ExecuteHamB(Ham_CS_RoundRespawn,id)
client_print(id,print_center,"Bol si respawnuty")
client_cmd(id,"mp3 play %s",g_Sound)
zivoty[id]--
}
else
{
client_print(id,print_center,"Nedostatok zivotov k respawnutiu")
}
}
case 1: menu_destroy(menu)
   
}
return PLUGIN_HANDLED 
}
public respawn(victim,shouldgib)
{
if(!is_user_alive(victim))
{
menu1(victim)
}
}
layka_LUBII is offline
Kz1.0
Senior Member
Join Date: Jan 2013
Location: Vietnam
Old 04-08-2013 , 13:24   Re: Life
Reply With Quote #4

Hook new round and set zivoty[id] to 4.
Kz1.0 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-08-2013 , 13:48   Re: Life
Reply With Quote #5

There is no public "respawn" function.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
layka_LUBII
Senior Member
Join Date: Jul 2012
Old 04-08-2013 , 15:13   Re: Life
Reply With Quote #6

Yes,, I need to every round 4 life
layka_LUBII is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 04-08-2013 , 16:12   Re: Life
Reply With Quote #7

Quote:
Originally Posted by layka_LUBII View Post
Yes,, I need to every round 4 life
Quote:
Originally Posted by Kz1.0 View Post
Hook new round and set zivoty[id] to 4.
baneado is offline
layka_LUBII
Senior Member
Join Date: Jul 2012
Old 04-08-2013 , 16:48   Re: Life
Reply With Quote #8

View a image
[IMG]http://img837.**************/img837/9876/resev.jpg[/IMG]

Last edited by layka_LUBII; 04-08-2013 at 16:49.
layka_LUBII is offline
FanatikSVK
Member
Join Date: Aug 2012
Location: Slovakia
Old 04-09-2013 , 08:03   Re: Life
Reply With Quote #9

Code:
if(zivoty[id] > 1)
on
Code:
if(zivoty[id] > 4)
__________________
FanatikSVK is offline
Send a message via Skype™ to FanatikSVK
layka_LUBII
Senior Member
Join Date: Jul 2012
Old 04-09-2013 , 10:18   Re: Life
Reply With Quote #10

doesn´t work
layka_LUBII is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode