Где воть туть ошибочки ну кроме вопросительных знаков ? Заранее большое спасибоnew PlVers:__version = 5;
new Float:NULL_VECTOR[3];
new String:NULL_STRING[1];
new Extension:__ext_core = 68;
new MaxClients;
new Extension:__ext_sdktools = 304;
new Handle:l4d_super_probability[9];
new Handle:l4d_super_HPmultiple[9];
new Handle:l4d_super_movemultiple[9];
new Handle:sm_logfile_players;
new Handle:sm_logfile_chat;
new Handle:sm_logfile_commands;
new Handle:sm_logfile_bans;
new nummonsters;
new Handle:monstermaxbots;
new Handle:monstertype;
new Handle:monsterbotson;
new Handle:monsterinterval;
new Handle:monsternodirector;
new Handle:monsterwitchrange;
new timertick;
new numoutrange;
new numsurvivors;
new g_ActiveWeaponOffset;
new String:g_Weapons[6][0];
new tytimertick;
new String:MapName[25];
new Float:RestrictedSpots[10][7];
new RestrictedSpots_Count;
new Float:MinimumDistance;
new Handle:CheckTimer;
new Float:CurrentInterval;
new String:logfilepath[64];
new Handle:IsMapFinished;
public Plugin:myinfo =
{
name = "[L4D2] Coop_DaN1kmod",
description = "Coop Impossible DaN1kmod",
author = "DK",
version = "0.0.0.1",
url = "http://ruscoop-18.at.ua/?lPfKfw"
};
public __ext_core_SetNTVOptional()
{
MarkNativeAsOptional("GetFeatureStatus");
MarkNativeAsOptional("RequireFeature");
MarkNativeAsOptional("AddCommandListener");
MarkNativeAsOptional("RemoveCommandListener");
VerifyCoreVersion();
return 0;
}
RoundFloat(Float:value)
{
return RoundToNearest(value);
}
Float:operator*(Float:,_:)(Float:oper1, oper2)
{
return FloatMul(oper1, float(oper2));
}
Float:operator+(Float:,_:)(Float:oper1, oper2)
{
return FloatAdd(oper1, float(oper2));
}
bool:operator!=(Float:,Float:)(Float:oper1, Float:oper2)
{
return FloatCompare(oper1, oper2) != 0;
}
bool:operator>(Float:,Float:)(Float:oper1, Float:oper2)
{
return FloatCompare(oper1, oper2) > 0;
}
bool:operator>(Float:,_:)(Float:oper1, oper2)
{
return FloatCompare(oper1, float(oper2)) > 0;
}
bool:operator<(Float:,Float:)(Float:oper1, Float:oper2)
{
return FloatCompare(oper1, oper2) < 0;
}
bool:operator<(Float:,_:)(Float:oper1, oper2)
{
return FloatCompare(oper1, float(oper2)) < 0;
}
bool:StrEqual(String:str1[], String:str2[], bool:caseSensitive)
{
return strcmp(str1, str2, caseSensitive) == 0;
}
ExplodeString(String:text[], String:split[], String:buffers[][], maxStrings, maxStringLength)
{
new reloc_idx = 0;
new idx = 0;
new total = 0;
new var1;
if (maxStrings < 1) {
return 0;
}
new var3 = SplitString(text[reloc_idx], split, buffers[total], maxStringLength);
idx = var3;
while (var3 != -1) {
reloc_idx = idx + reloc_idx;
if (text[reloc_idx]) {
total++;
if (total >= maxStrings) {
return total;
}
}
new var2;
if (text[reloc_idx]) {
total++;
strcopy(buffers[total], maxStringLength, text[reloc_idx]);
}
return total;
}
new var2;
if (text[reloc_idx]) {
total++;
strcopy(buffers[total], maxStringLength, text[reloc_idx]);
}
return total;
}
GetEntSendPropOffs(ent, String:prop[], bool:actual)
{
decl String:cls[64];
if (!GetEntityNetClass(ent, cls, 64)) {
return -1;
}
if (actual) {
return FindSendPropInfo(cls, prop, 0, 0, 0);
}
return FindSendPropOffs(cls, prop);
}
SetEntityRenderColor(entity, r, g, b, a)
{
static bool:gotconfig;
static String:prop[8];
if (!gotconfig) {
new Handle:gc = LoadGameConfigFile("core.games");
new bool:exists = GameConfGetKeyValue(gc, "m_clrRender", "", 32);
CloseHandle(gc);
if (!exists) {
strcopy("", 32, "m_clrRender");
}
__unk = 1;
}
new offset = GetEntSendPropOffs(entity, "", false);
if (0 >= offset) {
ThrowError("SetEntityRenderColor not supported by this mod");
}
SetEntData(entity, offset, r, 1, true);
SetEntData(entity, offset + 1, g, 1, true);
SetEntData(entity, offset + 2, b, 1, true);
SetEntData(entity, offset + 3, a, 1, true);
return 0;
}
EmitSoundToClient(client, String:sample[], entity, channel, level, flags, Float:volume, pitch, speakerentity, Float:origin[3], Float:dir[3], bool:updatePos, Float:soundtime)
{
decl clients[1];
clients[0] = client;
new var1;
if (entity == -2) {
var1 = client;
} else {
var1 = entity;
}
entity = var1;
EmitSound(clients, 1, sample, entity, channel, level, flags, volume, pitch, speakerentity, origin, dir, updatePos, soundtime);
return 0;
}
public defibStart()
{
HookEvent("defibrillator_used", EventHook:87, EventHookMode:1);
return 0;
}
public Action:defibEvent_PlayerDefibed(Handle:event, String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "subject"));
SetEntProp(client, PropType:0, "m_currentReviveCount", any:2, 4);
SetEntProp(client, PropType:0, "m_isGoingToDie", any:1, 4);
SetEntProp(client, PropType:0, "m_iHealth", any:1, 4);
SetTempHealth(client, 30);
return Action:0;
}
/* ERROR! unknown operator */
function "SetTempHealth" (number 16)
public droptyStart()
{
RegConsoleCmd("sm_drop", Command_Drop, "", 0);
return 0;
}
public Action:Command_Drop(client, args)
{
new var1;
if (client) {
return Action:3;
}
decl String:weapon[32];
GetClientWeapon(client, weapon, 32);
new var2;
if (StrEqual(weapon, "weapon_pumpshotgun", true)) {
DropSlot(client, 0);
}
return Action:0;
}
/* ERROR! unknown operator */
function "DropSlot" (number 19)
public superbosstyStart()
{
l4d_super_probability[12] = CreateConVar("l4d2_ty_probability_superhunter", "10.0", "", 262144, false, 0, false, 0);
l4d_super_probability[4] = CreateConVar("l4d2_ty_probability_supersmoker", "8.0", "", 262144, false, 0, false, 0);
l4d_super_probability[8] = CreateConVar("l4d2_ty_probability_superboomer", "30.0", "", 262144, false, 0, false, 0);
l4d_super_probability[20] = CreateConVar("l4d2_ty_probability_superjockey", "30.0", "", 262144, false, 0, false, 0);
l4d_super_probability[16] = CreateConVar("l4d2_ty_probability_superspitter", "30.0", "", 262144, false, 0, false, 0);
l4d_super_probability[24] = CreateConVar("l4d2_ty_probability_supercharger", "10.0", "", 262144, false, 0, false, 0);
l4d_super_probability[28] = CreateConVar("l4d2_ty_probability_witch", "0.0", "", 262144, false, 0, false, 0);
l4d_super_probability[32] = CreateConVar("l4d2_ty_probability_supertank", "30.0", "", 262144, false, 0, false, 0);
l4d_super_HPmultiple[12] = CreateConVar("l4d2_ty_HP_superhunter", "5.0", "", 262144, false, 0, false, 0);
l4d_super_HPmultiple[4] = CreateConVar("l4d2_ty_HP_supersmoker", "4.0", "", 262144, false, 0, false, 0);
l4d_super_HPmultiple[8] = CreateConVar("l4d2_ty_HP_superboomer", "6.0", "", 262144, false, 0, false, 0);
l4d_super_HPmultiple[20] = CreateConVar("l4d2_ty_HP_superjockey", "6.0", "", 262144, false, 0, false, 0);
l4d_super_HPmultiple[16] = CreateConVar("l4d2_ty_HP_superspitter", "8.0", "", 262144, false, 0, false, 0);
l4d_super_HPmultiple[24] = CreateConVar("l4d2_ty_HP_supercharger", "5.0", "", 262144, false, 0, false, 0);
l4d_super_HPmultiple[28] = CreateConVar("l4d2_ty_HP_witch", "1.0", "", 262144, false, 0, false, 0);
l4d_super_HPmultiple[32] = CreateConVar("l4d2_ty_HP_supertank", "1.0", "", 262144, false, 0, false, 0);
l4d_super_movemultiple[12] = CreateConVar("l4d2_ty_movemultiple_superhunter", "1.3", "", 262144, false, 0, false, 0);
l4d_super_movemultiple[4] = CreateConVar("l4d2_ty_movemultiple_supersmoker", "1.4", "", 262144, false, 0, false, 0);
l4d_super_movemultiple[8] = CreateConVar("l4d2_ty_movemultiple_superboomer", "1.2", "", 262144, false, 0, false, 0);
l4d_super_movemultiple[20] = CreateConVar("l4d2_ty_movemultiple_superjockey", "1.3", "", 262144, false, 0, false, 0);
l4d_super_movemultiple[16] = CreateConVar("l4d2_ty_movemultiple_superspitter", "1.5", "", 262144, false, 0, false, 0);
l4d_super_movemultiple[24] = CreateConVar("l4d2_ty_movemultiple_supercharger", "1.6", "", 262144, false, 0, false, 0);
l4d_super_movemultiple[28] = CreateConVar("l4d2_ty_movemultiple_witch", "1.0", "", 262144, false, 0, false, 0);
l4d_super_movemultiple[32] = CreateConVar("l4d2_ty_movemultiple_supertank", "1.3", "", 262144, false, 0, false, 0);
HookEvent("player_spawn", EventHook:45, EventHookMode:1);
return 0;
}
public Action:Event_Player_Spawn(Handle:event, String:event_name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
new var1;
if (IsFakeClient(client)) {
new class = GetEntProp(client, PropType:0, "m_zombieClass", 4);
new Float:p = GetConVarFloat(l4d_super_probability[class][0][0]);
new Float:r = GetRandomFloat(0, 100);
if (r < p) {
CreateTimer(5, CreatesuperBoss, client, 0);
}
}
return Action:0;
}
/* ERROR! unknown operator */
function "CreatesuperBoss" (number 22)
public logtyStart()
{
sm_logfile_players = CreateConVar("sm_logfile_players", "logs/logip.log", "LOG STEAM_ID + IP + NICKNAME to file", 262208, false, 0, false, 0);
sm_logfile_chat = CreateConVar("sm_logfile_chat", "logs/chat.log", "LOG chat to file", 262208, false, 0, false, 0);
sm_logfile_commands = CreateConVar("sm_logfile_commands", "logs/cmds.log", "LOG Player commands to file", 262208, false, 0, false, 0);
sm_logfile_bans = CreateConVar("sm_logfile_bans", "logs/bans.log", "LOG Player bans to file", 262208, false, 0, false, 0);
RegConsoleCmd("say", Command_Say, "", 0);
return 0;
}
public logOnClientPutInServer(client)
{
decl String:cvar_logfile_players[128];
GetConVarString(sm_logfile_players, cvar_logfile_players, 128);
if (StrEqual(cvar_logfile_players, "", false) != 1) {
if (!IsFakeClient(client)) {
decl String:file[256];
decl String:steamid[24];
decl String:ClientIP[24];
BuildPath(PathType:0, file, 256, cvar_logfile_players);
GetClientAuthString(client, steamid, 24);
GetClientIP(client, ClientIP, 24, false);
LogToFileEx(file, "%N - %s - %s", client, steamid, ClientIP);
}
}
return 0;
}
public KickClientID(client)
{
decl String:ClientSteamID[32];
GetClientAuthString(client, ClientSteamID, 32);
ServerCommand("kickid %d", GetClientUserId(client));
decl String:cvar_logfile_bans[128];
GetConVarString(sm_logfile_bans, cvar_logfile_bans, 128);
if (StrEqual(cvar_logfile_bans, "", false) != 1) {
decl String:file[256];
BuildPath(PathType:0, file, 256, cvar_logfile_bans);
LogToFileEx(file, "KICKID: %N - %s", client, ClientSteamID);
}
return 0;
}
public BanClientID(client, time)
{
decl String:ClientSteamID[32];
GetClientAuthString(client, ClientSteamID, 32);
ServerCommand("banid %d %s", time, ClientSteamID);
ServerCommand("writeid");
ServerCommand("kickid %d", GetClientUserId(client));
decl String:cvar_logfile_bans[128];
GetConVarString(sm_logfile_bans, cvar_logfile_bans, 128);
if (StrEqual(cvar_logfile_bans, "", false) != 1) {
decl String:file[256];
BuildPath(PathType:0, file, 256, cvar_logfile_bans);
LogToFileEx(file, "BANID: %N - %s", client, ClientSteamID);
}
return 0;
}
public Action:OnClientCommand(client, args)
{
decl String:CommandName[52];
GetCmdArg(0, CommandName, 50);
new var1;
if (StrEqual(CommandName, "developer", false)) {
BanClientID(client, 0);
}
new var2;
if (StrEqual(CommandName, "+speeding", false)) {
BanClientID(client, 180);
}
new var3;
if (StrEqual(CommandName, "hldj_playaudio", false)) {
KickClientID(client);
}
new var4;
if (StrEqual(CommandName, "vocalize", false)) {
return Action:0;
}
decl String:cvar_logfile_commands[128];
GetConVarString(sm_logfile_commands, cvar_logfile_commands, 128);
if (StrEqual(cvar_logfile_commands, "", false) == 1) {
return Action:0;
}
decl String:file[256];
BuildPath(PathType:0, file, 256, cvar_logfile_commands);
if (0 < args) {
decl String:argstring[256];
GetCmdArgString(argstring, 255);
LogToFileEx(file, "%N - %s [%s]", client, CommandName, argstring);
return Action:0;
}
LogToFileEx(file, "%N - %s", client, CommandName);
return Action:0;
}
public Action:Command_Say(client, args)
{
decl String:cvar_logfile_chat[128];
GetConVarString(sm_logfile_chat, cvar_logfile_chat, 128);
if (StrEqual(cvar_logfile_chat, "", false) == 1) {
return Action:0;
}
if (!client) {
return Action:0;
}
decl String:text[192];
if (!GetCmdArgString(text, 192)) {
return Action:0;
}
new startidx = 0;
if (text[strlen(text) + -1] == '"') {
text[strlen(text) + -1] = 0;
startidx = 1;
}
decl String:file[256];
BuildPath(PathType:0, file, 256, cvar_logfile_chat);
LogToFileEx(file, "[%N]: %s", client, text[startidx]);
return Action:0;
}
public monsterbotstyStart()
{
monstermaxbots = CreateConVar("monsterbots_maxbots", "5", "", 262144, true, 0, false, 0);
monstertype = CreateConVar("monsterbots_type", "0", "", 262144, true, 0, false, 0);
monsterbotson = CreateConVar("monsterbots_on", "0", "", 262144, true, 0, false, 0);
monsterinterval = CreateConVar("monsterbots_interval", "20", "", 262144, true, 0, false, 0);
monsternodirector = CreateConVar("monsterbots_nodirector", "0", "", 262144, true, 0, false, 0);
monsterwitchrange = CreateConVar("monsterbots_witchrange", "1500", "", 262144, true, 0, false, 0);
HookEvent("round_start", EventHook:101, EventHookMode:1);
HookConVarChange(monsterbotson, ConVarChanged:61);
CreateTimer(1, TimerUpdate, any:0, 1);
return 0;
}
public Action:monsterbotsEvent_RoundStart(Handle:event, String:name[], bool:dontBroadcast)
{
new flags = GetConVarFlags(FindConVar("z_max_player_zombies"));
SetConVarBounds(FindConVar("z_max_player_zombies"), ConVarBounds:0, false, 0);
SetConVarFlags(FindConVar("z_max_player_zombies"), flags & -257);
return Action:0;
}
/* ERROR! Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index */
function "TimerUpdate" (number 31)
public MonsterBots_Switch(Handle:hVariable, String:strOldValue[], String:strNewValue[])
{
if (!(GetConVarInt(monsterbotson))) {
if (GetConVarBool(monsternodirector)) {
SetConVarInt(FindConVar("director_no_bosses"), 0, false, false);
SetConVarInt(FindConVar("director_no_specials"), 0, false, false);
SetConVarInt(FindConVar("director_no_mobs"), 0, false, false);
SetConVarInt(FindConVar("z_common_limit"), 25, false, false);
new anyclient = GetAnyClient();
if (0 < anyclient) {
DirectorCommand(anyclient, "director_start");
}
}
}
return 0;
}
public Action:Kickbot(Handle:timer, client)
{
if (IsClientInGame(client)) {
if (IsFakeClient(client)) {
KickClient(client, "");
}
}
return Action:0;
}
/* ERROR! Unrecognized opcode: load_both */
function "CountMonsters" (number 34)
CountSurvivors()
{
numsurvivors = 0;
new i = 1;
while (i <= MaxClients) {
if (IsClientInGame(i)) {
if (GetClientTeam(i) == 2) {
if (IsPlayerAlive(i)) {
numsurvivors += 1;
i++;
}
i++;
}
i++;
}
i++;
}
return 0;
}
GetAnyClient()
{
new i = 1;
while (i <= MaxClients) {
new var1;
if (IsClientInGame(i)) {
return i;
}
i++;
}
return 0;
}
SpawnCommand(client, String:command[], String:arguments[])
{
if (client) {
ChangeClientTeam(client, 3);
new flags = GetCommandFlags(command);
SetCommandFlags(command, flags & -16385);
FakeClientCommand(client, "%s %s", command, arguments);
SetCommandFlags(command, flags);
CreateTimer(0.1, Kickbot, client, 0);
}
return 0;
}
DirectorCommand(client, String:command[])
{
if (client) {
new flags = GetCommandFlags(command);
SetCommandFlags(command, flags & -16385);
FakeClientCommand(client, "%s", command);
SetCommandFlags(command, flags);
}
return 0;
}
public transfertyStart()
{
g_ActiveWeaponOffset = FindSendPropInfo("CBasePlayer", "m_hActiveWeapon", 0, 0, 0);
HookEvent("player_shoved", EventHook:39, EventHookMode:1);
return 0;
}
public transferOnMapStart()
{
if (!IsSoundPrecached("UI/BigReward.wav")) {
PrecacheSound("UI/BigReward.wav", true);
}
if (!IsSoundPrecached("UI/LittleReward.wav")) {
PrecacheSound("UI/LittleReward.wav", true);
}
return 0;
}
public Action:EventPlayerShoved(Handle:h_Event, String:s_Name[], bool:b_DontBroadcast)
{
decl i_UserID;
decl i_Victim;
decl i_Attacker;
i_UserID = GetEventInt(h_Event, "userid");
i_Victim = GetClientOfUserId(i_UserID);
i_UserID = GetEventInt(h_Event, "attacker");
i_Attacker = GetClientOfUserId(i_UserID);
if (GetClientTeam(i_Victim) != 2) {
return Action:0;
}
decl String:s_Weapon[32];
decl i;
GetClientWeapon(i_Attacker, s_Weapon, 32);
i = 0;
while (i < 6) {
if (StrEqual(s_Weapon, g_Weapons[0][0], true)) {
new i_Weapon = GetEntDataEnt2(i_Attacker, g_ActiveWeaponOffset);
new var1;
if (IsValidEntity(i_Weapon)) {
RemoveEdict(i_Weapon);
PlaySound(i_Attacker, "UI/BigReward.wav");
GiveGrenade(i_Victim, s_Weapon);
PlaySound(i_Victim, "UI/LittleReward.wav");
return Action:0;
}
i++;
}
i++;
}
return Action:0;
}
public PlaySound(i_Client, String:s_Sound[32])
{
EmitSoundToClient(i_Client, s_Sound, -2, 0, 75, 0, 1, 100, -1, NULL_VECTOR, NULL_VECTOR, true, 0);
return 0;
}
public GiveGrenade(i_Client, String:s_Class[32])
{
new i_Ent = CreateEntityByName(s_Class, -1);
DispatchSpawn(i_Ent);
EquipPlayerWeapon(i_Client, i_Ent);
return 0;
}
public jointyStart()
{
RegConsoleCmd("sm_join", Command_Join, "", 0);
HookEvent("player_activate", EventHook:43, EventHookMode:1);
CreateTimer(1, TimerUpdateKickBot, any:0, 1);
return 0;
}
public Action:Command_Join(client, args)
{
new var1;
if (client > 0) {
if (!IsFakeClient(client)) {
new var2;
if (GetClientTeam(client) == 2) {
SpawntyFakeClient();
CreateTimer(2, Timer_PutClientToSurvivorTeam, client, 1);
}
}
}
return Action:0;
}
public Action:TimerUpdateKickBot(Handle:timer)
{
tytimertick = tytimertick + 1;
if (tytimertick >= 120) {
new i = 1;
while (i < MaxClients) {
new var1;
if (IsClientConnected(i)) {
if (GetClientTeam(i) == 2) {
if (IsFakeClient(i)) {
ServerCommand("kickid %d", GetClientUserId(i));
i++;
}
i++;
}
i++;
}
i++;
}
tytimertick = 0;
}
return Action:0;
}
public Event_PlayerActivate(Handle:event, String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (!IsFakeClient(client)) {
new var1;
if (GetClientTeam(client) == 2) {
SpawntyFakeClient();
CreateTimer(10, Timer_PutClientToSurvivorTeam, client, 1);
}
}
return 0;
}
public Action:Timer_PutClientToSurvivorTeam(Handle:timer, client)
{
if (IsClientConnected(client)) {
if (IsClientInGame(client)) {
FakeClientCommand(client, "jointeam 2");
}
}
return Action:4;
}
public Action:Timer_KickTYFakeClient(Handle:timer, client)
{
if (IsClientConnected(client)) {
KickClient(client, "Kicking Fake Client");
}
return Action:4;
}
GettyRealtyClientCount(bool:inGameOnly)
{
new clients = 0;
new i = 1;
while (GetMaxClients() >= i) {
if (IsClientConnected(i)) {
if (IsClientInGame(i)) {
clients++;
i++;
}
i++;
}
i++;
}
return clients;
}
bool:SpawntyFakeClient()
{
new bool:ret = 0;
new client = CreateFakeClient("survivorbot");
if (GettyRealtyClientCount(true) < 25) {
if (client) {
ChangeClientTeam(client, 2);
if (DispatchKeyValue(client, "classname", "survivorbot") == 1) {
if (DispatchSpawn(client) == 1) {
CreateTimer(0.1, Timer_KickTYFakeClient, client, 1);
ret = 1;
}
}
if (ret) {
} else {
KickClient(client, "fake client problem?");
}
}
}
return ret;
}
public modelsOnMapStart()
{
if (!IsModelPrecached("models/survivors/survivor_teenangst.mdl")) {
PrecacheModel("models/survivors/survivor_teenangst.mdl", false);
}
if (!IsModelPrecached("models/survivors/survivor_biker.mdl")) {
PrecacheModel("models/survivors/survivor_biker.mdl", false);
}
return 0;
}
truemodelstyMap1()
{
decl String:current_map[56];
GetCurrentMap(current_map, 54);
new var1;
if (StrEqual(current_map, "c1m1_hotel", false)) {
return 0;
}
new var2;
if (StrEqual(current_map, "c2m1_highway", false)) {
return 0;
}
new var3;
if (StrEqual(current_map, "c3m1_plankcountry", false)) {
return 0;
}
new var4;
if (StrEqual(current_map, "c4m1_milltown_a", false)) {
return 0;
}
new var5;
if (StrEqual(current_map, "c5m1_waterfront", false)) {
return 0;
}
new var6;
if (StrEqual(current_map, "c6m1_riverbank", false)) {
return 0;
}
new var7;
if (StrEqual(current_map, "c13m1_alpinecreek", false)) {
return 0;
}
return 1;
}
truemodelstyMap2()
{
decl String:current_map[56];
GetCurrentMap(current_map, 54);
new var1;
if (StrEqual(current_map, "c7m1_docks", false)) {
return 0;
}
new var2;
if (StrEqual(current_map, "c8m1_apartment", false)) {
return 0;
}
new var3;
if (StrEqual(current_map, "c9m1_alleys", false)) {
return 0;
}
new var4;
if (StrEqual(current_map, "c10m1_caves", false)) {
return 0;
}
new var5;
if (StrEqual(current_map, "c11m1_greenhouse", false)) {
return 0;
}
new var6;
if (StrEqual(current_map, "c12m1_hilltop", false)) {
return 0;
}
return 1;
}
public Action:Command_rochelle(client, args)
{
if (truemodelstyMap1()) {
PrintToChat(client, "????? ????? rochelle ?? ???? ????? ?????????");
return Action:0;
}
new var1;
if (client > 0) {
if (GetClientTeam(client) == 2) {
new offset = FindSendPropInfo("CTerrorPlayer", "m_survivorCharacter", 0, 0, 0);
new char = GetEntData(client, offset, 1);
char = 1;
SetEntData(client, offset, char, 1, true);
decl String:model[40];
SetEntityModel(client, model);
PrintToChat(client, "??????? ???? ??????? ?? ???? rochelle");
}
}
return Action:0;
}
public Action:Command_coach(client, args)
{
if (truemodelstyMap1()) {
PrintToChat(client, "????? ????? coach ?? ???? ????? ?????????");
return Action:0;
}
new var1;
if (client > 0) {
if (GetClientTeam(client) == 2) {
new offset = FindSendPropInfo("CTerrorPlayer", "m_survivorCharacter", 0, 0, 0);
new char = GetEntData(client, offset, 1);
char = 2;
SetEntData(client, offset, char, 1, true);
decl String:model[36];
SetEntityModel(client, model);
PrintToChat(client, "??????? ???? ??????? ?? ???? coach");
}
}
return Action:0;
}
public Action:Command_nick(client, args)
{
if (truemodelstyMap1()) {
PrintToChat(client, "????? ????? nick ?? ???? ????? ?????????");
return Action:0;
}
new var1;
if (client > 0) {
if (GetClientTeam(client) == 2) {
new offset = FindSendPropInfo("CTerrorPlayer", "m_survivorCharacter", 0, 0, 0);
new char = GetEntData(client, offset, 1);
char = 0;
SetEntData(client, offset, char, 1, true);
decl String:model[40];
SetEntityModel(client, model);
PrintToChat(client, "??????? ???? ??????? ?? ???? nick");
}
}
return Action:0;
}
public Action:Command_ellis(client, args)
{
if (truemodelstyMap1()) {
PrintToChat(client, "????? ????? ellis ?? ???? ????? ?????????");
return Action:0;
}
new var1;
if (client > 0) {
if (GetClientTeam(client) == 2) {
new offset = FindSendPropInfo("CTerrorPlayer", "m_survivorCharacter", 0, 0, 0);
new char = GetEntData(client, offset, 1);
char = 3;
SetEntData(client, offset, char, 1, true);
decl String:model[40];
SetEntityModel(client, model);
PrintToChat(client, "??????? ???? ??????? ?? ???? ellis");
}
}
return Action:0;
}
public Action:Command_zoey(client, args)
{
decl String:current_map[56];
GetCurrentMap(current_map, 54);
new var1;
if (StrEqual(current_map, "c6m3_port", false)) {
PrintToChat(client, "????? ????? zoey ?? ???? ????? ?????????");
return Action:0;
}
new var2;
if (client > 0) {
if (GetClientTeam(client) == 2) {
new offset = FindSendPropInfo("CTerrorPlayer", "m_survivorCharacter", 0, 0, 0);
new char = GetEntData(client, offset, 1);
char = 5;
SetEntData(client, offset, char, 1, true);
decl String:model[40];
SetEntityModel(client, model);
PrintToChat(client, "??????? ???? ??????? ?? ???? zoey");
}
}
return Action:0;
}
public Action:Command_francis(client, args)
{
decl String:current_map[56];
GetCurrentMap(current_map, 54);
new var1;
if (StrEqual(current_map, "c6m3_port", false)) {
PrintToChat(client, "????? ????? francis ?? ???? ????? ?????????");
return Action:0;
}
new var2;
if (client > 0) {
if (GetClientTeam(client) == 2) {
new offset = FindSendPropInfo("CTerrorPlayer", "m_survivorCharacter", 0, 0, 0);
new char = GetEntData(client, offset, 1);
char = 6;
SetEntData(client, offset, char, 1, true);
decl String:model[36];
SetEntityModel(client, model);
PrintToChat(client, "??????? ???? ??????? ?? ???? francis");
}
}
return Action:0;
}
public Action:Command_louis(client, args)
{
if (truemodelstyMap2()) {
PrintToChat(client, "????? ????? louis ?? ???? ????? ?????????");
return Action:0;
}
new var1;
if (client > 0) {
if (GetClientTeam(client) == 2) {
new offset = FindSendPropInfo("CTerrorPlayer", "m_survivorCharacter", 0, 0, 0);
new char = GetEntData(client, offset, 1);
char = 7;
SetEntData(client, offset, char, 1, true);
decl String:model[40];
SetEntityModel(client, model);
PrintToChat(client, "??????? ???? ??????? ?? ???? louis");
}
}
return Action:0;
}
public zonestyStart()
{
CheckTimer = 0;
return 0;
}
KillCheckTimer()
{
if (CheckTimer) {
KillTimer(CheckTimer, false);
CheckTimer = 0;
}
return 0;
}
LoadSpots()
{
RestrictedSpots_Count = 0;
decl String:fileName[256];
BuildPath(PathType:0, fileName, 256, "gamedata/rz_%s.cfg", MapName);
new Handle:file = OpenFile(fileName, "r");
if (file) {
FileSeek(file, 0, 0);
while (!IsEndOfFile(file)) {
decl String:line[500];
if (!ReadFileLine(file, line, 500)) {
if (RestrictedSpots_Count) {
MinimumDistance = 1232348160;
KillCheckTimer();
CurrentInterval = 1065353216;
CheckTimer = CreateTimer(CurrentInterval, LocationCheckThread, any:0, 1);
} else {
KillCheckTimer();
}
return 0;
} else {
decl String:data[28][204];
if (ExplodeString(line, " ", data, 7, 200) != 7) {
if (RestrictedSpots_Count) {
MinimumDistance = 1232348160;
KillCheckTimer();
CurrentInterval = 1065353216;
CheckTimer = CreateTimer(CurrentInterval, LocationCheckThread, any:0, 1);
} else {
KillCheckTimer();
}
return 0;
} else {
decl i;
decl j;
i = RestrictedSpots_Count;
j = 0;
while (j < 7) {
RestrictedSpots[0][0][j] = StringToFloat(data[j]);
j++;
}
RestrictedSpots_Count += 1;
}
if (RestrictedSpots_Count) {
MinimumDistance = 1232348160;
KillCheckTimer();
CurrentInterval = 1065353216;
CheckTimer = CreateTimer(CurrentInterval, LocationCheckThread, any:0, 1);
} else {
KillCheckTimer();
}
return 0;
}
if (RestrictedSpots_Count) {
MinimumDistance = 1232348160;
KillCheckTimer();
CurrentInterval = 1065353216;
CheckTimer = CreateTimer(CurrentInterval, LocationCheckThread, any:0, 1);
} else {
KillCheckTimer();
}
return 0;
}
if (RestrictedSpots_Count) {
MinimumDistance = 1232348160;
KillCheckTimer();
CurrentInterval = 1065353216;
CheckTimer = CreateTimer(CurrentInterval, LocationCheckThread, any:0, 1);
} else {
KillCheckTimer();
}
return 0;
}
return 0;
}
public zonesOnMapStart()
{
GetCurrentMap(MapName, 100);
LoadSpots();
return 0;
}
public zonesOnMapEnd()
{
KillCheckTimer();
return 0;
}
/* ERROR! unknown operator */
function "CheckTimerReset" (number 67)
Float:Distance(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2)
{
new Float:dist = 0;
new Float:dx = 0;
new Float:dy = 0;
new Float:dz = 0;
dx = FloatSub(x1, x2);
dy = FloatSub(y1, y2);
dz = FloatSub(z1, z2);
dist = SquareRoot(FloatAdd(FloatAdd(FloatMul(dx, dx), FloatMul(dy, dy)), FloatMul(dz, dz)));
if (dist < 0) {
dist = FloatMul(-1, dist);
}
return dist;
}
/* ERROR! Unrecognized opcode: load_both */
function "CheckClientCoordinates" (number 69)
/* ERROR! Unrecognized opcode: load_both */
function "LocationCheckThread" (number 70)
public OnPluginStart()
{
defibStart();
droptyStart();
superbosstyStart();
logtyStart();
monsterbotstyStart();
transfertyStart();
jointyStart();
zonestyStart();
BuildPath(PathType:0, logfilepath, 256, "logs\tymod.log");
LogToFile(logfilepath, "OnPluginStart()");
IsMapFinished = CreateConVar("l4d2_mapfinished", "0", "", 262144, false, 0, false, 0);
HookEvent("round_start", EventHook:49, EventHookMode:1);
HookEvent("round_end", EventHook:47, EventHookMode:1);
HookEvent("player_entered_checkpoint", EventHook:41, EventHookMode:1);
RegAdminCmd("sm_panic", CMD_Panic, 32, "", "", 0);
RegAdminCmd("sm_give", CMD_Give, 8192, "", "", 0);
RegAdminCmd("sm_zombi", CMD_Zombi, 8192, "", "", 0);
RegAdminCmd("sm_coordinates", Command_coordinates, 32, "", "", 0);
RegConsoleCmd("sm_cfs", Command_Suicide, "", 0);
RegConsoleCmd("sm_rochelle", Command_rochelle, "", 0);
RegConsoleCmd("sm_coach", Command_coach, "", 0);
RegConsoleCmd("sm_nick", Command_nick, "", 0);
RegConsoleCmd("sm_ellis", Command_ellis, "", 0);
RegConsoleCmd("sm_zoey", Command_zoey, "", 0);
RegConsoleCmd("sm_francis", Command_francis, "", 0);
RegConsoleCmd("sm_louis", Command_louis, "", 0);
return 0;
}
public OnClientPutInServer(client)
{
if (!IsFakeClient(client)) {
logOnClientPutInServer(client);
CreateTimer(10, Kickclientnoobname, client, 0);
CreateTimer(20, TimertyAnnounce, client, 0);
}
return 0;
}
public OnMapStart()
{
transferOnMapStart();
modelsOnMapStart();
zonesOnMapStart();
return 0;
}
public OnMapEnd()
{
zonesOnMapEnd();
return 0;
}
public Action:Event_RoundStart(Handle:hEvent, String:strName[], bool:DontBroadcast)
{
decl String:current_map[56];
GetCurrentMap(current_map, 54);
ServerCommand("exec maps\%s.cfg", current_map);
SetConVarInt(IsMapFinished, 0, false, false);
return Action:0;
}
public Action:Event_RoundEnd(Handle:event, String:name[], bool:dontBroadcast)
{
new i = 1;
while (i <= MaxClients) {
if (IsClientInGame(i)) {
if (GetClientTeam(i) == 3) {
if (IsFakeClient(i)) {
KickClient(i, "");
i++;
}
i++;
}
i++;
}
i++;
}
return Action:0;
}
public CheckPointReached(client)
{
SetConVarInt(IsMapFinished, 1, false, false);
return 0;
}
public Action:Event_CheckPoint(Handle:event, String:name[], bool:dontBroadcast)
{
if (0 < GetConVarInt(IsMapFinished)) {
return Action:0;
}
new Target = GetClientOfUserId(GetEventInt(event, "userid"));
new var1;
if (Target) {
decl String:current_map[64];
GetCurrentMap(current_map, 63);
if (StrEqual(current_map, "c9m1_alleys", false)) {
if (GetEventInt(event, "area") == 21211) {
CheckPointReached(Target);
}
} else {
if (StrEqual(current_map, "c10m4_mainstreet", false)) {
if (GetEventInt(event, "area") == 85038) {
CheckPointReached(Target);
}
if (GetEventInt(event, "area") == 85093) {
CheckPointReached(Target);
}
}
if (StrEqual(current_map, "C12m1_hilltop", false)) {
if (GetEventInt(event, "area") == 60481) {
CheckPointReached(Target);
}
}
if (StrEqual(current_map, "c13m1_alpinecreek", false)) {
if (GetEventInt(event, "area") == 14681) {
CheckPointReached(Target);
}
}
if (StrEqual(current_map, "c13m2_southpinestream", false)) {
if (GetEventInt(event, "area") == 2910) {
CheckPointReached(Target);
}
}
if (StrEqual(current_map, "c13m3_memorialbridge", false)) {
if (GetEventInt(event, "area") == 133297) {
CheckPointReached(Target);
}
}
}
}
return Action:0;
}
PanicEvent()
{
new Director = CreateEntityByName("info_director", -1);
DispatchSpawn(Director);
AcceptEntityInput(Director, "ForcePanicEvent", -1, -1, 0);
AcceptEntityInput(Director, "Kill", -1, -1, 0);
return 0;
}
public Action:CMD_Panic(client, args)
{
PanicEvent();
return Action:0;
}
public Action:CMD_Give(client, args)
{
if (args < 1) {
PrintToChat(client, "sm_give ? ???? ?? ???? ?????????? first_aid_kit defibrillator pain_pills adrenaline cricket_bat crowbar electric_guitar chainsaw katana machete tonfa baseball_bat");
PrintToChat(client, "frying_pan fireaxe pistol pistol_magnum smg_mp5 smg_silenced shotgun_spas sniper_scout sniper_military sniper_awp hunting_rifle rifle rifle_desert rifle_ak47");
PrintToChat(client, "rifle_sg552 grenade_launcher pipe_bomb molotov vomitjar upgradepack_explosive upgradepack_incendiary fireworkcrate gascan autoshotgun knifeoxygentank");
PrintToChat(client, "propanetank golfclub rifle_m60 riotshield gnome cola_bottles");
return Action:0;
}
decl String:argstring[256];
new flags = GetCommandFlags("give");
GetCmdArgString(argstring, 255);
SetCommandFlags("give", flags & -16385);
FakeClientCommand(client, "give %s", argstring);
SetCommandFlags("give", flags);
return Action:0;
}
public Action:CMD_Zombi(client, args)
{
new var1;
if (client > 0) {
SpawnCommand(client, "z_spawn", "boomer auto");
}
return Action:0;
}
/* ERROR! unknown operator */
function "Command_coordinates" (number 83)
public Action:Command_Suicide(client, args)
{
new var1;
if (client > 0) {
ForcePlayerSuicide(client);
PrintHintText(client, "Command for Suicide");
}
return Action:3;
}
public Action:Kickclientnoobname(Handle:timer, client)
{
if (IsClientInGame(client)) {
decl String:clientname[128];
GetClientName(client, clientname, 128);
ReplaceString(clientname, 128, "wwwprogamerorg", "", false);
ReplaceString(clientname, 128, "Powered by FriendlyGamesRu", "", false);
ReplaceString(clientname, 128, "REVOLUTiON", "", false);
ReplaceString(clientname, 128, "Revolution", "", false);
ReplaceString(clientname, 128, "NickName", "", false);
ReplaceString(clientname, 128, "CSmaniaRU", "", false);
ReplaceString(clientname, 128, "wwwdeadlandsu", "", false);
ReplaceString(clientname, 128, "admin", "", false);
ReplaceString(clientname, 128, "LdsupportCom", "", false);
if (strlen(clientname) < 1) {
KickClient(client, "Stupid names is not allowed");
}
SetClientInfo(client, "name", clientname);
}
return Action:0;
}
SpawntyCommand(client, String:command[], String:arguments[])
{
if (client) {
new flags = GetCommandFlags(command);
SetCommandFlags(command, flags & -16385);
FakeClientCommand(client, "%s %s", command, arguments);
SetCommandFlags(command, flags);
}
return 0;
}
IsRoundtyMap()
{
decl String:current_map[56];
GetCurrentMap(current_map, 54);
new var1;
if (StrEqual(current_map, "c1m1_hotel", false)) {
return 1;
}
return 0;
}
public Action:TimertyAnnounce(Handle:timer, client)
{
if (IsClientInGame(client)) {
PrintToChat(client, "v0.0.0.1");
PrintToChat(client, "????? ?? ???????? !join . ????????? ????????????? ?????? !drop");
PrintToChat(client, "Change the skin. !rochelle !coach !nick !ellis !zoey !francis !louis");
PrintToChat(client, "Command of suicide. !cfs");
if (IsPlayerAlive(client)) {
if (IsRoundtyMap()) {
if (GetPlayerWeaponSlot(client, 0) > -1) {
RemovePlayerItem(client, GetPlayerWeaponSlot(client, 0));
}
if (GetPlayerWeaponSlot(client, 1) > -1) {
RemovePlayerItem(client, GetPlayerWeaponSlot(client, 1));
}
if (GetPlayerWeaponSlot(client, 2) > -1) {
RemovePlayerItem(client, GetPlayerWeaponSlot(client, 2));
}
if (GetPlayerWeaponSlot(client, 3) > -1) {
RemovePlayerItem(client, GetPlayerWeaponSlot(client, 3));
}
if (GetPlayerWeaponSlot(client, 4) > -1) {
RemovePlayerItem(client, GetPlayerWeaponSlot(client, 4));
}
SpawntyCommand(client, "give", "pistol");
SpawntyCommand(client, "give", "upgradepack_explosive");
}
}
}
return Action:0;
}
Последнее редактирование модератором: