xKaeLx
Участник
- Сообщения
- 34
- Реакции
- 17
Он как написал я так и сделал )Ему наверняка нужен отсчет)
Он как написал я так и сделал )Ему наверняка нужен отсчет)
Сможешь код написать, чтобы при убийстве КТ через админку или же командой kill/explode - оружие не выпадало на пол?Он как написал я так и сделал )
НетСможешь код написать, чтобы при убийстве КТ через админку или же командой kill/explode - оружие не выпадало на пол?
А теперь для тупых, пожалуйста.Только если удалять оружие после спавна.
Но, я так понял, это уже не легкий код? И стоит заказать его?@Steammerr, как только игрок помирает, оружие его либо спавнится по новой, но уже в виде, доступном для поднятия, в мире, либо просто дропается.
Можно пробовать после смерти ловить все дропы или спавны оружия, и удалять сразу же.
Он как написал я так и сделал )
PrintToChatAll
вылезает окошко !msay
спасибо большоеC-подобный:public OnPluginStart() { RegAdminCmd("sm_serverrestart", ServerRestart, ADMFLAG_ROOT); } public Action:ServerRestart(client, args) { ServerCommand("sm_msay Перезапуск сервера через 10 секунд"); PrintToChatAll(" \x02[Server] \x04Перезапуск сервера через 10 секунд"); return Plugin_Handled; }![]()
Пишу kill и у меня счет уходит ниже 0PHP:public OnPluginStart() HookEvent("player_death", PlayerDeath); public PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast) { new client = GetClientOfUserId(GetEventInt(event, "userid")); if(GetClientFrags(client) < 0) SetEntProp(client, Prop_Data, "m_iFrags", 0); }
¯\_(ツ)_/¯ должно работать. После смерти игроку устанавливает значение фрагов '0', если они у него ниже '0'.Пишу kill и у меня счет уходит ниже 0
Вот 2 раза kill написал и только в минут идет¯\_(ツ)_/¯ должно работать. После смерти игроку устанавливает значение фрагов '0', если они у него ниже '0'.
Ох уж эта css(лично для меня), ну не играл я в нее, не играл.. Тьфу ты, точнее не держал сервера там.Вот 2 раза kill написал и только в минут идет
public OnPluginStart() HookEvent("player_death", PlayerDeath);
public Action:PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(GetClientFrags(client) < 0) SetEntProp(client, Prop_Data, "m_iFrags", 0);
}
ЛовиЧто делать???
Поможешь с этим?Проверить целостность компилятора. Должна быть папка include и файлы spcomp.exe, compile.exe
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <hosties>
#include <lastrequest>
#define HEBATTLE_VERSION "1.0.2"
new g_LREntryNum;
new LR_Player_Guard;
new LR_Player_Prisoner;
new String:g_sLR_Name[64];
new bool:IsThisLRInProgress = false;
new g_iHealth;
new starthp = 100;
new Handle:g_Cvar_Health;
public Plugin:myinfo =
{
name = "Last Request: HE Battle",
author = "Jason Bourne & Kolapsicle",
description = "",
version = HEBATTLE_VERSION,
url = ""
};
public OnPluginStart()
{
LoadTranslations("hebattle.phrases");
Format(g_sLR_Name, sizeof(g_sLR_Name), "%T", "LR Name", LANG_SERVER);
HookEvent("player_hurt", EventPlayerHurt, EventHookMode_Pre);
HookEvent("hegrenade_detonate", GrenadeDetonate);
g_iHealth = FindSendPropOffs("CCSPlayer", "m_iHealth");
if (g_iHealth == -1)
{
SetFailState("Error - Unable to get offset for CSSPlayer::m_iHealth");
}
g_Cvar_Health = CreateConVar("sm_hebattle_health", "100", "How much health should be given?", FCVAR_PLUGIN, true, 0.0, false);
CreateConVar("hebattle_version", HEBATTLE_VERSION, "Current Max Damage version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
AutoExecConfig(true, "hebattle");
}
public OnConfigsExecuted ()
{
starthp = GetConVarInt(g_Cvar_Health);
static bool:bAddedCustomLR = false;
if ( ! bAddedCustomLR)
{
g_LREntryNum = AddLastRequestToList(LR_Start, LR_Stop, g_sLR_Name);
bAddedCustomLR = true;
}
}
public OnPluginEnd()
{
RemoveLastRequestFromList(LR_Start, LR_Stop, g_sLR_Name);
}
public LR_Start(Handle:LR_Array, iIndexInArray)
{
new This_LR_Type = GetArrayCell(LR_Array, iIndexInArray, _:Block_LRType);
if (This_LR_Type == g_LREntryNum)
{
LR_Player_Prisoner = GetArrayCell(LR_Array, iIndexInArray, _:Block_Prisoner);
LR_Player_Guard = GetArrayCell(LR_Array, iIndexInArray, _:Block_Guard);
// check datapack value
new LR_Pack_Value = GetArrayCell(LR_Array, iIndexInArray, _:Block_Global1);
switch (LR_Pack_Value)
{
case -1:
{
PrintToServer("no info included");
}
}
SetEntityHealth(LR_Player_Prisoner, starthp);
SetEntityHealth(LR_Player_Guard, starthp);
StripAllWeapons(LR_Player_Prisoner);
StripAllWeapons(LR_Player_Guard);
GivePlayerItem(LR_Player_Prisoner, "weapon_hegrenade");
GivePlayerItem(LR_Player_Guard, "weapon_hegrenade");
IsThisLRInProgress = true;
PrintToChatAll(CHAT_BANNER, "LR Start", LR_Player_Prisoner, LR_Player_Guard);
}
}
public LR_Stop(This_LR_Type, Player_Prisoner, Player_Guard)
{
if (IsThisLRInProgress && This_LR_Type == g_LREntryNum)
{
LR_Player_Prisoner = Player_Prisoner;
LR_Player_Guard = Player_Guard;
if (IsPlayerAlive(LR_Player_Prisoner) && IsPlayerAlive(LR_Player_Guard))
{
SetEntityHealth(LR_Player_Prisoner, 100);
GivePlayerItem(LR_Player_Prisoner, "weapon_knife");
SetEntityHealth(LR_Player_Guard, 100);
GivePlayerItem(LR_Player_Guard, "weapon_knife");
PrintToChatAll(CHAT_BANNER, "LR No Winner");
} else if (IsPlayerAlive(LR_Player_Prisoner))
{
SetEntityHealth(LR_Player_Prisoner, 100);
GivePlayerItem(LR_Player_Prisoner, "weapon_knife");
PrintToChatAll(CHAT_BANNER, "LR Winner", LR_Player_Prisoner);
} else if (IsPlayerAlive(LR_Player_Guard))
{
SetEntityHealth(LR_Player_Guard, 100);
GivePlayerItem(LR_Player_Guard, "weapon_knife");
PrintToChatAll(CHAT_BANNER, "LR Winner", LR_Player_Guard);
}
}
IsThisLRInProgress = false;
}
public Action:EventPlayerHurt(Handle:event, const String:name[],bool:dontBroadcast)
{
new victim = GetClientOfUserId(GetEventInt(event, "userid"));
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
new dhealth = GetEventInt(event, "dmg_health");
new health = GetEventInt(event, "health");
if (IsThisLRInProgress && IsClientInLastRequest(victim))
{
decl String:wname[64];
GetEventString(event, "weapon", wname, sizeof(wname));
if (victim == LR_Player_Guard || victim == LR_Player_Prisoner)
{
if ( ! StrEqual(wname, "hegrenade", false) || (attacker != LR_Player_Prisoner && attacker != LR_Player_Guard))
{
SetEntData(victim, g_iHealth, (health + dhealth), 4, true);
}
}
}
return Plugin_Continue;
}
public Action:GrenadeDetonate(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(StrEqual(name, "hegrenade_detonate"))
{
if (IsThisLRInProgress && (client == LR_Player_Guard || client == LR_Player_Prisoner))
{
GivePlayerItem(client, "weapon_hegrenade");
}
}
return Plugin_Handled;
}
LR игра, когда Т выбирает ёё, то Т и КТ получают гранату, которой должны убить противника. Игра длится довольно долго, по этому хочу сделать ограничение по времени, как в том же Knife Fight.Уточнения, пожалуйста.
Тут много кода, чтобы разобраться, в каком случае и кого должно убивать.
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <hosties>
#include <lastrequest>
#define HEBATTLE_VERSION "1.0.2"
new g_LREntryNum;
new LR_Player_Guard;
new LR_Player_Prisoner;
new String:g_sLR_Name[64];
new bool:IsThisLRInProgress = false;
new g_iHealth;
new starthp = 100;
new Handle:g_Cvar_Health;
public Plugin:myinfo =
{
name = "Last Request: HE Battle",
author = "Jason Bourne & Kolapsicle",
description = "",
version = HEBATTLE_VERSION,
url = ""
};
public OnPluginStart()
{
LoadTranslations("hebattle.phrases");
Format(g_sLR_Name, sizeof(g_sLR_Name), "%T", "LR Name", LANG_SERVER);
HookEvent("player_hurt", EventPlayerHurt, EventHookMode_Pre);
HookEvent("hegrenade_detonate", GrenadeDetonate);
g_iHealth = FindSendPropOffs("CCSPlayer", "m_iHealth");
if (g_iHealth == -1)
{
SetFailState("Error - Unable to get offset for CSSPlayer::m_iHealth");
}
g_Cvar_Health = CreateConVar("sm_hebattle_health", "100", "How much health should be given?", FCVAR_PLUGIN, true, 0.0, false);
CreateConVar("hebattle_version", HEBATTLE_VERSION, "Current Max Damage version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
AutoExecConfig(true, "hebattle");
}
public OnConfigsExecuted ()
{
starthp = GetConVarInt(g_Cvar_Health);
static bool:bAddedCustomLR = false;
if ( ! bAddedCustomLR)
{
g_LREntryNum = AddLastRequestToList(LR_Start, LR_Stop, g_sLR_Name);
bAddedCustomLR = true;
}
}
public OnPluginEnd()
{
RemoveLastRequestFromList(LR_Start, LR_Stop, g_sLR_Name);
}
public LR_Start(Handle:LR_Array, iIndexInArray)
{
new This_LR_Type = GetArrayCell(LR_Array, iIndexInArray, _:Block_LRType);
if (This_LR_Type == g_LREntryNum)
{
LR_Player_Prisoner = GetArrayCell(LR_Array, iIndexInArray, _:Block_Prisoner);
LR_Player_Guard = GetArrayCell(LR_Array, iIndexInArray, _:Block_Guard);
// check datapack value
new LR_Pack_Value = GetArrayCell(LR_Array, iIndexInArray, _:Block_Global1);
switch (LR_Pack_Value)
{
case -1:
{
PrintToServer("no info included");
}
}
SetEntityHealth(LR_Player_Prisoner, starthp);
SetEntityHealth(LR_Player_Guard, starthp);
StripAllWeapons(LR_Player_Prisoner);
StripAllWeapons(LR_Player_Guard);
GivePlayerItem(LR_Player_Prisoner, "weapon_hegrenade");
GivePlayerItem(LR_Player_Guard, "weapon_hegrenade");
IsThisLRInProgress = true;
PrintToChatAll(CHAT_BANNER, "LR Start", LR_Player_Prisoner, LR_Player_Guard);
CreateTimer(60.0, LR_Timeout);
PrintCenterTextAll("Игра закончится через %d секунд!", 60);
}
}
public Action:LR_Timeout(Handle:hTimer, any:data) {
if (IsThisLRInProgress)
ForcePlayerSuicide((GetEntData(LR_Player_Guard, g_iHealth, 4) < GetEntData(LR_Player_Prisoner, g_iHealth, 4)) ? LR_Player_Guard : LR_Player_Prisoner);
}
public LR_Stop(This_LR_Type, Player_Prisoner, Player_Guard)
{
if (IsThisLRInProgress && This_LR_Type == g_LREntryNum)
{
LR_Player_Prisoner = Player_Prisoner;
LR_Player_Guard = Player_Guard;
if (IsPlayerAlive(LR_Player_Prisoner) && IsPlayerAlive(LR_Player_Guard))
{
SetEntityHealth(LR_Player_Prisoner, 100);
GivePlayerItem(LR_Player_Prisoner, "weapon_knife");
SetEntityHealth(LR_Player_Guard, 100);
GivePlayerItem(LR_Player_Guard, "weapon_knife");
PrintToChatAll(CHAT_BANNER, "LR No Winner");
} else if (IsPlayerAlive(LR_Player_Prisoner))
{
SetEntityHealth(LR_Player_Prisoner, 100);
GivePlayerItem(LR_Player_Prisoner, "weapon_knife");
PrintToChatAll(CHAT_BANNER, "LR Winner", LR_Player_Prisoner);
} else if (IsPlayerAlive(LR_Player_Guard))
{
SetEntityHealth(LR_Player_Guard, 100);
GivePlayerItem(LR_Player_Guard, "weapon_knife");
PrintToChatAll(CHAT_BANNER, "LR Winner", LR_Player_Guard);
}
}
IsThisLRInProgress = false;
}
public Action:EventPlayerHurt(Handle:event, const String:name[],bool:dontBroadcast)
{
new victim = GetClientOfUserId(GetEventInt(event, "userid"));
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
new dhealth = GetEventInt(event, "dmg_health");
new health = GetEventInt(event, "health");
if (IsThisLRInProgress && IsClientInLastRequest(victim))
{
decl String:wname[64];
GetEventString(event, "weapon", wname, sizeof(wname));
if (victim == LR_Player_Guard || victim == LR_Player_Prisoner)
{
if ( ! StrEqual(wname, "hegrenade", false) || (attacker != LR_Player_Prisoner && attacker != LR_Player_Guard))
{
SetEntData(victim, g_iHealth, (health + dhealth), 4, true);
}
}
}
return Plugin_Continue;
}
public Action:GrenadeDetonate(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(StrEqual(name, "hegrenade_detonate"))
{
if (IsThisLRInProgress && (client == LR_Player_Guard || client == LR_Player_Prisoner))
{
GivePlayerItem(client, "weapon_hegrenade");
}
}
return Plugin_Handled;
}