Znalazłem plugin na włączenie/wyłączenie friendly fire i przerobiłem go lekko. Jednak kompilator sypie błędami, poprawiłby ktoś? Niestety nie wiem gdzie znajdują się dokładnie błędy.
#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <sdkhooks>
#pragma semicolon 1
/*
Current plugin version
*/
#define PLUGIN_VERSION "v3"
/*
/*
Bools
*/
new bool:bFF;
/*
/*
Plugin information
*/
public Plugin:myinfo =
{
name = "Friendly Fire CSGO",
author = "Dk--",
description = "enable / disable the friendly fire",
version = PLUGIN_VERSION,
}
public OnPluginStart()
{
RegAdminCmd("sm_ff", FF_Command);
HookEvent("round_start", OnRoundStart);
}
public Action:FF_Command(client, args)
{
new Handle:ffMenu = CreateMenu(ffMenu_Action);
SetMenuTitle(ffMenu, "Tryb gry:");
AddMenuItem(ffMenu, "Turniejowy");
AddMenuItem(ffMenu, "Normalna gra");
DisplayMenu(ffMenu, client, 20);
return Plugin_Handled;
}
public ffMenu_Action(Handle:ffMenu, MenuAction:action, client, param2)
{
if (action == MenuAction_Select)
{
new String:option[32];
GetMenuItem(ffMenu, param2, option, sizeof(option));
if(strcmp(option, "enable") == 0)
{
bFF = true;
SetConVarInt(FindConVar("sv_cheats"), 1);
SetConVarInt(FindConVar("mp_roundtime"), 60);
SetConVarInt(FindConVar("mp_roundtime_defuse"), 60);
SetConVarInt(FindConVar("mp_warmup_end");
PrintToChatAll("[Trening] Został aktywowany tryb treningowy");
}
if(strcmp(option, "disable") == 0)
{
bFF = false;
SetConVarInt(FindConVar("sv_cheats"), 0);
SetConVarInt(FindConVar("mp_roundtime"), 5);
SetConVarInt(FindConVar("mp_roundtime_defuse"), 0);
SetConVarInt(FindConVar("mp_warmup_end");
PrintToChatAll("[Normalny] Został aktywowany tryb normalnej gry");
}
}
}
public OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
bFF = false;
ServerCommand("sm_cvar sv_cheats 0");
ServerCommand("sm_cvar mp_roundtime 5");
ServerCommand("sm_cvar mp_roundtime_defuse 0");
}
Użytkownik Legalajzyt edytował ten post 27.08.2015 13:36