Jump to content

[Plugin] Tigari


SpyRexx

Recommended Posts

Cand omori un adversar poti primii o tigara/poti pierde o tigara/nu pimesti nimic

Cand scrii in chat /fumeaza ecranul se face rosu si se aude un tii-uit (ca si cum te-ai droga).

 

Descarcare:

/* Plugin Generated by AMXX Studio */

#include <amxmodx>
#include <amxmisc>

#pragma semicolon 1

new NumarDeTigari[33];

public plugin_init()
{
	register_plugin("Tigari", "1.0", "londoN");
	
	register_clcmd("say /fumeaza", "cmd_fumeaza");
	
	register_event("DeathMsg", "ev_death", "a");
}

public ev_death()
{
	new Victim = read_data(2);
	new Attacker = read_data(1);
	
	if(NumarDeTigari[Attacker] >= 20)                       return PLUGIN_HANDLED;
	
	if(Attacker == Victim)                                    return PLUGIN_HANDLED;
	
	switch(random_num(1,3))
	{
		case 1 :
		{
			ColorChat(Attacker, "Din pacate tiganu nu avea tigari la el");
			return PLUGIN_HANDLED;
		}
		
		case 2 :
		{
			ColorChat(Attacker, "Ai ciordalit o tigara!");
			NumarDeTigari[Attacker] += 1;
			return PLUGIN_HANDLED;
		}
		
		case 3 :
		{
			ColorChat(Attacker, "Ti-ai rupt o tigara in timp ce te bateai cu tigani!");
			NumarDeTigari[Attacker] -= 1;
			return PLUGIN_HANDLED;
		}
	}
	
	return PLUGIN_CONTINUE;
}

public cmd_fumeaza(id)
{
	if(NumarDeTigari[id] == 0)
	{
		ColorChat(id, "!x03Nu ai tigari!");
		return PLUGIN_HANDLED;
	}
	
	message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), {0,0,0}, id);
	write_short(10<<12);
	write_short(10<<16);
	write_short(1<<1);
	write_byte(255);
	write_byte(0);
	write_byte(0);
	write_byte(255);
	message_end();
	
	NumarDeTigari[id] -= 1;
	
	
	ColorChat(id, "!x04AI FUMAT O TIGARA!");
	return PLUGIN_CONTINUE;
}

stock ColorChat(const id, const input[], any:...) {
	new count = 1, players[32];
	static msg[191];
	vformat(msg, 190, input, 3);
	
	replace_all(msg, 190, "!x04", "^4");
	replace_all(msg, 190, "!x03", "^3");
	
	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();
			}
		}
	}
}

Nume: Tigari
Versiune:1.0
Autor: London

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

tigari_cs16.amxx

Cvar-uri: Se adauga in fisierul AMXMODX/Configs/Amxx.CFG)

Comenzi administrative: (Se tasteaza in consola si trebuie sa fiti administrator)

Comenzi publice: (Se tasteaza in joc prin apasarea tastei Y) Say/Spune ( Fumeaza )


Module necesare: (Din fata modulului de mai jos, le gasiti in fisierul amxmodx/configs/modules.ini).

Edited by SpyRexx
  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...