Cerere plugin

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
ReaD1nG
Membru, skill +1
Membru, skill +1
Posts: 237
Joined: 26 Jul 2013, 17:48
Detinator Steam: Da
Has thanked: 65 times
Been thanked: 13 times

13 Oct 2013, 23:38

Buna seara eXtreamCS vreau sa imi reparati si mie acest plugin
Vreau sa scrie ADMIN-ul %s te-a reinviat %s
ADMIN-ul GIgelos te-a reinviat Corcelos
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Ultimate Revive"
#define VERSION "1.1"
#define AUTHOR "anakin_cstrike"

// ColorChat Included

enum CC_Colors
{
	YELLOW = 1,	// 1; Yellow;		^x01;	default
	GREEN,		// 2; Green;		^x04
	TEAM_COLOR,	// 3; Red, Blue, Grey;	^x03;	teamcolor(t;ct;spec)
	GREY,		// 4; Grey;		Spectator Color
	RED,		// 5; Red;		Terrorist Color
	BLUE,		// 6; Blue;	Counter-Terrorist Color
}

new CC_TeamName[][] =
{
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
};

public ColorChat(id, CC_Colors:type, const msg[], {Float,Sql,Result,_}:...)
{
	if (get_playersnum() < 1)
	{
		return;
	}
	static CC_message[256];
	switch(type)
	{
		case YELLOW:
		{
			CC_message[0] = 0x01;
		}
		case GREEN:
		{
			CC_message[0] = 0x04;
		}
		default:
		{
			CC_message[0] = 0x03;
		}
	}
	vformat(CC_message[1], 251, msg, 4);
	CC_message[192] = '^0';
	new CC_team, CC_ColorChange, index, MSG_Type;
	if (!id)
	{
		index = CC_FindPlayer();
		MSG_Type = MSG_ALL;
	}
	else
	{
		MSG_Type = MSG_ONE;
		index = id;
	}
	CC_team = get_user_team(index);
	CC_ColorChange = CC_ColorSelection(index, MSG_Type, type);
	CC_ShowColorMessage(index, MSG_Type, CC_message);
	if (CC_ColorChange)
	{
		CC_TeamInfo(index, MSG_Type, CC_TeamName[CC_team]);
	}
}

CC_ShowColorMessage(index, type, message[])
{
	static CC_SayText;
	if (!CC_SayText)
	{
		CC_SayText = get_user_msgid("SayText");
	}
	message_begin(type, CC_SayText, _, index);
	write_byte(index);
	write_string(message);
	message_end();
}

CC_TeamInfo(index, type, team[])
{
	static CC_TeamInfo;
	if (!CC_TeamInfo)
	{
		CC_TeamInfo = get_user_msgid("TeamInfo");
	}
	message_begin(type, CC_TeamInfo, _, index);
	write_byte(index);
	write_string(team);
	message_end();
	return 1;
}

CC_ColorSelection(index, type, CC_Colors:Type)
{
	switch(Type)
	{
		case RED:
		{
			return CC_TeamInfo(index, type, CC_TeamName[1]);
		}
		case BLUE:
		{
			return CC_TeamInfo(index, type, CC_TeamName[2]);
		}
		case GREY:
		{
			return CC_TeamInfo(index, type, CC_TeamName[0]);
		}
	}
	return 0;
}

CC_FindPlayer()
{
	new index = -1;
	while(index <= get_maxplayers())
	{
		if (is_user_connected(++index))
		{
			return index;
		}
	}
	return -1;
}

new g_fade;
public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	register_concmd("amx_revive","revive_cmd",ADMIN_BAN,"- <player/@/@T/@CT> <hp> <armor>");
	g_fade = get_user_msgid("ScreenFade");
}
public revive_cmd(id,level,cid)
{
	if(!cmd_access(id,level,cid,4))
		return PLUGIN_HANDLED;
	new 
	arg[32],arg2[4],arg3[4],
	name[32],hp,armor;
	read_argv(1,arg,31);
	read_argv(2,arg2,3);
	read_argv(3,arg3,3);
	new name[32];
        get_user_name(id, name, 31);
        ColorChat(id, RED,"^x01[^x04HNS^x03R^x01] ADMIN-ul^x04 %s^x01 ti-a dat revive !")
	get_user_name(id,name,31);
	new argc = read_argc();
	if(argc < 2) {hp = 100;armor = 0;}
	else if(argc == 3) {hp = str_to_num(arg2);armor = 0;}
	else {hp = str_to_num(arg2);armor = str_to_num(arg3);}
	if(arg[0] == '@')
	{
		new players[32],teamname[24],tname[16],num,index,i;
		if(arg[1])
		{
			if(arg[1] == 'T')
			{
				copy(tname,15,"TERRORIST");
				copy(teamname,23,"Terrorist");
			} else if(arg[1] == 'C' && arg[2] == 'T') {
				copy(tname,15,"CT");
				copy(teamname,23,"Counter-Terrorist");
			} else {
				console_print(id,"Usage: @T/@CT");
				return PLUGIN_HANDLED;
			}
			get_players(players,num,"be",tname);
		} else {
			get_players(players,num);
			copy(teamname,23,"All");
		}
		if(num == 0)
		{
			console_print(id,"No players in team %s",teamname);
			return PLUGIN_HANDLED;
		}
		for(i = 0;i < num;i++)
		{
			index = players;
			if(is_user_alive(index)) continue;
			Revive(index,hp,armor);
		}
		log_amx("ADMIN %s: Revive %s with %i hp and %i armor",name,teamname,hp,armor);
	} else {
		new target = cmd_target(id,arg,3);
		if(!target)
		return PLUGIN_HANDLED;
		if(is_user_alive(target))
		{
			console_print(id,"Player is allready alive !");
			return PLUGIN_HANDLED;
		}
		new namet[32]; 
		get_user_name(target,namet,31);
		Revive(target,hp,armor);
		log_amx("ADMIN %s: Revive %s with %i hp and %i armor",name,namet,hp,armor);
	}
	return PLUGIN_HANDLED;
}
Revive(index,hp,armor)
{
	set_pev(index,pev_deadflag,DEAD_RESPAWNABLE);
	set_pev(index,pev_iuser1,0);
	dllfunc(DLLFunc_Think,index);
	engfunc(EngFunc_SetOrigin,index,Float:{-4800.0,-4800.0,-4800.0});
	new array[3];
	array[0] = index;
	array[1] = hp;
	array[2] = armor
	set_task(0.5,"respawn",0,array,3);
	new name[32];
        get_user_name(id, name, 31);
        ColorChat(id, RED,"^x01[^x04HNS^x03R^x01] ADMIN-ul^x04 %s^x01 ti-a dat revive !");
}
public respawn(array[3])
{
	new index = array[0];
	new hp = array[1];
	new armor = array[2];
	new name[32];
        get_user_name(id, name, 31);
        ColorChat(id, RED,"^x01[^x04HNS^x03R^x01] ADMIN-ul^x04 %s^x01 ti-a dat revive !");
	if(is_user_connected(index))
	{
		dllfunc(DLLFunc_Spawn,index);
		set_pev(index,pev_health,float(hp));
		set_pev(index,pev_armorvalue,float(armor));
		switch(get_user_team(index))
        	{
            		case 1:
            		{
                		fm_give_item(index,"weapon_knife");
                		fm_give_item(index,"weapon_glock18");
                		fm_give_item(index,"ammo_9mm");
                		fm_give_item(index,"ammo_9mm");
                		fm_give_item(index,"ammo_9mm");
                		fm_give_item(index,"ammo_9mm");
            		}
            		case 2:
            		{
               		 	fm_give_item(index,"weapon_knife");
                		fm_give_item(index,"weapon_usp");
                		fm_give_item(index,"ammo_45acp");
                		fm_give_item(index,"ammo_45acp");
                		fm_give_item(index,"ammo_45acp");
                		fm_give_item(index,"ammo_45acp");
            		}
        	}
		Fade(index,0,255,0,30);
	}
}
stock fm_give_item(id,const item[])
{
	static ent
	ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, item));
	if(!pev_valid(ent)) return;
   
	static Float:originF[3]
	pev(id, pev_origin, originF);
	set_pev(ent, pev_origin, originF);
	set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN);
	dllfunc(DLLFunc_Spawn, ent);
   
	static save
	save = pev(ent, pev_solid);
	dllfunc(DLLFunc_Touch, ent, id);
	if(pev(ent,pev_solid) != save)
		return;
      
	engfunc(EngFunc_RemoveEntity, ent);
}
stock Fade(index,red,green,blue,alpha)
{
	message_begin(MSG_ONE,g_fade,{0,0,0},index);
	write_short(1<<10);
	write_short(1<<10);
	write_short(1<<12);
	write_byte(red);
	write_byte(green);
	write_byte(blue);
	write_byte(alpha);
	message_end();
}


Multumesc !
Image
RoyalServer
ReaD1nG
Membru, skill +1
Membru, skill +1
Posts: 237
Joined: 26 Jul 2013, 17:48
Detinator Steam: Da
Has thanked: 65 times
Been thanked: 13 times

18 Oct 2013, 19:07

UP ???
Image
User avatar
Rap^
Membru, skill +2
Membru, skill +2
Posts: 621
Joined: 01 Oct 2011, 00:25
Detinator Steam: Da
Reputatie: Fost Scripter eXtreamCS
Fost Super moderator
Location: Bucuresti
Has thanked: 16 times
Been thanked: 156 times

19 Oct 2013, 15:56

| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Ultimate Revive"
#define VERSION "1.1"
#define AUTHOR "anakin_cstrike"

// ColorChat Included

enum CC_Colors
{
	YELLOW = 1,	// 1; Yellow;		^x01;	default
	GREEN,		// 2; Green;		^x04
	TEAM_COLOR,	// 3; Red, Blue, Grey;	^x03;	teamcolor(t;ct;spec)
	GREY,		// 4; Grey;		Spectator Color
	RED,		// 5; Red;		Terrorist Color
	BLUE,		// 6; Blue;	Counter-Terrorist Color
}

new CC_TeamName[][] =
{
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
};

public ColorChat(id, CC_Colors:type, const msg[], {Float,Sql,Result,_}:...)
{
	if (get_playersnum() < 1)
	{
		return;
	}
	static CC_message[256];
	switch(type)
	{
		case YELLOW:
		{
			CC_message[0] = 0x01;
		}
		case GREEN:
		{
			CC_message[0] = 0x04;
		}
		default:
		{
			CC_message[0] = 0x03;
		}
	}
	vformat(CC_message[1], 251, msg, 4);
	CC_message[192] = '^0';
	new CC_team, CC_ColorChange, index, MSG_Type;
	if (!id)
	{
		index = CC_FindPlayer();
		MSG_Type = MSG_ALL;
	}
	else
	{
		MSG_Type = MSG_ONE;
		index = id;
	}
	CC_team = get_user_team(index);
	CC_ColorChange = CC_ColorSelection(index, MSG_Type, type);
	CC_ShowColorMessage(index, MSG_Type, CC_message);
	if (CC_ColorChange)
	{
		CC_TeamInfo(index, MSG_Type, CC_TeamName[CC_team]);
	}
}

CC_ShowColorMessage(index, type, message[])
{
	static CC_SayText;
	if (!CC_SayText)
	{
		CC_SayText = get_user_msgid("SayText");
	}
	message_begin(type, CC_SayText, _, index);
	write_byte(index);
	write_string(message);
	message_end();
}

CC_TeamInfo(index, type, team[])
{
	static CC_TeamInfo;
	if (!CC_TeamInfo)
	{
		CC_TeamInfo = get_user_msgid("TeamInfo");
	}
	message_begin(type, CC_TeamInfo, _, index);
	write_byte(index);
	write_string(team);
	message_end();
	return 1;
}

CC_ColorSelection(index, type, CC_Colors:Type)
{
	switch(Type)
	{
		case RED:
		{
			return CC_TeamInfo(index, type, CC_TeamName[1]);
		}
		case BLUE:
		{
			return CC_TeamInfo(index, type, CC_TeamName[2]);
		}
		case GREY:
		{
			return CC_TeamInfo(index, type, CC_TeamName[0]);
		}
	}
	return 0;
}

CC_FindPlayer()
{
	new index = -1;
	while(index <= get_maxplayers())
	{
		if (is_user_connected(++index))
		{
			return index;
		}
	}
	return -1;
}

new g_fade;
public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	register_concmd("amx_revive","revive_cmd",ADMIN_BAN,"- <player/@/@T/@CT> <hp> <armor>");
	g_fade = get_user_msgid("ScreenFade");
}
public revive_cmd(id,level,cid)
{
	if(!cmd_access(id,level,cid,4))
		return PLUGIN_HANDLED;
	new 
	arg[32],arg2[4],arg3[4],
	name[32],hp,armor;
	read_argv(1,arg,31);
	read_argv(2,arg2,3);
	read_argv(3,arg3,3);
        get_user_name(id, name, 31);
	new argc = read_argc();
	if(argc < 2) {hp = 100;armor = 0;}
	else if(argc == 3) {hp = str_to_num(arg2);armor = 0;}
	else {hp = str_to_num(arg2);armor = str_to_num(arg3);}
	if(arg[0] == '@')
	{
		new players[32],teamname[24],tname[16],num,index,i;
		if(arg[1])
		{
			if(arg[1] == 'T')
			{
				copy(tname,15,"TERRORIST");
				copy(teamname,23,"Terrorist");
			} else if(arg[1] == 'C' && arg[2] == 'T') {
				copy(tname,15,"CT");
				copy(teamname,23,"Counter-Terrorist");
			} else {
				console_print(id,"Usage: @T/@CT");
				return PLUGIN_HANDLED;
			}
			get_players(players,num,"be",tname);
		} else {
			get_players(players,num);
			copy(teamname,23,"All");
		}
		if(num == 0)
		{
			console_print(id,"No players in team %s",teamname);
			return PLUGIN_HANDLED;
		}
		for(i = 0;i < num;i++)
		{
			index = players;
			if(is_user_alive(index)) continue;
			Revive(id, index,hp,armor);
		}
		log_amx("ADMIN %s: Revive %s with %i hp and %i armor",name,teamname,hp,armor);
	} else {
		new target = cmd_target(id,arg,3);
		if(!target)
		return PLUGIN_HANDLED;
		if(is_user_alive(target))
		{
			console_print(id,"Player is allready alive !");
			return PLUGIN_HANDLED;
		}
		new namet[32]; 
		get_user_name(target,namet,31);
		Revive(id, target,hp,armor);
		log_amx("ADMIN %s: Revive %s with %i hp and %i armor",name,namet,hp,armor);
	}
	return PLUGIN_HANDLED;
}
Revive(id, index,hp,armor)
{
	set_pev(index,pev_deadflag,DEAD_RESPAWNABLE);
	set_pev(index,pev_iuser1,0);
	dllfunc(DLLFunc_Think,index);
	engfunc(EngFunc_SetOrigin,index,Float:{-4800.0,-4800.0,-4800.0});
	new array[3];
	array[0] = index;
	array[1] = hp;
	array[2] = armor
	set_task(0.5,"respawn",0,array,3);
	new aname[32];
        get_user_name(id, aname, 31);
	
	new name[32];
	get_user_name(index, name, 31);
	ColorChat(id, RED,"^x01[^x04HNS^x03R^x01] ADMIN-ul^x03 %s^x01 te-a reinviat^x04 %s",aname, name);
}
public respawn(array[3])
{
	new index = array[0];
	new hp = array[1];
	new armor = array[2];
	
	if(is_user_connected(index))
	{
		dllfunc(DLLFunc_Spawn,index);
		set_pev(index,pev_health,float(hp));
		set_pev(index,pev_armorvalue,float(armor));
		switch(get_user_team(index))
        	{
            		case 1:
            		{
                		fm_give_item(index,"weapon_knife");
                		fm_give_item(index,"weapon_glock18");
                		fm_give_item(index,"ammo_9mm");
                		fm_give_item(index,"ammo_9mm");
                		fm_give_item(index,"ammo_9mm");
                		fm_give_item(index,"ammo_9mm");
            		}
            		case 2:
            		{
               		 	fm_give_item(index,"weapon_knife");
                		fm_give_item(index,"weapon_usp");
                		fm_give_item(index,"ammo_45acp");
                		fm_give_item(index,"ammo_45acp");
                		fm_give_item(index,"ammo_45acp");
                		fm_give_item(index,"ammo_45acp");
            		}
        	}
		Fade(index,0,255,0,30);
	}
}
stock fm_give_item(id,const item[])
{
	static ent
	ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, item));
	if(!pev_valid(ent)) return;
   
	static Float:originF[3]
	pev(id, pev_origin, originF);
	set_pev(ent, pev_origin, originF);
	set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN);
	dllfunc(DLLFunc_Spawn, ent);
   
	static save
	save = pev(ent, pev_solid);
	dllfunc(DLLFunc_Touch, ent, id);
	if(pev(ent,pev_solid) != save)
		return;
      
	engfunc(EngFunc_RemoveEntity, ent);
}
stock Fade(index,red,green,blue,alpha)
{
	message_begin(MSG_ONE,g_fade,{0,0,0},index);
	write_short(1<<10);
	write_short(1<<10);
	write_short(1<<12);
	write_byte(red);
	write_byte(green);
	write_byte(blue);
	write_byte(alpha);
	message_end();
}
Imagination is more important than knowledge.
Knowledge is limited - Imagination encircles the world.
OneShot.
Membru, skill +2
Membru, skill +2
Posts: 719
Joined: 12 Sep 2011, 19:17
Detinator Steam: Da
Detinator server CS: drx.indungi.ro
SteamID: oneshot_01
Reputatie: Fost moderator ajutator
Nume anterior: OnlyHD
Location: Bucuresti
Has thanked: 196 times
Been thanked: 66 times
Contact:

19 Oct 2013, 16:19

Salut, conform regulamentului sectiuni: http://www.extreamcs.com/forum/cereri-c ... 18661.html ai la dispozitie 48H sa modifici numele topicului in unul mai concret, altfel topicul ajunge la cos.
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 23 guests