Никто не собирается за + делать что-то
/*
SM Weapon Cleanup bY TechKnow
*/
#include <sourcemod>
#include <sdktools>
#define MAX_WEAPONS 28
#define PLUGIN_VERSION "1.3"
new Handle:Cvar_Removeweapons;
new g_WeaponParent;
new String:WeaponNames[MAX_WEAPONS][64] =
{
"m249", "knife", "tmp", "mp5navy",
"flashbang", "hegrenade", "ump45", "p90",
"smokegrenade", "galil", "ak47", "scout",
"sg552", "awp", "g3sg1", "famas",
"m4a1", "aug", "sg550", "glock",
"usp", "p228", "deagle", "elite",
"fiveseven", "m3", "xm1014", "mac10"
};
public Plugin:myinfo =
{
name = "SM Weapon Cleanup",
author = "TechKnow",
description = "Removes loose weapons droped",
version = PLUGIN_VERSION,
url = "http://www.sourcemod.net/"
};
public OnPluginStart()
{
CreateConVar("sm_Weaponcleanup_version", PLUGIN_VERSION, "WeaponCleanup version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
Cvar_Removeweapons = CreateConVar("Removeweapons_on", "1", "1 Removeweapons on 0 is off", FCVAR_PLUGIN|FCVAR_REPLICATED|FCVAR_NOTIFY);
g_WeaponParent = FindSendPropOffs("CBaseCombatWeapon", "m_hOwnerEntity");
RegAdminCmd("sm_cleanup", Command_Manual, ADMFLAG_SLAY);
HookEventEx("player_death", Cleanup, EventHookMode_Post);
HookEventEx("round_start", Cleanup, EventHookMode_Post);
}
public Action:Cleanup(Handle:event,const String:name[],bool:dontBroadcast)
{
// By Kigen (c) 2008 - Please give me credit. :)
if (!GetConVarBool(Cvar_Removeweapons))
{
return Plugin_Continue;
}
new maxent = GetMaxEntities(), String:weapon[64];
for (new i=GetMaxClients();i<maxent;i++)
{
if ( IsValidEdict(i) && IsValidEntity(i) )
{
new String:weapons[64];
GetEdictClassname(i, weapon, sizeof(weapon));
if ( ( StrContains(weapon, weapons) != -1 || StrContains(weapon, "item_") != -1 ) && GetEntDataEnt2(i, g_WeaponParent) == -1 )
{
Format(weapons,sizeof(weapons),"weapon_%s",WeaponNames);
RemoveEdict(i);
}
}
}
return Plugin_Continue;
}
public Action:Command_Manual(client, args)
{
// By Kigen (c) 2008 - Please give me credit. :)
new maxent = GetMaxEntities(), String:weapon[64];
for (new i=GetMaxClients();i<maxent;i++)
{
if ( IsValidEdict(i) && IsValidEntity(i) )
{
new String:weapons[64];
GetEdictClassname(i, weapon, sizeof(weapon));
if ( ( StrContains(weapon, weapons) != -1 || StrContains(weapon, "item_") != -1 ) && GetEntDataEnt2(i, g_WeaponParent) == -1 )
{
Format(weapons,sizeof(weapons),"weapon_%s",WeaponNames);
RemoveEdict(i);
}
}
}
return Plugin_Continue;
}
Игорь Охремчук, Можешь сказать где у меня тут косяк?
PHP:/* SM Weapon Cleanup bY TechKnow */ #include <sourcemod> #include <sdktools> #define MAX_WEAPONS 28 #define PLUGIN_VERSION "1.3" new Handle:Cvar_Removeweapons; new g_WeaponParent; new String:WeaponNames[MAX_WEAPONS][64] = { "m249", "knife", "tmp", "mp5navy", "flashbang", "hegrenade", "ump45", "p90", "smokegrenade", "galil", "ak47", "scout", "sg552", "awp", "g3sg1", "famas", "m4a1", "aug", "sg550", "glock", "usp", "p228", "deagle", "elite", "fiveseven", "m3", "xm1014", "mac10" }; public Plugin:myinfo = { name = "SM Weapon Cleanup", author = "TechKnow", description = "Removes loose weapons droped", version = PLUGIN_VERSION, url = "http://www.sourcemod.net/" }; public OnPluginStart() { CreateConVar("sm_Weaponcleanup_version", PLUGIN_VERSION, "WeaponCleanup version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY); Cvar_Removeweapons = CreateConVar("Removeweapons_on", "1", "1 Removeweapons on 0 is off", FCVAR_PLUGIN|FCVAR_REPLICATED|FCVAR_NOTIFY); g_WeaponParent = FindSendPropOffs("CBaseCombatWeapon", "m_hOwnerEntity"); RegAdminCmd("sm_cleanup", Command_Manual, ADMFLAG_SLAY); HookEventEx("player_death", Cleanup, EventHookMode_Post); HookEventEx("round_start", Cleanup, EventHookMode_Post); } public Action:Cleanup(Handle:event,const String:name[],bool:dontBroadcast) { // By Kigen (c) 2008 - Please give me credit. :) if (!GetConVarBool(Cvar_Removeweapons)) { return Plugin_Continue; } new maxent = GetMaxEntities(), String:weapon[64]; for (new i=GetMaxClients();i<maxent;i++) { if ( IsValidEdict(i) && IsValidEntity(i) ) { new String:weapons[64]; GetEdictClassname(i, weapon, sizeof(weapon)); if ( ( StrContains(weapon, weapons) != -1 || StrContains(weapon, "item_") != -1 ) && GetEntDataEnt2(i, g_WeaponParent) == -1 ) { Format(weapons,sizeof(weapons),"weapon_%s",WeaponNames); RemoveEdict(i); } } } return Plugin_Continue; } public Action:Command_Manual(client, args) { // By Kigen (c) 2008 - Please give me credit. :) new maxent = GetMaxEntities(), String:weapon[64]; for (new i=GetMaxClients();i<maxent;i++) { if ( IsValidEdict(i) && IsValidEntity(i) ) { new String:weapons[64]; GetEdictClassname(i, weapon, sizeof(weapon)); if ( ( StrContains(weapon, weapons) != -1 || StrContains(weapon, "item_") != -1 ) && GetEntDataEnt2(i, g_WeaponParent) == -1 ) { Format(weapons,sizeof(weapons),"weapon_%s",WeaponNames); RemoveEdict(i); } } } return Plugin_Continue; }
Игорь Охремчук, самый прикол в том что он компилируется без ошибок.
Покажи как нужно было сделать, а то я учусь и пока очень мало что знаю, а хотел сделать чтоб бомбу не убирал.
Полностью подписываюсь под данными словами!!!Хотя мне этот плагин нах не нужен...Просто выражаю тоже благодарность Игорю и отправил ему большой + в репутацию...Игорю респект и уважуха!!!!Здравствуйте.
Игорь Охремчук а с поста номер 7 , плагин убирает все оружие кроме бомбы , я правильно понял?
P.S. И все таки хорошо , что на таких форумах, как этот, еще есть люди которые не давяться из-за бабла а могут как то помоч людям ,начинающим собирать сервера ,плагины.И таких как ты люди благодарят от всей души , не гаваря за спиной , сс*ка жмот .Уважуха тебе ИГОРЬ !!!
Форум состоит не только из контингента жлобов. Две строчки заменить ради плюсика не так уж и проблемно.