Modificare plugin gifts

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 .
#Vali
Fost moderator
Fost moderator
Posts: 2611
Joined: 24 Jan 2012, 11:00
Detinator Steam: Da
SteamID: id/spryt3
Reputatie: Fost Moderator
Fost Scripter eXtreamCS.com
1.2 / 3
Location: root
Has thanked: 81 times
Been thanked: 144 times
Contact:

27 Dec 2012, 17:43

tragi sma=ul pe programul compile sau intri in compile si scrii numele pluginului
RoyalServer 2
User avatar
SimeriaIonut
Fost moderator
Fost moderator
Posts: 261
Joined: 17 Apr 2010, 15:28
Detinator Steam: Da
Detinator server CS: XMAS.EXTREAMCS.COM
SteamID: _lvl4nticore_
Reputatie: Owner xmas.extreamcs.com
Fost moderator ajutator
Has thanked: 14 times
Been thanked: 23 times
Contact:

27 Dec 2012, 17:47

1.Intri in amxmodx/scripting/include si pui fisierul colorchat.inc

2.Intri in amxmodx/scripting si pui pluginul .sma (plugin-ul de cadouri)

3.Tii apasat pe fisierul .sma (plugin-ul de cadouri) si il pui peste programul compile.exe (drag & drop)

4. Se va crea un fisier automat numit compiled. Acolo iti vei gasi plugin-ul .amxx
XMAS.EXTREAMCS.COM #Official Christmas Mod 2024 [❄️🎅🎄🎁]
User avatar
kabeza
Membru, skill +2
Membru, skill +2
Posts: 774
Joined: 09 Dec 2012, 19:30
Detinator Steam: Da
Has thanked: 76 times
Been thanked: 23 times

27 Dec 2012, 22:31

Imi dati si mie un link pentru compile.exe (drag & drop)
Simeria-Multumesc
CLICK & JOIN!
Image
User avatar
Ulquiorra
Fost moderator
Fost moderator
Posts: 2053
Joined: 25 Jul 2010, 17:29
Detinator Steam: Da
CS Status: A mai trecut o zi asteptand una mai buna
Detinator server CS: Retras.
SteamID: STEAM_0:1:318247XX
Reputatie: Fost Scripter eXtreamCS
Fost Moderator ajutator
Nick anterior: Askhanar
Location: Braila, Romania.
Has thanked: 215 times
Been thanked: 1132 times

29 Dec 2012, 23:27

ti-am inclus colorchat in .sma.. vezi de`l poti compila... momentan nu am inca compiler in pc.
| Afiseaza codul
#include < amxmodx >

#include < cstrike >
#include < hamsandwich >

#include < fakemeta >
#include < engine >

#include < fun >
#include < cellarray >
#include < xs >

#pragma semicolon 1


#define PLUGIN "FMU Gifts"
#define VERSION "0.3.2b"

/* --| ColorChat |-- */

enum Color
{
	NORMAL = 1, 		// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
	GREEN, 			// Culoare Verde.
	TEAM_COLOR, 		// Culoare Rosu, Albastru, Gri.
	GREY, 			// Culoarea Gri.
	RED, 			// Culoarea Rosu.
	BLUE, 			// Culoarea Albastru.
};

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

/* --| ColorChat |-- */


/* Extras din Super Spawns */
#define SS_VERSION	"1.0"
#define SS_MIN_DISTANCE	250.0
#define SS_MAX_LOOPS	100000

new Array:g_vecSsOrigins;
new Array:g_vecSsSpawns;
new Array:g_vecSsUsed;
new Float:g_flSsMinDist;
new g_iSsTime;

new const g_szStarts[][] =
{
	"info_player_start",
	"info_player_deathmatch"
};

new const Float:g_flOffsets[] =
{
	3500.0,
	3500.0,
	1500.0
};

enum
{
	
	GIFT_HP, 
	GIFT_AP,
	GIFT_HP_AP,
	GIFT_MONEY,
	GIFT_HE
	
}

new const g_szFmuGiftsModels[  7  ][   ]  =
{
	
	"models/fmu_gift_cyan.mdl",
	"models/fmu_gift_green.mdl",
	"models/fmu_gift_orange.mdl",
	"models/fmu_gift_pink.mdl",
	"models/fmu_gift_red.mdl",
	"models/fmu_gift_yellow.mdl",
	"models/fmu_gift_random.mdl"
	
};

new const g_iFmuGiftsColors[  7  ][  3  ]  =
{
	{ 0, 255, 255 },
	{ 0, 255, 125 },
	{ 255, 125, 65 },
	{ 255, 0, 125 },
	{ 255, 25, 25 },
	{ 255, 255, 0 },
	{ 255, 255, 255 }
};


new const g_szFmuGiftClassName[    ]  =  "fmu_gift";
new const FMU_TAG[    ]  =  "[Furien Gifts]";

// Floats
new Float:fMaxs[ 3 ]  =  {  13.0, 13.0, 35.0  };
new Float:fMins[ 3 ]  =  {  -13.0, -13.0, 0.0  };

new gCvarGiftHP;
new gCvarGiftAP;
new gCvarGiftMoney;

new gCvarEnableRespawn;
new gCvarRespawnTime;
new gCvarGiftsNum;

public plugin_precache(    )
{
	
	for( new i = 0; i < 7; i++ )
	{
		precache_model( g_szFmuGiftsModels[ i ] );
	}
	
}
		
public plugin_init( )
{
	//Autor original al plugin-ului: KronoS .
	//Am pornit acest plugin pe baza plugin`ului facut de el.
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	gCvarGiftHP = register_cvar( "fmu_gifts_hp", "25" );
	gCvarGiftAP = register_cvar( "fmu_gifts_ap", "25" );
	gCvarGiftMoney = register_cvar( "fmu_gifts_money", "5500" );
	
	gCvarEnableRespawn = register_cvar( "fmu_enable_giftsrespawn", "1" );
	gCvarRespawnTime = register_cvar( "fmu_gifts_respawntime", "45" );
	gCvarGiftsNum = register_cvar( "fmu_gifts_num", "35" );
	
	register_clcmd( "amx_reloadgifts", "ClCmdReloadGifts" );
	register_touch( g_szFmuGiftClassName, "player", "FwdPlayerTouchGift" );
	
	SsInit(800.0);
	SsScan();
	
	LoadAllGifts( );
}

public ClCmdReloadGifts( id )
{
	if( !( get_user_flags( id ) & ADMIN_CFG ) )
		return 1;
		
	SsClean();
	SsInit(800.0);
	SsScan();
	
	new iFoundEntity;

	while ( ( iFoundEntity = find_ent_by_class(  iFoundEntity, g_szFmuGiftClassName  ) )  !=  0  )
	{
		engfunc( EngFunc_RemoveEntity, iFoundEntity );
	}
	
	LoadAllGifts( );
	
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	ColorChat( 0, RED, "^x04%s^x01 Adminul^x03 %s^x01 a reincarcat toate cadourile de pe harta!", FMU_TAG, szName );
	return 1;
}

public FwdPlayerTouchGift(  const iEnt, const id  )
{
	
	if( is_valid_ent(  iEnt  )  && ( 1 <= id <= 32 ) &&  is_user_alive(  id  )  )
	{
		
		if( get_pcvar_num( gCvarEnableRespawn ) )
		{
			new iParm[ 3 ];
			new Float:flOrigin[ 3 ], iOrigin[ 3 ];
			
			entity_get_vector( iEnt, EV_VEC_origin, flOrigin );
			
			FVecIVec( flOrigin, iOrigin );
			iParm[ 0 ] = iOrigin[ 0 ];
			iParm[ 1 ] = iOrigin[ 1 ];
			iParm[ 2 ] = iOrigin[ 2 ];
			
			set_task( float( get_pcvar_num( gCvarRespawnTime ) ), "Respawn_Entity", _, iParm, 3 );
			
		}
		
		
		new iRandomGift = random_num( GIFT_HP, GIFT_HE );
		while(  iRandomGift  ==  GIFT_HE   &&  user_has_weapon(  id,  CSW_HEGRENADE  )  )
			iRandomGift = random_num( GIFT_HP, GIFT_HE );
			
		GivePlayerGift( id, iRandomGift );
		remove_entity( iEnt  );
		
	}
	
	return 0;
}

public GivePlayerGift(  id, const  iGiftType  )
{
	
	switch(  iGiftType  )
	{
		
		case GIFT_HP:
		{
			set_user_health(  id,  get_user_health(  id  )  +  get_pcvar_num( gCvarGiftHP )  );
			ColorChat(  id, RED,  "^x04%s^x01 Mosul ti-a oferit cadou^x03 %i HP^x01!",  FMU_TAG, get_pcvar_num( gCvarGiftHP )  );
			
		}
		case GIFT_AP:
		{
			set_user_armor(  id,  get_user_armor(  id  )  +  get_pcvar_num( gCvarGiftAP ) );
			ColorChat(  id, RED,  "^x04%s^x01 Mosul ti-a oferit cadou^x03 %i AP^x01!",  FMU_TAG, get_pcvar_num( gCvarGiftAP )  );
			
		}
		case GIFT_HP_AP:
		{
			static iHP;
			iHP = get_pcvar_num( gCvarGiftHP );
			static iAP;
			iAP = get_pcvar_num( gCvarGiftAP );
			set_user_health(  id,  get_user_health(  id  )  +  iHP  );
			set_user_armor(  id,  get_user_armor(  id  )  +  iAP  );
			
			ColorChat(  id, RED,  "^x04%s^x01 Mosul ti-a oferit cadou^x03 %i HP^x01 si^x03 %i AP^x01!",  FMU_TAG, iHP, iAP );
		}
		case GIFT_MONEY:
		{
			cs_set_user_money(  id,  clamp(  cs_get_user_money(  id  )  +  get_pcvar_num( gCvarGiftMoney ), 0, 16000  )  );
			ColorChat(  id, RED,  "^x04%s^x01 Mosul ti-a oferit cadou^x03 %i$^x01!",  FMU_TAG, get_pcvar_num( gCvarGiftMoney ) );
		}
		case GIFT_HE:
		{
			
			give_item(  id,  "weapon_hegrenade"  );
			ColorChat(  id, RED,  "^x04%s^x01 Mosul ti-a oferit cadou un^x03 HE^x01!",  FMU_TAG  );
			
		}
		
	}
}

public Respawn_Entity( iParm[ ] )
{
	new Float:flOrigin[ 3 ], iOrigin[ 3 ];
	
	iOrigin[ 0 ] = iParm[ 0 ];
	iOrigin[ 1 ] = iParm[ 1 ];
	iOrigin[ 2 ] = iParm[ 2 ];
	
	IVecFVec( iOrigin, flOrigin );
	CreateGift(  flOrigin );
	
	return 0;
}
	
public CreateGift(  const Float:fOrigin[ 3 ] )
{
	
	new iEnt = create_entity( "info_target" );
	if ( !is_valid_ent(iEnt) ) return 0;
	
	new iRandom = random_num( 0, 6 );
	
	entity_set_string(  iEnt, EV_SZ_classname, g_szFmuGiftClassName  );
	entity_set_origin(  iEnt, fOrigin  );
	entity_set_model(  iEnt, g_szFmuGiftsModels[  iRandom  ]  );
	entity_set_int(  iEnt, EV_INT_movetype, MOVETYPE_NONE  );
	entity_set_int(  iEnt, EV_INT_solid, SOLID_BBOX );
	entity_set_size(  iEnt, fMins, fMaxs  );
	
	set_rendering( iEnt,
			kRenderFxGlowShell,
			g_iFmuGiftsColors[ iRandom ][ 0 ],
			g_iFmuGiftsColors[ iRandom ][ 1 ],
			g_iFmuGiftsColors[ iRandom ][ 2 ],
			kRenderNormal,
			255 );
	
	drop_to_floor(  iEnt  );
	
	return 1;
}

public LoadAllGifts( )
{
	
	new Float:fOrigin[ 3 ];
	
	for( new i = 1; i <= get_pcvar_num( gCvarGiftsNum ); i++ )
		if( SsGetOrigin( fOrigin ) )
			CreateGift( fOrigin );
	
		
}


/*====================================
========Inceput Super Spawns========*/

public SsInit(Float:mindist)
{
	
	register_cvar("sv_superspawns", SS_VERSION, (FCVAR_SERVER|FCVAR_SPONLY));
	register_concmd("_ss_dump", "SsDump");

	g_flSsMinDist = mindist;
	g_vecSsOrigins = ArrayCreate(3, 1);
	g_vecSsSpawns = ArrayCreate(3, 1);
	g_vecSsUsed = ArrayCreate(3, 1);
}

stock SsClean()
{
	g_flSsMinDist = 0.0;
	ArrayClear(g_vecSsOrigins);
	ArrayClear(g_vecSsSpawns);
	ArrayClear(g_vecSsUsed);
}

stock SsGetOrigin(Float:origin[3])
{
	new Float:data[3], size;
	new ok = 1;

	while((size = ArraySize(g_vecSsOrigins)))
	{
		new idx = random_num(0, size - 1);

		ArrayGetArray(g_vecSsOrigins, idx, origin);

		new used = ArraySize(g_vecSsUsed);
		for(new i = 0; i < used; i++)
		{
			ok = 0;
			ArrayGetArray(g_vecSsUsed, i, data);
			if(get_distance_f(data, origin) >= g_flSsMinDist)
			{
				ok = 1;
				break;
			}
		}

		ArrayDeleteItem(g_vecSsOrigins, idx);
		if(ok)
		{
			ArrayPushArray(g_vecSsUsed, origin);
			return true;
		}
	}
	return false;
}

public SsDump()
{
	new Float:origin[3];
	new count = ArraySize(g_vecSsOrigins);
	server_print("-------------------------------------------------------");
	for(new i = 0; i < count; i++)
	{
		ArrayGetArray(g_vecSsOrigins, i, origin);
		server_print("Origin: %f %f %f", origin[0], origin[1], origin[2]);
	}
	server_print("-------------------------------------------------------");
	server_print("Number of origins: %i", count);
	server_print("Time: %i", g_iSsTime);
	server_print("-------------------------------------------------------");
}

public SsScan()
{
	new start, Float:origin[3], starttime;
	starttime = get_systime();
	for(start = 0; start < sizeof(g_szStarts); start++)
	{
		server_print("Searching for %s", g_szStarts[start]);
		new ent;
		if((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", g_szStarts[start])))
		{
			new counter;
			pev(ent, pev_origin, origin);
			ArrayPushArray(g_vecSsSpawns, origin);
			while(counter < SS_MAX_LOOPS)
			{
				counter = GetLocation(origin, counter);
			}
		}
	}
	g_iSsTime = get_systime();
	g_iSsTime -= starttime;
}

GetLocation(Float:start[3], &counter)
{
	new Float:end[3];
	for(new i = 0; i < 3; i++)
	{
		end += random_float(0.0 - g_flOffsets, g_flOffsets);
	}

	if(IsValid(start, end))
	{
		start[0] = end[0];
		start[1] = end[1];
		start[2] = end[2];
		ArrayPushArray(g_vecSsOrigins, end);
	}
	counter++;
	return counter;
}

IsValid(Float:start[3], Float:end[3])
{
	SetFloor(end);
	end[2] += 36.0;
	new point = engfunc(EngFunc_PointContents, end);
	if(point == CONTENTS_EMPTY)
	{
		if(CheckPoints(end) && CheckDistance(end) && CheckVisibility(start, end))
		{
			if(!trace_hull(end, HULL_LARGE, -1))
			{
				return true;
			}
		}
	}
	return false;
}

CheckVisibility(Float:start[3], Float:end[3])
{
	new tr;
	engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, -1, tr);
	return (get_tr2(tr, TR_pHit) < 0);
}

SetFloor(Float:start[3])
{
	new tr, Float:end[3];
	end[0] = start[0];
	end[1] = start[1];
	end[2] = -99999.9;
	engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, -1, tr);
	get_tr2(tr, TR_vecEndPos, start);
}

CheckPoints(Float:origin[3])
{
	new Float:data[3], tr, point;
	data[0] = origin[0];
	data[1] = origin[1];
	data[2] = 99999.9;
	engfunc(EngFunc_TraceLine, origin, data, DONT_IGNORE_MONSTERS, -1, tr);
	get_tr2(tr, TR_vecEndPos, data);
	point = engfunc(EngFunc_PointContents, data);
	if(point == CONTENTS_SKY && get_distance_f(origin, data) < 250.0)
	{
		return false;
	}
	data[2] = -99999.9;
	engfunc(EngFunc_TraceLine, origin, data, DONT_IGNORE_MONSTERS, -1, tr);
	get_tr2(tr, TR_vecEndPos, data);
	point = engfunc(EngFunc_PointContents, data);
	if(point < CONTENTS_SOLID)
		return false;
	
	return true;
}

CheckDistance(Float:origin[3])
{
	new Float:dist, Float:data[3];
	new count = ArraySize(g_vecSsSpawns);
	for(new i = 0; i < count; i++)
	{
		ArrayGetArray(g_vecSsSpawns, i, data);
		dist = get_distance_f(origin, data);
		if(dist < SS_MIN_DISTANCE)
			return false;
	}

	count = ArraySize(g_vecSsOrigins);
	for(new i = 0; i < count; i++)
	{
		ArrayGetArray(g_vecSsOrigins, i, data);
		dist = get_distance_f(origin, data);
		if(dist < SS_MIN_DISTANCE)
			return false;
	}

	return true;
}

/*====================================
========Sfarsit Super Spawns========*/


/* --| ColorChat |-- */

ColorChat(  id, Color:iType, const msg[  ], { Float, Sql, Result, _}:...  )
{
	
	// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
	if( !get_playersnum( ) ) return;
	
	new szMessage[ 256 ];

	switch( iType )
	{
		 // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
		case NORMAL:	szMessage[ 0 ] = 0x01;
		
		// Culoare Verde.
		case GREEN:	szMessage[ 0 ] = 0x04;
		
		// Alb, Rosu, Albastru.
		default: 	szMessage[ 0 ] = 0x03;
	}

	vformat(  szMessage[ 1 ], 251, msg, 4  );

	// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
	szMessage[ 192 ] = '^0';
	

	new iTeam, iColorChange, iPlayerIndex, MSG_Type;
	
	if( id )
	{
		MSG_Type  =  MSG_ONE_UNRELIABLE;
		iPlayerIndex  =  id;
	}
	else
	{
		iPlayerIndex  =  CC_FindPlayer(  );
		MSG_Type = MSG_ALL;
	}
	
	iTeam  =  get_user_team( iPlayerIndex );
	iColorChange  =  CC_ColorSelection(  iPlayerIndex,  MSG_Type, iType);

	CC_ShowColorMessage(  iPlayerIndex, MSG_Type, szMessage  );
		
	if(  iColorChange  )	CC_Team_Info(  iPlayerIndex, MSG_Type,  TeamName[ iTeam ]  );

}

CC_ShowColorMessage(  id, const iType, const szMessage[  ]  )
{
	
	static bool:bSayTextUsed;
	static iMsgSayText;
	
	if(  !bSayTextUsed  )
	{
		iMsgSayText  =  get_user_msgid( "SayText" );
		bSayTextUsed  =  true;
	}
	
	message_begin( iType, iMsgSayText, _, id  );
	write_byte(  id  );		
	write_string(  szMessage  );
	message_end(  );
}

CC_Team_Info( id, const iType, const szTeam[  ] )
{
	static bool:bTeamInfoUsed;
	static iMsgTeamInfo;
	if(  !bTeamInfoUsed  )
	{
		iMsgTeamInfo  =  get_user_msgid( "TeamInfo" );
		bTeamInfoUsed  =  true;
	}
	
	message_begin( iType, iMsgTeamInfo, _, id  );
	write_byte(  id  );
	write_string(  szTeam  );
	message_end(  );

	return 1;
}

CC_ColorSelection(  id, const iType, Color:iColorType)
{
	switch(  iColorType  )
	{
		
		case RED:	return CC_Team_Info(  id, iType, TeamName[ 1 ]  );
		case BLUE:	return CC_Team_Info(  id, iType, TeamName[ 2 ]  );
		case GREY:	return CC_Team_Info(  id, iType, TeamName[ 0 ]  );

	}

	return 0;
}

CC_FindPlayer(  )
{
	new iMaxPlayers  =  get_maxplayers(  );
	
	for( new i = 1; i <= iMaxPlayers; i++ )
		if(  is_user_connected( i )  )
			return i;
	
	return -1;
}

/* --| ColorChat |-- */



LE: plugin`ul are un singur bug.
pe unele harti gen de_alexandra sau de_italy_blast.. sau harti care te poti urca pe harta ( nu cladirile concepute pentru asa ceva.. ci restul.. pereti sau eu stiu acoperisuri ), apar cadourile si in locurile alea.. adica pe harta.

de ex pe de_nuke_rarea.. apar cadouri si pe muntii / peretii laterali de la T spawn.. ( baza tero )
Caut o persoana dedicata care se pricepe si stie ce face.
Vreau sa creeze si sa se ocupe de administrarea unui server de MU, da e vorba de vechiul joc..ma gandesc undeva la un season 3 ep1/2.

O sa achizitionez un domeniu .ro.
Totodata sponsorizez absolut orice este necesar.
Ma puteti contacta prin: http://solo.to/stfrzv
User avatar
Hades Ownage
Membru eXtream
Membru eXtream
Posts: 3182
Joined: 22 Oct 2008, 10:12
Detinator Steam: Da
Detinator server CS: jb.clutch.ro
SteamID: hades-source
Reputatie: Fost Super Moderator
Fost Scripter eXtreamCS
Nume anterior: hadesownage
Location: Iasi
Has thanked: 324 times
Been thanked: 406 times

30 Dec 2012, 08:59

Gata compliat, click
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests