[DeathRun] Advanced Life System

Pluginuri facute de utilizatorii forumului eXtream.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

User avatar
GhosT ***
Membru, skill +2
Membru, skill +2
Posts: 604
Joined: 04 Dec 2013, 21:52
Detinator Steam: Da
CS Status: Morphin . [ Retras ]
SteamID: Mutulica1428
Reputatie: Fost Moderator ajutator
Location: Dumesti.
Has thanked: 40 times
Been thanked: 99 times
Contact:

14 Feb 2014, 21:15

* Descriere: Acest plugin ruleaza pe pluginul de euro (al meu) care il puteti gasi aici : Click here (luati versiunea 1.2)

P.S: Acest plugin(system) este mai special pentru ca la fiecare deconectare(sau schimbare mapa) se salveaza vietile .
P.S2: Acest meniu poate fi deschis prin comanda /lifemenu si/sau atunci cand mori !

* Descarcare : Click Here - Zippyshare -> versiunea 1.1
Sursa | Afiseaza codul
#include <amxmodx>
#include <colorchat>
#include <hamsandwich>
#include <cstrike>
#include <euro_system>
#include <nvault>
#include <fun>

new Lifes[33];

new pCvarLifeBuy, pCvarLifeSell;
new pCvarHudsON;
new Vault;

public plugin_init()
{
	new const PLUGIN[] = "DeathRun Advanced Life System";
	new const AUTHOR[] = "GhosT";
	
	static const VER[] = "1.1";
	
	register_plugin(PLUGIN, VER, AUTHOR);
	
	register_clcmd("say /lifemenu", "ClCmdLifeMenu");
	register_clcmd("say /lifes", "ClCmdLifes");
	register_event("DeathMsg", "DeathMsg", "ad");
	
	pCvarLifeBuy = register_cvar("pCvarLifeBuy", "20");
	pCvarLifeSell = register_cvar("pCvarLifeSell", "10");
	pCvarHudsON = register_cvar("pCvarHudsON", "1");
	Vault = nvault_open("DeathRun-Lifes");
}
public ClCmdLifeMenu(id)
{
	new Title[64], Item1[64], Item2[64], Item3[64];
	
	formatex(Title, sizeof(Title), "%s Ai %d %s", Lifes[id] > 0 ? "\y" : "\d", Lifes[id], Lifes[id] != 1 ? "vieti" : "viata");
	formatex(Item1, sizeof(Item1), "%s Foloseste o viata^n", Lifes[id] > 0 ? "\y" : "\d");
	formatex(Item2, sizeof(Item2), "%s Cumpara o viata - %d Euro", get_user_euro(id) >= get_pcvar_num(pCvarLifeBuy) ? "\y" : "\d", get_pcvar_num(pCvarLifeBuy));
	formatex(Item3, sizeof(Item3), "%s Vinde o viata - %d Euro", Lifes[id] > 0 ? "\y" : "\d" ,get_pcvar_num(pCvarLifeSell));
	
	new menu = menu_create(Title, "LifeMenuHandler");
	
	menu_additem(menu, Item1, "1", 0);
	menu_additem(menu, Item2, "2", 0);
	menu_additem(menu, Item3, "3", 0);
	
	menu_setprop(menu, MPROP_EXITNAME, "\yIesire");
	menu_display(id, menu, 0);
	
	return PLUGIN_HANDLED;
}
public LifeMenuHandler(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		return 1;
	}
	
	new euro = get_user_euro(id);
	
	new data[6], szName[64];
	new access, callback;
	menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
	new key = str_to_num(data);
	
	switch(key)
	{
		case 1:
		{
			if(is_user_alive(id))
			{
				ColorChat(id, RED, "^x04 [DeathRun - Lifes]^x01 Trebuie sa fii mort pentru a folosi o viata !");
				ClCmdLifeMenu(id);
				return PLUGIN_HANDLED;
			}
			else
			{
				if(Lifes[id] <= 0)
				{
					ColorChat(id, RED, "^x04 [DeathRun - Lifes]^x01 Trebuie sa ai^x03 minim o viata^x01 pentru a reinvia !");
					ClCmdLifeMenu(id);
					return PLUGIN_HANDLED;
				}
				else
				{
					Lifes[id] -= 1;
					spawn(id);
					ClCmdLifeMenu(id);
					ColorChat(id, RED, "^x04 [DeathRun - Lifes]^x01 Ai folosit o viata, acum ai^x03 %d %s", Lifes[id], Lifes[id] == 1 ? "viata" : "vieti");
				}
			}
		}
		case 2:
		{
			if(euro < get_pcvar_num(pCvarLifeBuy))
			{
				ColorChat(id, RED, "^x04 [DeathRun - Lifes]^x01 Ai nevoie de^x03 %d euro^x01 pentru a cumpara o viata !", get_pcvar_num(pCvarLifeBuy));
				ClCmdLifeMenu(id);
				return PLUGIN_HANDLED;
			}
			else if(euro >= get_pcvar_num(pCvarLifeBuy))
			{
				Lifes[id] += 1;
				
				set_user_euro(id, euro - get_pcvar_num(pCvarLifeBuy));
				ClCmdLifeMenu(id);
				ColorChat(id, RED, "^x04 [DeathRun - Lifes]^x03 Ai cumparat o viata^x01 si ai dat^x03 %d euro^x01 ! Acum ai^x03 %d %s", get_pcvar_num(pCvarLifeBuy), Lifes[id], Lifes[id] == 1 ? "viata" : "vieti");
			}
		}
		case 3:
		{
			if(Lifes[id] <= 0)
			{
				ColorChat(id, RED, "^x04 [DeathRun - Lifes]^x01 Trebuie sa ai^x03 minim o viata^x01 pentru a vinde !");
				ClCmdLifeMenu(id);
				return PLUGIN_HANDLED;
			}
			else
			{
				Lifes[id] -= 1;
				
				set_user_euro(id, euro + get_pcvar_num(pCvarLifeSell));
				ClCmdLifeMenu(id);
				ColorChat(id, RED, "^x04 [DeathRun - Lifes]^x03 Ai vandut o viata^x01 si ai primit^x03 %d euro^x01 ! Acum ai^x03 %d %s", get_pcvar_num(pCvarLifeSell), Lifes[id], Lifes[id] == 1 ? "viata" : "vieti");
			}
		}
	}
	
	menu_destroy(menu);
	return 1;
}
public ClCmdLifes(id)
{
	new NamePlayer[32];
	get_user_name(id, NamePlayer, sizeof(NamePlayer) - 1);
	
	ColorChat(id, RED, "^x04 [DeathRun - Lifes]^x01 Salut^x03 %s^x01.. In acest moment tu ai^x03 %d %s^x01 !", NamePlayer, Lifes[id], Lifes[id] == 1 ? "viata" : "vieti")
	
	return PLUGIN_HANDLED;
}
public DeathMsg()
{	
	new iHeadShot = read_data(3);
	new iVictim = read_data(2);
	new iAttacker = read_data(1);
	
	new NamePlayer[32];
	get_user_name(iVictim, NamePlayer, sizeof(NamePlayer) - 1);
	
	set_hudmessage(0, 255, 255, -1.0, -1.0);
	
	if(iVictim == iAttacker)
		return PLUGIN_HANDLED;
	
	if(iHeadShot && iVictim != iAttacker)
	{
		Lifes[iAttacker] += 2;
		
		if(get_pcvar_num(pCvarHudsON) >= 1)
			show_hudmessage(iAttacker, "[Head Shot] Ai primit doua vieti pentru ca l-ai omorat pe %s !", NamePlayer);
	}
	if(!iHeadShot && iVictim != iAttacker)
	{
		Lifes[iAttacker] += 1;
		
		if(get_pcvar_num(pCvarHudsON) >= 1)
			show_hudmessage(iAttacker, "[Kill] Ai primit o viata pentru ca l-ai omorat pe %s !", NamePlayer);
	}
	
	ClCmdLifeMenu(iVictim);
	
	return PLUGIN_CONTINUE;
}
public client_putinserver(id)
	LoadLifes(id);
	
public client_disconnect(id)
	SaveLifes(id);
	
public SaveLifes(id)
{
	new NamePlayer[32];
	get_user_name(id, NamePlayer, sizeof(NamePlayer) - 1);
	
	new VaultKey[64],VaultData[256];
	
	format(VaultKey, 63, "%s-DeathRun-Lifes", NamePlayer);
	format(VaultData, 255, "%i#", Lifes[id]);
	
	nvault_set(Vault, VaultKey, VaultData);
}
public LoadLifes(id)
{
	new NamePlayer[32];
	get_user_name(id, NamePlayer, sizeof(NamePlayer) - 1);
	
	new VaultKey[64], VaultData[256];
	
	format(VaultKey, sizeof(VaultKey) - 1, "%s-DeathRun-Lifes", NamePlayer);
	format(VaultData, charsmax(VaultData), "%i#", Lifes[id]);
	
	nvault_get(Vault, VaultKey, VaultData, charsmax(VaultData));
	replace_all(VaultData, 255, "#", " ");
	
	new PlayerLifes[32];
	parse(VaultData, PlayerLifes, sizeof(PlayerLifes) - 1);
	
	Lifes[id] = str_to_num(PlayerLifes);
}
* Nume: DeathRun Advanced Life System
* Versiune: 1.1
* Link oficial:
ExteamCS.com - Pe euro
Alliedmods.net - Aici este pe money (Gh0s7 is tot eu)

* Instalare:

1. Fisierul DeathRunAdvLifeS.sma il puneti in addons/amxmodx/scripting !
2. Fisierul DeathRunAdvLifeS.amxx il puneti in addons/amxmodx/plugins !
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:

Code: Select all

DeathRunAdvLifeS.amxx

4. Alti pasi necesari...

* Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):

Code: Select all

pCvarLifeBuy => Cat sa coste o viata (default: 20)
pCvarLifeSell => Cu cat sa se vanda o viata (default:10)
pCvarHudsON => Daca sa arate mesajele HUD (default: 1)
* Comenzi administrative (se tasteaza in consola si trebuie sa fiti administrator): -

* Comenzi publice (se tasteaza in joc prin apasarea tastei Y):

Code: Select all

- /lifes - arata cate vieti ai
- /lifemenu - arata meniul de vieti
* Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):

Code: Select all

- Hamsandwich
- Cstrike
- nVault
- Fun
* Imagini :
| Afiseaza codul
Image
Image
Image
Image
Last edited by GhosT *** on 15 Feb 2014, 11:09, edited 1 time in total.
User avatar
Adventx
Membru, skill +4
Membru, skill +4
Posts: 1785
Joined: 17 Sep 2013, 20:44
Detinator Steam: Da
Reputatie: Fost moderator ajutator
Has thanked: 125 times
Been thanked: 142 times
Contact:

14 Feb 2014, 21:49

Frumos Plugin! :P
Bravo! >:D<
User avatar
NuRoFeN [;x]
Membru, skill +2
Membru, skill +2
Posts: 828
Joined: 21 Aug 2012, 14:47
Detinator Steam: Da
CS Status: Inactiv !
Detinator server CS: DR.CS1.RO
SteamID: eualexandru
Reputatie: Fost moderator
Location: Rm.Valcea
Has thanked: 66 times
Been thanked: 61 times
Contact:

15 Feb 2014, 12:03

Felicitari , e un plugin care trebuie folosit la acest mod :)))
User avatar
GhosT ***
Membru, skill +2
Membru, skill +2
Posts: 604
Joined: 04 Dec 2013, 21:52
Detinator Steam: Da
CS Status: Morphin . [ Retras ]
SteamID: Mutulica1428
Reputatie: Fost Moderator ajutator
Location: Dumesti.
Has thanked: 40 times
Been thanked: 99 times
Contact:

15 Feb 2014, 12:30

NuRoFeN [;x] wrote:Felicitari , e un plugin care trebuie folosit la acest mod :)))
Mersi alte pareri ? Un sistem foarte folosit pentru modul deathrun (sa il pun ca "bani") /:)
LordOfNothing
Membru, skill +1
Membru, skill +1
Posts: 387
Joined: 19 Jul 2013, 14:51
Detinator Steam: Nu
Reputatie: Restrictie PM
Has thanked: 11 times
Been thanked: 34 times

16 Feb 2014, 11:58

Cum salvarea este pe nume ar trebui sa blochezi schimbarea numelui :)

Uite aici un exemplu de Vieti Plugin poti fura mai multe idei ( e facut de mine si iti dau voie ) :

https://raw.github.com/LordOfNothing10/ ... /Lives.sma
User avatar
GhosT ***
Membru, skill +2
Membru, skill +2
Posts: 604
Joined: 04 Dec 2013, 21:52
Detinator Steam: Da
CS Status: Morphin . [ Retras ]
SteamID: Mutulica1428
Reputatie: Fost Moderator ajutator
Location: Dumesti.
Has thanked: 40 times
Been thanked: 99 times
Contact:

16 Feb 2014, 18:01

LordOfNothing wrote:Cum salvarea este pe nume ar trebui sa blochezi schimbarea numelui :)

Uite aici un exemplu de Vieti Plugin poti fura mai multe idei ( e facut de mine si iti dau voie ) :

https://raw.github.com/LordOfNothing10/ ... /Lives.sma
Lol e aporape ca al meu :O
C.Artur
Fost moderator
Fost moderator
Posts: 7391
Joined: 04 Oct 2013, 13:32
Detinator Steam: Da
Reputatie: Fost Super Moderator
Location: Cluj Napoca
Has thanked: 137 times
Been thanked: 99 times
Contact:

19 Feb 2014, 17:29

Frumos plugin-ul,felicitari.
User avatar
GhosT ***
Membru, skill +2
Membru, skill +2
Posts: 604
Joined: 04 Dec 2013, 21:52
Detinator Steam: Da
CS Status: Morphin . [ Retras ]
SteamID: Mutulica1428
Reputatie: Fost Moderator ajutator
Location: Dumesti.
Has thanked: 40 times
Been thanked: 99 times
Contact:

19 Feb 2014, 19:21

AMPHETAMINE wrote:Frumos plugin-ul,felicitari.
Ai revenit cu SPAM ? :-" \:d/
MoTzoK.
Membru, skill 0
Membru, skill 0
Posts: 22
Joined: 31 Oct 2012, 09:58
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: Furien2.CS1.RO
Has thanked: 13 times
Contact:

19 Feb 2014, 20:01

Modulul <nvault> cu ce ajuta in acest plugin?
Image
User avatar
NuRoFeN [;x]
Membru, skill +2
Membru, skill +2
Posts: 828
Joined: 21 Aug 2012, 14:47
Detinator Steam: Da
CS Status: Inactiv !
Detinator server CS: DR.CS1.RO
SteamID: eualexandru
Reputatie: Fost moderator
Location: Rm.Valcea
Has thanked: 66 times
Been thanked: 61 times
Contact:

19 Feb 2014, 20:22

A scris in descriere , ca la fiecare iesire de pe sv nu se pierd vietile.
User avatar
GhosT ***
Membru, skill +2
Membru, skill +2
Posts: 604
Joined: 04 Dec 2013, 21:52
Detinator Steam: Da
CS Status: Morphin . [ Retras ]
SteamID: Mutulica1428
Reputatie: Fost Moderator ajutator
Location: Dumesti.
Has thanked: 40 times
Been thanked: 99 times
Contact:

19 Feb 2014, 20:29

MoTzoK. wrote:Modulul <nvault> cu ce ajuta in acest plugin?
Modulul "nVault" salveaza / incarca vietile la deconectare / conectare pe server .
Lux0R^
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1223
Joined: 13 Jul 2013, 15:31
Detinator Steam: Da
Reputatie: Scripter eXtreamCS
Moderator ajutator
Has thanked: 15 times
Been thanked: 10 times

20 Feb 2014, 15:11

este un plugin cam la fel ca asta, deci... daca nu aduci ceva in plus fata de celalalt, e doar o alta versiune a aceluasi plugin
Pauza pana in iulie... licenta ^^

Fara pm-uri pentru pluginuri de zm/furien + tot ce tine de vip.

Codul Scripterului: scripting/codul-scripterului-t362300.html#p2754224
Post Reply

Return to “Pluginuri eXtream”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests