Cerere modificare plugin

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
N.A.S.A.
Membru, skill 0
Membru, skill 0
Posts: 95
Joined: 14 Feb 2018, 15:56
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

22 Mar 2018, 23:08

puteti sa-mi modificati acest sma sa inceapa eventul free intre orele

7 dupamasa pana la 9 dimineata multumesc.
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>

#define PLUGIN "Beneficii"
#define VERSION "1.0"
#define AUTHOR "cyby"

new const MsgON[] = "Se desfasoara eventul 'Beneficii Free'!"
new const MsgOFF[] = "Eventul 'Beneficii Free' ruleaza intre orele 20 - 23!"

new bool:beneficii = false

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_event("DeathMsg","EDeathMsg","a");
	register_event("HLTV", "RundaNoua", "a", "1=0", "2=0");

}

public RundaNoua() {
	check_time();
}

public client_putinserver(id)
{
	set_task( 10.0, "info_task", id )
}

public info_task(id)
{
	if(beneficii)
		ColorChat( id, "^x04[Beneficii Free]^x01 Primesti^x04 +30 HP^x01 ,^x04 +30 AP^x01 si^x04 +3000$^x01 pentru fiecare frag!" )
}

public check_time() {
	static preluare_ora[3], ora;
	get_time("%H", preluare_ora, 2);
	ora = str_to_num(preluare_ora);
	if(20 <= ora || ora < 23)
	{
		beneficii = true
		set_hudmessage(0, 255, 0, -1.0, -1.0, 0, 1.0, 6.0)
		show_hudmessage(0, MsgON)
	}
	else
	{
		beneficii = false
		set_hudmessage(0, 255, 0, -1.0, -1.0, 0, 1.0, 6.0)
		show_hudmessage(0, MsgOFF)
	}
}

public EDeathMsg()
{
	new Killer = read_data( 1 );
	if(beneficii)
	{
		if( get_user_flags(Killer) == read_flags( "bcd") || get_user_flags(Killer) == read_flags( "cdc" ) == read_flags( "zic") ) {
			return;
		}
		
		set_user_health(Killer, get_user_health(Killer) + 30);
		set_user_armor(Killer, get_user_armor(Killer) + 30);
		cs_set_user_money(Killer, cs_get_user_money(Killer) + 3000);
	}
}

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, "!x01", "^1");
	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)) {
				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players);
				write_byte(players);
				write_string(msg);
				message_end();
			}
		}
	}
}
RoyalServer 2
User avatar
Laurentiu P.
Fost moderator
Fost moderator
Posts: 2549
Joined: 10 Jul 2013, 21:26
Detinator Steam: Da
Reputatie: Fost super moderator
Fond eXtream: 100
Has thanked: 26 times
Been thanked: 62 times
Contact:

23 Mar 2018, 12:37

| Afiseaza codul
[quote]
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>

#define PLUGIN "Beneficii"
#define VERSION "1.0"
#define AUTHOR "cyby"

new const MsgON[] = "Se desfasoara eventul 'Beneficii Free'!"
new const MsgOFF[] = "Eventul 'Beneficii Free' ruleaza intre orele 20 - 23!"

new bool:beneficii = false

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_event("DeathMsg","EDeathMsg","a");
	register_event("HLTV", "RundaNoua", "a", "1=0", "2=0");

}

public RundaNoua() {
	check_time();
}

public client_putinserver(id)
{
	set_task( 10.0, "info_task", id )
}

public info_task(id)
{
	if(beneficii)
		ColorChat( id, "^x04[Beneficii Free]^x01 Primesti^x04 +30 HP^x01 ,^x04 +30 AP^x01 si^x04 +3000$^x01 pentru fiecare frag!" )
}

public check_time() {
	static preluare_ora[3], ora;
	get_time("%H", preluare_ora, 2);
	ora = str_to_num(preluare_ora);
	if(19 <= ora || ora < 09)
	{
		beneficii = true
		set_hudmessage(0, 255, 0, -1.0, -1.0, 0, 1.0, 6.0)
		show_hudmessage(0, MsgON)
	}
	else
	{
		beneficii = false
		set_hudmessage(0, 255, 0, -1.0, -1.0, 0, 1.0, 6.0)
		show_hudmessage(0, MsgOFF)
	}
}

public EDeathMsg()
{
	new Killer = read_data( 1 );
	if(beneficii)
	{
		if( get_user_flags(Killer) == read_flags( "bcd") || get_user_flags(Killer) == read_flags( "cdc" ) == read_flags( "zic") ) {
			return;
		}
		
		set_user_health(Killer, get_user_health(Killer) + 30);
		set_user_armor(Killer, get_user_armor(Killer) + 30);
		cs_set_user_money(Killer, cs_get_user_money(Killer) + 3000);
	}
}

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, "!x01", "^1");
	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)) {
				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players);
				write_byte(players);
				write_string(msg);
				message_end();
			}
		}
	}
}[/quote]
no...
Post Reply

Return to “Modificari pluginuri”

  • Information