@Felton, такого параметра нету в исходники, его надо делать самому
HookEvent("player_spawn", player_spawn); - это событие спаун игрока
после как игрок появится, через 0,1 (ты поставил 2,0) секунду создается эта текстура вх и хокуеться на невидимость "SDKHook(ent,SDKHook_SetTransmit,Hook_SetTransmit);"
тебе нужно добавить:
1) Дополнительную глобальную массивную переменную bool
2) И когда игрок умирает создать таймер, чтоб видимость была доступна, скажем через 5 сек.
Создаем новую переменную g_IsVisib отвечающие за видимость вх-текстур
Создаем таймер для включения видимости, через 5,0 сек после смертиC-подобный:public Plugin:myinfo = { name = "WallHack", author = "wS (World-Source.Ru)", version = "1.1" }; new g_MySprite[MAXPLAYERS + 1]; new g_MySpriteRef[MAXPLAYERS + 1]; new bool:g_IsVisib[MAXPLAYERS + 1]; // Вот она
Ниже создаем событие OnVisib которое запускается через 5 сек после смерти включает видимостьC-подобный:public ClearEvent(Handle:event, const String:name[], bool:silent) { new client = GetClientOfUserId(GetEventInt(event, "userid")); wS_ClearSprite(client); // Узнаем название Hook-a decl String:sNameEvent[128]; GetEventName(event, sNameEvent, sizeof(sNameEvent)); // Сверяем название Hook-a if(StrEqual(sNameEvent, "player_death")) { //Если Hook это player_death создаем таймер CreateTimer(5.0, OnVisib, client); } }
Выключаем видимость:C-подобный:public Action:OnVisib(Handle:timer, any:client) { // Если он в игре включаем видимость вх-текстур if(IsClientInGame(client)) IsVisib[client] = true; }
Здесь проверяем на видимость1) Когда игрок спамиться2) Когда выходит с сервераC-подобный:public player_spawn(Handle:event, const String:name[], bool:silent) { new client = GetClientOfUserId(GetEventInt(event, "userid")); g_IsVisib[client] = false; CreateTimer(0.1, player_spawn_Timer, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE); }
C-подобный:public OnClientDisconnect(client) { wS_ClearSprite(client); g_IsVisib[client] = false; }
C-подобный:public Action:Hook_SetTransmit(entity, client) { if(entity == g_MySprite[client]) { return Plugin_Handled; //Скрываем } if(IsClientInGame(client) && GetAdmin(client)) { // Игрок не живой и Видимость разрещена if(!IsPlayerAlive(client) && g_IsVisib[client]) { return Plugin_Continue; //Показываем } } return Plugin_Handled; //Скрываем }
ОффтопХоть бы спасибо поставил, что я тебе код доделал в прошлый раз и сейчас разжевал
И покажи как ты сделал в этом событие "stock bool:GetAdmin(client)" флаги
--- Добавлено позже ---
@FBI, попробуй создай ее лесенкой
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#pragma tabsize 0
public Plugin:myinfo =
{
name = "WallHack",
author = "wS (World-Source.Ru)",
version = "1.1"
};
new g_MySprite[MAXPLAYERS + 1];
new g_MySpriteRef[MAXPLAYERS + 1];
public OnPluginStart()
{
HookEvent("player_spawn", player_spawn);
HookEvent("player_death", ClearEvent);
HookEvent("player_team", ClearEvent);
}
public OnMapStart()
{
AddFileToDownloadsTable("materials/sprites/player_blue_small22.vmt");
AddFileToDownloadsTable("materials/sprites/player_blue_small22.vtf");
AddFileToDownloadsTable("materials/sprites/player_red_small22.vmt");
AddFileToDownloadsTable("materials/sprites/player_red_small22.vtf");
PrecacheDecal("sprites/player_blue_small22.vmt", true);
PrecacheDecal("sprites/player_red_small22.vmt", true);
}
public ClearEvent(Handle:event, const String:name[], bool:silent)
{
wS_ClearSprite(GetClientOfUserId(GetEventInt(event, "userid")));
}
public player_spawn(Handle:event, const String:name[], bool:silent)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
CreateTimer(0.1, player_spawn_Timer, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);
}
public Action:player_spawn_Timer(Handle:timer, any:userid)
{
new client = GetClientOfUserId(userid);
if (client < 1) return Plugin_Stop;
wS_ClearSprite(client);
if (IsClientInGame(client) && !IsPlayerAlive(client)) return Plugin_Stop;
new ent = CreateEntityByName("env_sprite");
if (ent < 1)
{
LogError("env_sprite error");
return Plugin_Stop;
}
g_MySprite[client] = ent;
g_MySpriteRef[client] = EntIndexToEntRef(ent);
decl Float:pos[3]; GetClientAbsOrigin(client, pos); pos[2] += 50.0;
DispatchKeyValueVector(ent, "origin", pos);
DispatchKeyValue(ent, "model", GetClientTeam(client) == 2 ? "sprites/player_red_small22.vmt" : "sprites/player_blue_small22.vmt");
DispatchKeyValue(ent, "rendermode", "0");
DispatchKeyValue(ent, "renderfx", "0");
DispatchKeyValue(ent, "renderamt", "255");
DispatchKeyValue(ent, "scale", "0.5");
DispatchKeyValue(ent, "GlowProxySize", "61.0");
DispatchSpawn(ent);
SetVariantString("!activator");
AcceptEntityInput(ent, "SetParent", client, ent);
SDKHook(ent, SDKHook_SetTransmit, Hook_SetTransmit);
return Plugin_Stop;
}
public Action:Hook_SetTransmit(entity, client)
{
if(entity == g_MySprite[client])
{
return Plugin_Handled; //Скрываем
}
if(IsClientInGame(client) && GetAdmin(client))
{
if(!IsPlayerAlive(client))
{
return Plugin_Continue; //Показываем
}
}
return Plugin_Handled; //Скрываем
}
stock bool:GetAdmin(client)
{
new iFlags = GetUserFlagBits(client);
if(iFlags & ADMFLAG_ROOT) return true; // Root
if(iFlags & ADMFLAG_BAN) return true;
// d
return false;
}
stock wS_ClearSprite(client)
{
if (g_MySprite[client] > 0)
{
new ent = EntRefToEntIndex(g_MySpriteRef[client]);
if (ent > 0) AcceptEntityInput(ent, "Kill");
g_MySprite[client] = 0;
g_MySpriteRef[client] = 0;
}
}
public OnClientDisconnect(client)
{
wS_ClearSprite(client);
}
public OnMapStart()
{
AddFileToDownloadsTable("materials/sprites/player_blue_small22.vmt");
AddFileToDownloadsTable("materials/sprites/player_blue_small22.vtf");
AddFileToDownloadsTable("materials/sprites/player_red_small22.vmt");
AddFileToDownloadsTable("materials/sprites/player_red_small22.vtf");
PrecacheDecal("sprites/player_blue_small22.vmt", true);
PrecacheDecal("sprites/player_red_small22.vmt", true);
}
DispatchKeyValue(ent, "model", GetClientTeam(client) == 2 ? "sprites/player_red_small22.vmt" : "sprites/player_blue_small22.vmt");
Народ у кого есть эффекты для плагина VIP_Tracers_particles_effect
поделитесь, или подскажите где их можно взять....
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1
public Plugin:myinfo = {
name = "Give Weapon",
author = "Kiske & AlmazON edition",
description = "Give a weapon to a player from a command",
version = "1.0myself",
url = "http://www.sourcemod.net/"
};
new const String:g_weapons[][] = {
"ak47", "aug", "bizon", "deagle", "decoy", "elite", "famas", "fiveseven", "flashbang", "g3sg1", "galilar", "glock", "hegrenade", "hkp2000", "incgrenade",
"knife", "m249", "m4a1", "mac10", "mag7", "molotov", "mp7", "mp9", "negev", "nova", "p250", "p90", "sawedoff", "scar20", "sg556", "smokegrenade", "ssg08",
"taser", "tec9", "ump45", "xm1014", "awp", "m4a1_silencer", "knifegg"
};
public OnPluginStart()
{
RegAdminCmd("sm_weapon", smWeapon, ADMFLAG_CUSTOM3, "Specify the name of the weapon <weaponname>");
RegAdminCmd("sm_weaponlist", smWeaponList, ADMFLAG_CUSTOM3, "List of the weapon names.");
}
public Action:smWeapon(id, args)
{
if(id)
{
if(args == 1)
{
decl String:weapon[32];
GetCmdArg(1, weapon, sizeof(weapon));
for(new i; i < sizeof(g_weapons); ++i)
{
if(!strcmp(weapon, g_weapons[i]))
{
FormatEx(weapon, sizeof(weapon), "weapon_%s", g_weapons[i]);
if(GivePlayerItem(id, weapon) == -1) PrintToChat(id, "Оружие %s не поддерживается текущей игрой.", weapon);
return Plugin_Handled;
}
}
PrintToChat(id, "[SM] Необозначенное имя оружия (%s)", weapon);
}
else PrintToChat(id, "[SM] Используйте: sm_weapon <weaponname>");
}
return Plugin_Handled;
}
public Action:smWeaponList(id, args)
{
for(new i; i < sizeof(g_weapons); ++i)
ReplyToCommand(id, "%s", g_weapons[i]);
return Plugin_Handled;
}
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1
#pragma newdecls required
public Plugin myinfo = {
url = "http://www.sourcemod.net/",
name = "Give Weapon",
author = "Kiske & AlmazON edition",
version = "1.0myself",
description = "Give a weapon to a player from a command"
};
static const char g_szClassWeapons[][] = {
"ak47", "aug", "bizon", "deagle", "decoy", "elite", "famas", "fiveseven", "flashbang", "g3sg1", "galilar", "glock", "hegrenade", "hkp2000", "incgrenade",
"knife", "m249", "m4a1", "mac10", "mag7", "molotov", "mp7", "mp9", "negev", "nova", "p250", "p90", "sawedoff", "scar20", "sg556", "smokegrenade", "ssg08",
"taser", "tec9", "ump45", "xm1014", "awp", "m4a1_silencer", "knifegg"
};
static const char g_szDrawWeapons[][] = {
"AK-47", "AUG", "Бизон", "Desert Eagle", "Decoy", "Elite", "Famas", "Five Seven", "Световая граната", "G3SG1", "Galil-AR", "Glock", "Граната", "HKP2000", "IncGrenade",
"Нож", "M249", "M4A1", "Mac10", "Mag7", "Коктейль Молотова", "MP7", "MP9", "Negev", "Nova", "P250", "P90", "SawedOff", "Scar20", "SG556", "Дымовая граната", "SSG08",
"Тазер", "Tec 9", "UMP-45", "XM1014", "AWP", "M4A1 с глушителем", "Нож (???)"
};
public void OnPluginStart() {
RegAdminCmd("sm_weapon", smWeapon, ADMFLAG_CUSTOM3);
}
public Action smWeapon(int iClient, int iArgs) {
if (iClient) {
Menu hMenu = new Menu(MenuHndl);
hMenu.SetTitle("Выберите оружие:\n ");
for (int i = 0; i < sizeof(g_szDrawWeapons); i++)
hMenu.AddItem(g_szClassWeapons[i], g_szDrawWeapons[i], ITEMDRAW_DEFAULT);
hMenu.Display(iClient, 0);
} else {
ReplyToCommand(iClient, "[SM] Use this command in-game!");
}
return Plugin_Handled;
}
public int MenuHndl(Menu menu, MenuAction action, int iClient, int iSelectedItem) {
if (action == MenuAction_Select) {
char szClassName[32];
char szDisplayName[48];
menu.GetItem(iSelectedItem, szClassName, sizeof(szClassName), _, szDisplayName, sizeof(szDisplayName));
Format(szClassName, sizeof(szClassName), "weapon_%s", szClassName);
if (GivePlayerItem(iClient, szClassName) == -1) {
PrintToChat(iClient, "[SM] Оружие %s не поддерживается текущей игрой.", szDisplayName);
}
} else if (action == MenuAction_End) {
delete menu;
}
}
Это на все пушки или как?@Rodion1488,
PHP:#include <sourcemod> #include <sdktools> #pragma semicolon 1 #pragma newdecls required public Plugin myinfo = { url = "http://www.sourcemod.net/", name = "Give Weapon", author = "Kiske & AlmazON edition", version = "1.0myself", description = "Give a weapon to a player from a command" }; static const char g_szClassWeapons[][] = { "ak47", "aug", "bizon", "deagle", "decoy", "elite", "famas", "fiveseven", "flashbang", "g3sg1", "galilar", "glock", "hegrenade", "hkp2000", "incgrenade", "knife", "m249", "m4a1", "mac10", "mag7", "molotov", "mp7", "mp9", "negev", "nova", "p250", "p90", "sawedoff", "scar20", "sg556", "smokegrenade", "ssg08", "taser", "tec9", "ump45", "xm1014", "awp", "m4a1_silencer", "knifegg" }; static const char g_szDrawWeapons[][] = { "AK-47", "AUG", "Бизон", "Desert Eagle", "Decoy", "Elite", "Famas", "Five Seven", "Световая граната", "G3SG1", "Galil-AR", "Glock", "Граната", "HKP2000", "IncGrenade", "Нож", "M249", "M4A1", "Mac10", "Mag7", "Коктейль Молотова", "MP7", "MP9", "Negev", "Nova", "P250", "P90", "SawedOff", "Scar20", "SG556", "Дымовая граната", "SSG08", "Тазер", "Tec 9", "UMP-45", "XM1014", "AWP", "M4A1 с глушителем", "Нож (???)" }; public void OnPluginStart() { RegAdminCmd("sm_weapon", smWeapon, ADMFLAG_CUSTOM3); } public Action smWeapon(int iClient, int iArgs) { if (iClient) { Menu hMenu = new Menu(MenuHndl); hMenu.SetTitle("Выберите оружие:\n "); for (int i = 0; i < sizeof(g_szDrawWeapons); i++) hMenu.AddItem(g_szClassWeapons[i], g_szDrawWeapons[i], ITEMDRAW_DEFAULT); hMenu.Display(iClient, 0); } else { ReplyToCommand(iClient, "[SM] Use this command in-game!"); } return Plugin_Handled; } public int MenuHndl(Menu menu, MenuAction action, int iClient, int iSelectedItem) { if (action == MenuAction_Select) { char szClassName[32]; char szDisplayName[48]; menu.GetItem(iSelectedItem, szClassName, sizeof(szClassName), _, szDisplayName, sizeof(szDisplayName)); Format(szClassName, sizeof(szClassName), "weapon_%s", szClassName); if (GivePlayerItem(iClient, szClassName) == -1) { PrintToChat(iClient, "[SM] Оружие %s не поддерживается текущей игрой.", szDisplayName); } } }
static const char g_szClassWeapons[][] = {
"ak47", "aug", "bizon", "deagle", "decoy", "elite", "famas", "fiveseven", "flashbang", "g3sg1", "galilar", "glock", "hegrenade", "hkp2000", "incgrenade",
"knife", "m249", "m4a1", "mac10", "mag7", "molotov", "mp7", "mp9", "negev", "nova", "p250", "p90", "sawedoff", "scar20", "sg556", "smokegrenade", "ssg08",
"taser", "tec9", "ump45", "xm1014", "awp", "m4a1_silencer", "knifegg"
};
Да,уже открыл,понял))