Sucre
-
Postów
15 -
Dołączył
-
Ostatnia wizyta
Odpowiedzi opublikowane przez Sucre
-
-
Witam, chciałbym ustawić by tylko ktos z flagą a lub wyższą miał vipa a nie każdy gracz. Proszę o pomoc :D
#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <clientprefs>
#include <colors>
#include <loghelper>
#include <sdkhooks>#pragma semicolon 1
#define MAX_WEAPON_COUNT 32
#define SHOW_MENU -1
#define CS_TEAM_SPECTATOR 1
#define CS_TEAM_T 2
#define CS_TEAM_CT 3public Plugin:myinfo =
{
name = "VIP's",
author = "hanys",
description = "vip",
version = "1.3.1",
url = ""
};new Handle:HP;
new Handle:Gravity;
new Handle:Speedy;
new Handle:Smokegrenade;
new Handle:Flashbang;
new Handle:Hegrenade;
new Handle:Molotov;
new Handle:Decoy;
new Handle:Tagrenade;
new Handle:Healthshot;
new Handle:Remove_grenade;
new Handle:Armorvalue;
new Handle:Bhashelmet;
new Handle:Defuser;
new Handle:Moneystart;
new Handle:Bombplanted;
new Handle:Bombdefused;
new Handle:Headshot_money;
new Handle:Headshot_hp;
new Handle:Kill_money;
new Handle:Kill_hp;
new Handle:Tagtable;
new Handle:Tagsay;
new Handle:Double_jump;
new Handle:Advertising;
new Handle:Menu_round;
new Handle:Menu_command;
new Handle:Menu_onspawn;new g_PrimaryGunCount;
new g_SecondaryGunCount;
new String:g_PrimaryGuns[MAX_WEAPON_COUNT][32];
new String:g_SecondaryGuns[MAX_WEAPON_COUNT][32];
new bool:g_MenuOpen[MAXPLAYERS+1] = {false, ...};
new Handle:g_PrimaryMenu = INVALID_HANDLE;
new Handle:g_SecondaryMenu = INVALID_HANDLE;
new g_PlayerPrimary[MAXPLAYERS+1] = {-1, ...};
new g_PlayerSecondary[MAXPLAYERS+1] = {-1, ...};
new Rounds = 0;
new const g_iaGrenadeOffsets[] = {15, 17, 16, 14, 18, 17};public OnPluginStart()
{
CreateConVar("sm_vip_version", "1.3.2", "VIP Plugin by Hanys", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
HP = CreateConVar("vip_hp_start", "100", "Ilosc HP na start rundy", FCVAR_NOTIFY);
Gravity = CreateConVar("vip_gravity", "1.0", "Grawitacja (1.0 - standardowa)", FCVAR_PLUGIN);
Speedy = CreateConVar("vip_speed", "1.0", "Szybkosc biegania (1.0 - standardowo)", FCVAR_PLUGIN);
Smokegrenade = CreateConVar("vip_grenade_smokegrenade", "0", "Smoke na start rundy", FCVAR_NONE, true, 0.0, true, 1.0);
Flashbang = CreateConVar("vip_grenade_flashbang", "0", "Flash na start rundy (0-2))", FCVAR_NOTIFY);
Hegrenade = CreateConVar("vip_grenade_hegrenade", "0", "Granat na start rundy", FCVAR_NONE, true, 0.0, true, 1.0);
Molotov = CreateConVar("vip_grenade_molotov", "0", "Molotov dla tt lub Incendiary dla ct na start rundy",FCVAR_NONE, true, 0.0, true, 1.0);
Decoy = CreateConVar("vip_grenade_decoy", "0", "Decoy na start rundy", FCVAR_NONE, true, 0.0, true, 1.0);
Tagrenade = CreateConVar("vip_grenade_tagrenade", "0", "Granat taktyczny na start rundy",FCVAR_NONE, true, 0.0, true, 1.0);
Healthshot = CreateConVar("vip_grenade_healtshot", "0", "Apteczka na start rundy (0-4)", FCVAR_NOTIFY);
Remove_grenade = CreateConVar("vip_grenade_remove", "0", "Na początku rundy/respawn usuwa wszystkie granaty (Przydatne przy wypadaniu granatów", FCVAR_NONE, true, 0.0, true, 1.0);
Armorvalue = CreateConVar("vip_armorvalue", "0", "Kamizelka na start rundy", FCVAR_NONE, true, 0.0, true, 1.0);
Bhashelmet = CreateConVar("vip_bhashelmet", "0", "Kask na start rundy", FCVAR_NONE, true, 0.0, true, 1.0);
Defuser = CreateConVar("vip_defuser", "0", "Zestaw do rozbrajania dla CT na start rundy", FCVAR_NONE, true, 0.0, true, 1.0);
Moneystart = CreateConVar("vip_money_start", "0", "Ilosc $ na start rundy", FCVAR_NOTIFY);
Bombplanted = CreateConVar("vip_bomb_planted", "0", "Ilosc $ za podlozenie bomby", FCVAR_NOTIFY);
Bombdefused = CreateConVar("vip_bomb_defused", "0", "Ilosc $ za rozbrojenie bomby", FCVAR_NOTIFY);
Headshot_money = CreateConVar("vip_headshot_money", "0", "Ilosc $ za Headshot", FCVAR_NOTIFY);
Headshot_hp = CreateConVar("vip_headshot_hp", "7", "Ilosc HP za Headshot", FCVAR_NOTIFY);
Kill_money = CreateConVar("vip_kill_money", "0", "Ilosc $ za fraga", FCVAR_NOTIFY);
Kill_hp = CreateConVar("vip_kill_hp", "5", "Ilosc HP za fraga", FCVAR_NOTIFY);
Tagtable = CreateConVar("vip_tag_table", "1", "Tag VIP w tabeli wynikow", FCVAR_NONE, true, 0.0, true, 1.0);
Tagsay = CreateConVar("vip_tag_say", "1", "Tag VIP + kolorowy nick w say", FCVAR_NONE, true, 0.0, true, 1.0);
Double_jump = CreateConVar("vip_double_jump", "0", "Podwojny skok", FCVAR_NONE, flase, 0.0, true, 1.0);
Advertising = CreateConVar("vip_advertising", "0", "Informacja o autorze pluginu", FCVAR_NONE, true, 0.0, true, 1.0);
Menu_round = CreateConVar("vip_menu", "0", "Od ktorej rundy menu broni jest aktywne (0-menu broni nieaktywne)", FCVAR_NOTIFY);
Menu_command = CreateConVar("vip_menu_command", "0", "Otwieranie menu broni po wpisaniu !bronie/!menu", FCVAR_NONE, true, 0.0, true, 1.0);
Menu_onspawn = CreateConVar("vip_menu_onspawn", "0", "Wyswietlanie menu przy respawn (Start rundy)", FCVAR_NONE, true, 0.0, true, 1.0);AutoExecConfig(true, "vip_hanys");
CheckConfig("configs/vip_hanys_weapons.ini");
RegConsoleCmd("say", Command_SendToAll);
//RegConsoleCmd("say_team", Command_SendToTeam);
RegConsoleCmd("sm_menu", Command_VipMenu);
RegConsoleCmd("sm_bronie", Command_VipMenu);
HookEvent("player_spawn", Event_OnPlayerSpawn);
HookEvent("bomb_planted", Event_BombPlanted);
HookEvent("bomb_defused", Event_BombDefused);
HookEvent("player_death", Event_PlayerDeath);
HookEvent("player_team", Event_TagTable);
HookEvent("player_spawn", Event_TagTable);
HookEvent("round_start", Event_RoundStart);
HookEvent("announce_phase_end", RestartRound);
HookEvent("cs_intermission", RestartRound);
CreateTimer(300.0, Timer_Advert, _, TIMER_REPEAT);
}public OnPluginEnd()
{
CancelMenu(g_PrimaryMenu);
CheckCloseHandle(g_PrimaryMenu);
CancelMenu(g_SecondaryMenu);
CheckCloseHandle(g_SecondaryMenu);
}
public Action:Timer_Advert(Handle:timer)
{
if (GetConVarBool(Advertising))
{
PrintToChatAll("\x01[\x04VIP\x01]\x04 Plugin VIP");
}
}public Event_OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
new money = GetEntProp(client, Prop_Send, "m_iAccount");
new team = GetClientTeam(client);
new g_HP = GetConVarInt(HP);
new g_moneystart = GetConVarInt(Moneystart);
new g_Flashbang = GetConVarInt(Flashbang);
new g_Healthshot = GetConVarInt(Healthshot);
if (client > 0 && IsPlayerAlive(client))
{
if (GetConVarBool(Remove_grenade)) StripNades(client);
if (IsPlayerGenericAdmin(client)){
SetEntityHealth(client, g_HP); //hp
SetEntityGravity(client, GetConVarFloat(Gravity)); //grawitacja
SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", GetConVarFloat(Speedy)); //predkosc biegania
if (GetConVarBool(Smokegrenade)) GivePlayerItem(client, "weapon_smokegrenade"); //smoke
if (GetConVarBool(Flashbang))
{
for (new i = 1; i <= g_Flashbang; i++)
GivePlayerItem(client, "weapon_flashbang");
}
if (GetConVarBool(Healthshot))
{
for (new i = 1; i <= g_Healthshot; i++)
GivePlayerItem(client, "weapon_healthshot");
}
if (GetConVarBool(Hegrenade)) GivePlayerItem(client, "weapon_hegrenade"); //grenade
if (GetConVarBool(Molotov) && team == CS_TEAM_T) GivePlayerItem(client, "weapon_molotov"); //molotov tt
if (GetConVarBool(Molotov) && team == CS_TEAM_CT) GivePlayerItem(client, "weapon_incgrenade"); //Incendiary ct
if (GetConVarBool(Decoy)) GivePlayerItem(client, "weapon_decoy"); //decoy
if (GetConVarBool(Tagrenade)) GivePlayerItem(client, "weapon_tagrenade"); //Taktyczny
SetEntProp(client, Prop_Send, "m_iAccount", money + g_moneystart); // plus $ na start
if (GetConVarBool(Armorvalue)) SetEntProp(client, Prop_Send, "m_ArmorValue", 100); //kamizelka
if (GetConVarBool(Bhashelmet)) SetEntProp(client, Prop_Send, "m_bHasHelmet", 1); //helm
if(team == CS_TEAM_CT)
{
if (GetConVarBool(Defuser) && GetEntProp(client, Prop_Send, "m_bHasDefuser") == 0) GivePlayerItem(client, "item_defuser"); //kombinerki
}
CreateTimer(0.1, Event_HandleSpawn, GetEventInt(event, "userid"));
}
}
}
stock StripNades(client)
{
while(RemoveWeaponBySlot(client, 3)){}
for(new i = 0; i < 6; i++)
SetEntProp(client, Prop_Send, "m_iAmmo", 0, _, g_iaGrenadeOffsets);
}
stock bool:RemoveWeaponBySlot(client, iSlot)
{
new iEntity = GetPlayerWeaponSlot(client, iSlot);
if(IsValidEdict(iEntity)) {
RemovePlayerItem(client, iEntity);
AcceptEntityInput(iEntity, "Kill");
return true;
}
return false;
}public Event_BombPlanted(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
new money = GetEntProp(client, Prop_Send, "m_iAccount");
new g_bombplanted = GetConVarInt(Bombplanted);
if (IsPlayerGenericAdmin(client))
{
SetEntProp(client, Prop_Send, "m_iAccount", money + g_bombplanted);//plus $ for Bomb Planted
}
}public Event_BombDefused(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
new money = GetEntProp(client, Prop_Send, "m_iAccount");
new g_bombdefused = GetConVarInt(Bombdefused);
if (IsPlayerGenericAdmin(client))
{
SetEntProp(client, Prop_Send, "m_iAccount", money + g_bombdefused); //plus $ for Bomb Defused
}
}public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
new money = GetEntProp(attacker, Prop_Send, "m_iAccount");
new health = GetEntProp(attacker, Prop_Send, "m_iHealth");
new g_headshot_money = GetConVarInt(Headshot_money);
new g_headshot_hp = GetConVarInt(Headshot_hp);
new g_kill_money = GetConVarInt(Kill_money);
new g_kill_hp = GetConVarInt(Kill_hp);
new bool:headshot = GetEventBool(event, "headshot");
if (IsPlayerGenericAdmin(attacker))
{
if(headshot)
{
SetEntProp(attacker, Prop_Send, "m_iAccount", money + g_headshot_money); //plus for hs
SetEntProp(attacker, Prop_Send, "m_iHealth", health + g_headshot_hp); //plus hp for hs
}
else
{
SetEntProp(attacker, Prop_Send, "m_iAccount", money + g_kill_money); //plus for kill
SetEntProp(attacker, Prop_Send, "m_iHealth", health + g_kill_hp); //plus hp for kill
}
}
}public Action:Event_TagTable(Handle:event, String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (IsPlayerGenericAdmin(client))
{
if (GetConVarBool(Tagtable)) CS_SetClientClanTag(client, "[VIP]");
}
}public Action:Command_SendToAll(client, args)
{
if ((IsPlayerGenericAdmin(client)) && GetConVarBool(Tagsay))
{
new String:text[256];
GetCmdArg(1, text, sizeof(text));
if (text[0] == '/' || text[0] == '@' || text[0] == '!' || text[0] == 0 || IsChatTrigger())
{
return Plugin_Handled;
}
if(IsPlayerAlive(client) && GetClientTeam(client) != 1)
{
PrintToChatAll("\x01[\x04VIP\x01]\x05 %N: \x01%s", client, text);
}
else if(!IsPlayerAlive(client) && GetClientTeam(client) != 1)
{
PrintToChatAll("\x01*NIE ZYJE* [\x04VIP\x01]\x05 %N: \x01%s", client, text);
}
else if(!IsPlayerAlive(client) && GetClientTeam(client) == 1)
{
PrintToChatAll("\x01*OBSERWATOR* [\x04VIP\x01]\x05 %N: \x01%s", client, text);
}
return Plugin_Handled;
}
return Plugin_Continue;
}public Action:Command_SendToTeam(client, args)
{
if ((IsPlayerGenericAdmin(client)) && GetConVarBool(Tagsay))
{
new String:text[256];
GetCmdArg(1, text, sizeof(text));
if (text[0] == '/' || text[0] == '@' || text[0] == '!' || text[0] == 0 || IsChatTrigger())
{
return Plugin_Handled;
}
for (new i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i) && IsClientConnected(i))
{
if (GetClientTeam(client) == GetClientTeam(i))
{
if(GetClientTeam(client) == 2)
{
if(IsPlayerAlive(client))
{
PrintToChat(i, "\x01(Terrorysta) [\x04VIP\x01]\x05 %N \x01%s", client, text);
}
else if(!IsPlayerAlive(client))
{
PrintToChat(i, "\x01*NIE ZYJE*(Terrorysta) [\x04VIP\x01]\x05 %N \x01%s", client, text);
}
return Plugin_Handled;
}
else if(GetClientTeam(client) == 3)
{
if(IsPlayerAlive(client))
{
PrintToChat(i, "\x01(Antyterrorysta) [\x04VIP\x01]\x05 %N \x01%s", client, text);
}
else if(!IsPlayerAlive(client))
{
PrintToChat(i, "\x01*NIE ZYJE*(Antyterrorysta) [\x04VIP\x01]\x05 %N \x01%s", client, text);
}
return Plugin_Handled;
}
else if(GetClientTeam(client) == 1)
{
PrintToChat(i, "\x01[OBSERWATOR] [\x04VIP\x01]\x05 %N \x01%s", client, text);
return Plugin_Handled;
}
}
}
}
}
return Plugin_Continue;
}public Action:OnPlayerRunCmd(iClient, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
{
if ((IsPlayerGenericAdmin(iClient)) && IsPlayerAlive(iClient) && GetConVarBool(Double_jump))
{
static g_fLastButtons[MAXPLAYERS+1], g_fLastFlags[MAXPLAYERS+1], g_iJumps[MAXPLAYERS+1], fCurFlags, fCurButtons;
fCurFlags = GetEntityFlags(iClient);
fCurButtons = GetClientButtons(iClient);
if (g_fLastFlags[iClient] & FL_ONGROUND && !(fCurFlags & FL_ONGROUND) && !(g_fLastButtons[iClient] & IN_JUMP) && fCurButtons & IN_JUMP) g_iJumps[iClient]++;
else if(fCurFlags & FL_ONGROUND) g_iJumps[iClient] = 0;
else if(!(g_fLastButtons[iClient] & IN_JUMP) && fCurButtons & IN_JUMP && g_iJumps[iClient] == 1)
{
g_iJumps[iClient]++;
decl Float:vVel[3];
GetEntPropVector(iClient, Prop_Data, "m_vecVelocity", vVel);
vVel[2] = 250.0;
TeleportEntity(iClient, NULL_VECTOR, NULL_VECTOR, vVel);
}
g_fLastFlags[iClient] = fCurFlags;
g_fLastButtons[iClient] = fCurButtons;
}
return Plugin_Continue;
}public Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
Rounds = Rounds + 1;
}public Action:RestartRound(Handle:event, const String:name[], bool:dontBroadcast)
{
Rounds = 0;
}public OnClientPutInServer(client)
{
g_MenuOpen[client]=false;g_PlayerPrimary[client] = SHOW_MENU;
g_PlayerSecondary[client] = SHOW_MENU;
}public Event_PlayerTeam(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
new team = GetClientTeam(client);if (g_MenuOpen[client] && team == CS_TEAM_SPECTATOR)
{
CancelClientMenu(client); // Delayed
g_MenuOpen[client] = false;
}
}stock CheckConfig(const String:ini_file[])
{
decl String:file[PLATFORM_MAX_PATH];
BuildPath(Path_SM, file, sizeof(file), ini_file);new timestamp = GetFileTime(file, FileTime_LastChange);
if (timestamp == -1) SetFailState("\nCould not stat config file: %s.", file);
InitializeMenus();
if (ParseConfigFile(file))
{
FinalizeMenus();
}
}stock InitializeMenus()
{
g_PrimaryGunCount=0;
CheckCloseHandle(g_PrimaryMenu);
g_PrimaryMenu = CreateMenu(MenuHandler_ChoosePrimary, MenuAction_Display|MenuAction_Select|MenuAction_Cancel);
SetMenuTitle(g_PrimaryMenu, "[VIP] Wybierz darmowa bron:");g_SecondaryGunCount=0;
CheckCloseHandle(g_SecondaryMenu);
g_SecondaryMenu = CreateMenu(MenuHandler_ChooseSecondary, MenuAction_Display|MenuAction_Select|MenuAction_Cancel);
SetMenuTitle(g_SecondaryMenu, "[VIP] Wybierz darmowa bron:");
}stock FinalizeMenus()
{
AddMenuItem(g_PrimaryMenu, "FF", "None");
AddMenuItem(g_SecondaryMenu, "FF", "None");
}bool:ParseConfigFile(const String:file[]) {
new Handle:parser = SMC_CreateParser();
SMC_SetReaders(parser, Config_NewSection, Config_UnknownKeyValue, Config_EndSection);
SMC_SetParseEnd(parser, Config_End);new line = 0;
new col = 0;
new String:error[128];
new SMCError:result = SMC_ParseFile(parser, file, line, col);
CloseHandle(parser);if (result != SMCError_Okay) {
SMC_GetErrorString(result, error, sizeof(error));
LogError("%s on line %d, col %d of %s", error, line, col, file);
}return (result == SMCError_Okay);
}new g_configLevel;
public SMCResult:Config_NewSection(Handle:parser, const String:section[], bool:quotes)
{
g_configLevel++;
if (g_configLevel==2)
{
if (StrEqual("PrimaryMenu", section, false)) SMC_SetReaders(parser, Config_NewSection, Config_PrimaryKeyValue, Config_EndSection);
else if (StrEqual("SecondaryMenu", section, false)) SMC_SetReaders(parser, Config_NewSection, Config_SecondaryKeyValue, Config_EndSection);
}
else SMC_SetReaders(parser, Config_NewSection, Config_UnknownKeyValue, Config_EndSection);
return SMCParse_Continue;
}public SMCResult:Config_UnknownKeyValue(Handle:parser, const String:key[], const String:value[], bool:key_quotes, bool:value_quotes)
{
SetFailState("\nDidn't recognize configuration: Level %i %s=%s", g_configLevel, key, value);
return SMCParse_Continue;
}public SMCResult:Config_PrimaryKeyValue(Handle:parser, const String:weapon_class[], const String:weapon_name[], bool:key_quotes, bool:value_quotes) {
if (g_PrimaryGunCount>=MAX_WEAPON_COUNT) SetFailState("\nToo many weapons declared!");decl String:weapon_id[4];
strcopy(g_PrimaryGuns[g_PrimaryGunCount], sizeof(g_PrimaryGuns[]), weapon_class);
Format(weapon_id, sizeof(weapon_id), "%02.2X", g_PrimaryGunCount++);
AddMenuItem(g_PrimaryMenu, weapon_id, weapon_name);
return SMCParse_Continue;
}public SMCResult:Config_SecondaryKeyValue(Handle:parser, const String:weapon_class[], const String:weapon_name[], bool:key_quotes, bool:value_quotes)
{
if (g_SecondaryGunCount>=MAX_WEAPON_COUNT) SetFailState("\nToo many weapons declared!");decl String:weapon_id[4];
strcopy(g_SecondaryGuns[g_SecondaryGunCount], sizeof(g_SecondaryGuns[]), weapon_class);
Format(weapon_id, sizeof(weapon_id), "%02.2X", g_SecondaryGunCount++);
AddMenuItem(g_SecondaryMenu, weapon_id, weapon_name);
return SMCParse_Continue;
}public SMCResult:Config_EndSection(Handle:parser)
{
g_configLevel--;
SMC_SetReaders(parser, Config_NewSection, Config_UnknownKeyValue, Config_EndSection);
return SMCParse_Continue;
}public Config_End(Handle:parser, bool:halted, bool:failed)
{
if (failed) SetFailState("\nPlugin error");
}public MenuHandler_ChoosePrimary(Handle:menu, MenuAction:action, param1, param2)
{
if (action == MenuAction_Display) g_MenuOpen[param1] = true;
else if (action == MenuAction_Select)
{
new client = param1;
new team = GetClientTeam(client);
decl String:weapon_id[4];
GetMenuItem(menu, param2, weapon_id, sizeof(weapon_id));
new weapon = StringToInt(weapon_id, 16);g_PlayerPrimary[client] = weapon;
if (team > CS_TEAM_SPECTATOR) GivePrimary(client);DisplayMenu(g_SecondaryMenu, client, MENU_TIME_FOREVER);
}
else if (action == MenuAction_Cancel)
{
g_MenuOpen[param1] = false;
if (param2 == MenuCancel_Exit) // CancelClientMenu sends MenuCancel_Interrupted reason
{
if (g_SecondaryMenu != INVALID_HANDLE) DisplayMenu(g_SecondaryMenu, param1, MENU_TIME_FOREVER);
}
}
}public MenuHandler_ChooseSecondary(Handle:menu, MenuAction:action, param1, param2)
{
if (action == MenuAction_Display) g_MenuOpen[param1] = true;
else if (action == MenuAction_Select)
{
new client = param1;
new team = GetClientTeam(client);
decl String:weapon_id[4];
GetMenuItem(menu, param2, weapon_id, sizeof(weapon_id));
new weapon = StringToInt(weapon_id, 16);g_PlayerSecondary[client] = weapon;
if (team > CS_TEAM_SPECTATOR) GiveSecondary(client);
}
else if (action == MenuAction_Cancel) g_MenuOpen[param1] = false;
}public Action:Event_HandleSpawn(Handle:timer, any:user)
{
new client = GetClientOfUserId(user);
new g_menu_round = GetConVarInt(Menu_round);
if (!client) return;if (GetConVarBool(Menu_onspawn) && Rounds >= g_menu_round > 0 )
{
if (g_PlayerPrimary[client]==SHOW_MENU && g_PlayerSecondary[client]==SHOW_MENU)
{
if (g_PrimaryMenu != INVALID_HANDLE) DisplayMenu(g_PrimaryMenu, client, MENU_TIME_FOREVER);
else if (g_SecondaryMenu != INVALID_HANDLE) DisplayMenu(g_SecondaryMenu, client, MENU_TIME_FOREVER);
}
else
{
GivePrimary(client);
GiveSecondary(client);
}
}
}stock GivePrimary(client)
{
new weapon = g_PlayerPrimary[client];
RemoveWeaponBySlot(client, 0);
if (weapon >= 0 && weapon < g_PrimaryGunCount) GivePlayerItem(client, g_PrimaryGuns[weapon]);
}stock GiveSecondary(client)
{
new weapon = g_PlayerSecondary[client];
RemoveWeaponBySlot(client, 1);
if (weapon >= 0 && weapon < g_SecondaryGunCount) GivePlayerItem(client, g_SecondaryGuns[weapon]);
}public Action:Command_VipMenu(client, args)
{
new g_menu_round = GetConVarInt(Menu_round);
if (IsPlayerGenericAdmin(client))
{
if (IsClientInGame(client) && Rounds >= g_menu_round > 0 && GetConVarBool(Menu_command))
{
if (g_PrimaryMenu != INVALID_HANDLE) DisplayMenu(g_PrimaryMenu, client, MENU_TIME_FOREVER);
else if (g_SecondaryMenu != INVALID_HANDLE) DisplayMenu(g_SecondaryMenu, client, MENU_TIME_FOREVER);
}
}
return Plugin_Continue;
}stock CheckCloseHandle(&Handle:handle)
{
if (handle != INVALID_HANDLE)
{
CloseHandle(handle);
handle = INVALID_HANDLE;
}
}
stock min(a, b) {return (a<b) ? a:b;}
stock max(a, b) {return (a>b) ? a:b;}/*
@param client idreturn bool
*/
bool:IsPlayerGenericAdmin(client)
{
if (!CheckCommandAccess(client, "sm_vip", 0, true)) return false;
{
return true;}
} -
Szukam kogoś kto pomoze mi w konfiguracji plików serwera( powie co i jak) dodajcie mnie od znaomych albo priv
-
-
Ja mam tylko plik sm_hosties.sp
/*
* SourceMod Hosties Project
* by: SourceMod Hosties Dev Team
*
* This file is part of the SM Hosties project.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <adminmenu>
#include <sdkhooks>
#include <hosties>
#include <emitsoundany>#undef REQUIRE_PLUGIN
#undef REQUIRE_EXTENSIONS
#tryinclude <SteamWorks>
#tryinclude <sourcebans>
#define REQUIRE_EXTENSIONS
#define REQUIRE_PLUGIN// Compiler directives
#pragma semicolon 1// Constants
#define PLUGIN_VERSION "2.1.3b"
#define MAX_DISPLAYNAME_SIZE 64
#define MAX_DATAENTRY_SIZE 5
#define SERVERTAG "SM Hosties v2.1"// Note: you cannot safely turn these modules on and off yet. Use cvars to disable functionality.
// Add ability to disable collisions for players
#define MODULE_NOBLOCK 1
// Add the last request system
#define MODULE_LASTREQUEST 1
// Add a game description override
#define MODULE_GAMEDESCRIPTION 1
// Add start weapons for both teams
#define MODULE_STARTWEAPONS 1
// Add round-end team overlays
#define MODULE_TEAMOVERLAYS 1
// Add !rules command
#define MODULE_RULES 1
// Add !checkplayers command
#define MODULE_CHECKPLAYERS 1
// Add muting system
#define MODULE_MUTE 1
// Add freekill detection and prevention
#define MODULE_FREEKILL 1
// Add gun safety
#define MODULE_GUNSAFETY 1
// Add intelli-respawn
#define MODULE_RESPAWN 1
// Add control system
#define MODULE_CONTROL 0/******************************************************************************
!EDIT BELOW THIS COMMENT AT YOUR OWN PERIL!
******************************************************************************/// Global vars
new bool:g_bSBAvailable = false; // SourceBans
new GameType:g_Game = Game_Unknown;new Handle:gH_Cvar_Freekill_Sound = INVALID_HANDLE;
new Handle:gH_Cvar_Freekill_Threshold = INVALID_HANDLE;
new Handle:gH_Cvar_Freekill_Notify = INVALID_HANDLE;
new Handle:gH_Cvar_Freekill_BanLength = INVALID_HANDLE;
new Handle:gH_Cvar_Freekill_Punishment = INVALID_HANDLE;
new Handle:gH_Cvar_Freekill_Reset = INVALID_HANDLE;
new Handle:gH_Cvar_Freekill_Sound_Mode = INVALID_HANDLE;
new String:gShadow_Freekill_Sound[PLATFORM_MAX_PATH];
new Handle:gH_TopMenu = INVALID_HANDLE;
new TopMenuObject:gM_Hosties = INVALID_TOPMENUOBJECT;
new gShadow_Freekill_Threshold;
new gShadow_Freekill_BanLength;
new gShadow_Freekill_Reset;
new gShadow_Freekill_Sound_Mode;
new FreekillPunishment:gShadow_Freekill_Punishment;
new bool:gShadow_Freekill_Notify;
new gA_FreekillsOfCT[MAXPLAYERS+1];#if (MODULE_NOBLOCK == 1)
#include "hosties/noblock.sp"
#endif
#if (MODULE_LASTREQUEST == 1)
#include "hosties/lastrequest.sp"
#endif
#if (MODULE_GAMEDESCRIPTION == 1)
#include "hosties/gamedescription.sp"
#endif
#if (MODULE_STARTWEAPONS == 1)
#include "hosties/startweapons.sp"
#endif
#if (MODULE_TEAMOVERLAYS == 1)
#include "hosties/teamoverlays.sp"
#endif
#if (MODULE_RULES == 1)
#include "hosties/rules.sp"
#endif
#if (MODULE_CHECKPLAYERS == 1)
#include "hosties/checkplayers.sp"
#endif
#if (MODULE_MUTE == 1)
#include "hosties/muteprisoners.sp"
#endif
#if (MODULE_FREEKILL == 1)
#include "hosties/freekillers.sp"
#endif
#if (MODULE_GUNSAFETY == 1)
#include "hosties/gunsafety.sp"
#endif
#if (MODULE_RESPAWN == 1)
#include "hosties/respawn.sp"
#endif
#if (MODULE_CONTROL == 1)
#include "hosties/control.sp"
#endif// ConVars
new Handle:gH_Cvar_Add_ServerTag = INVALID_HANDLE;
new Handle:gH_Cvar_Display_Advert = INVALID_HANDLE;public Plugin:myinfo =
{
name = "SM_Hosties v2",
author = "databomb & dataviruset & comando",
description = "Hosties/jailbreak plugin for SourceMod",
version = PLUGIN_VERSION,
url = "http://forums.alliedmods.net/showthread.php?t=108810"
};public OnPluginStart()
{
// Load translations
LoadTranslations("common.phrases");
LoadTranslations("hosties.phrases");// Events hooks
HookEvent("round_start", Event_RoundStart);// Create ConVars
gH_Cvar_Add_ServerTag = CreateConVar("sm_hosties_add_servertag", "1", "Enable or disable automatic adding of SM_Hosties in sv_tags (visible from the server browser in CS:S): 0 - disable, 1 - enable", 0, true, 0.0, true, 1.0);
gH_Cvar_Display_Advert = CreateConVar("sm_hosties_display_advert", "1", "Enable or disable the display of the Powered by SM Hosties message at the start of each round.", 0, true, 0.0, true, 1.0);
CreateConVar("sm_hosties_version", PLUGIN_VERSION, "SM_Hosties plugin version (unchangeable)", 0|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
RegAdminCmd("sm_hostiesadmin", Command_HostiesAdmin, ADMFLAG_SLAY);
#if (MODULE_STARTWEAPONS == 1)
StartWeapons_OnPluginStart();
#endif
#if (MODULE_NOBLOCK == 1)
NoBlock_OnPluginStart();
#endif
#if (MODULE_CHECKPLAYERS == 1)
CheckPlayers_OnPluginStart();
#endif
#if (MODULE_RULES == 1)
Rules_OnPluginStart();
#endif
#if (MODULE_GAMEDESCRIPTION == 1)
GameDescription_OnPluginStart();
#endif
#if (MODULE_TEAMOVERLAYS == 1)
TeamOverlays_OnPluginStart();
#endif
#if (MODULE_LASTREQUEST == 1)
LastRequest_OnPluginStart();
#endif
#if (MODULE_MUTE == 1)
MutePrisoners_OnPluginStart();
#endif
#if (MODULE_FREEKILL == 1)
Freekillers_OnPluginStart();
#endif
#if (MODULE_GUNSAFETY == 1)
GunSafety_OnPluginStart();
#endif
#if (MODULE_RESPAWN == 1)
Respawn_OnPluginStart();
#endif
#if (MODULE_CONTROL == 1)
Control_OnPluginStart();
#endif
AutoExecConfig(true, "sm_hosties2");
}public OnMapStart()
{
#if (MODULE_TEAMOVERLAYS == 1)
TeamOverlays_OnMapStart();
#endif
#if (MODULE_LASTREQUEST == 1)
LastRequest_OnMapStart();
#endif
#if (MODULE_CONTROL == 1)
Control_OnMapStart();
#endif
}public OnMapEnd()
{
#if (MODULE_FREEKILL == 1)
Freekillers_OnMapEnd();
#endif
}public OnAllPluginsLoaded()
{
if (LibraryExists("sourcebans"))
{
g_bSBAvailable = true;
}
new Handle:h_TopMenu = GetAdminTopMenu();
if (LibraryExists("adminmenu") && (h_TopMenu != INVALID_HANDLE))
{
OnAdminMenuReady(h_TopMenu);
}
#if (MODULE_MUTE == 1)
MutePrisoners_AllPluginsLoaded();
#endif
}public APLRes:AskPluginLoad2(Handle:h_Myself, bool:bLateLoaded, String:sError[], error_max)
{
if (GetEngineVersion() == Engine_CSS)
{
g_Game = Game_CSS;
}
else if (GetEngineVersion() == Engine_CSGO)
{
g_Game = Game_CSGO;
}
else
{
SetFailState("Game is not supported.");
}MarkNativeAsOptional("SteamWorks_SetGameDescription");
LastRequest_APL();
RegPluginLibrary("hosties");
return APLRes_Success;
}public OnLibraryAdded(const String:name[])
{
if (StrEqual(name, "sourcebans"))
{
g_bSBAvailable = true;
}
else if (StrEqual(name, "adminmenu") && (GetAdminTopMenu() != INVALID_HANDLE))
{
OnAdminMenuReady(GetAdminTopMenu());
}
}public OnLibraryRemoved(const String:name[])
{
if (StrEqual(name, "sourcebans"))
{
g_bSBAvailable = false;
}
else if (StrEqual(name, "adminmenu"))
{
gH_TopMenu = GetAdminTopMenu();
}
}public OnConfigsExecuted()
{
if (GetConVarInt(gH_Cvar_Add_ServerTag) == 1)
{
ServerCommand("sv_tags %s\n", SERVERTAG);
}
#if (MODULE_FREEKILL == 1)
Freekillers_OnConfigsExecuted();
#endif
#if (MODULE_MUTE == 1)
MutePrisoners_OnConfigsExecuted();
#endif
#if (MODULE_CHECKPLAYERS == 1)
CheckPlayers_OnConfigsExecuted();
#endif
#if (MODULE_GAMEDESCRIPTION == 1)
GameDesc_OnConfigsExecuted();
#endif
#if (MODULE_TEAMOVERLAYS == 1)
TeamOverlays_OnConfigsExecuted();
#endif
#if (MODULE_RULES == 1)
Rules_OnConfigsExecuted();
#endif
#if (MODULE_LASTREQUEST == 1)
LastRequest_OnConfigsExecuted();
#endif
#if (MODULE_NOBLOCK == 1)
NoBlock_OnConfigsExecuted();
#endif
#if (MODULE_STARTWEAPONS == 1)
StartWeapons_OnConfigsExecuted();
#endif
}public OnClientPutInServer(client)
{
LastRequest_ClientPutInServer(client);
Freekillers_ClientPutInServer(client);
}public Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
if (GetConVarInt(gH_Cvar_Display_Advert))
{
// Print out a messages about SM_Hosties
PrintToChatAll(CHAT_BANNER, "Powered By Hosties");
}
}public OnAdminMenuReady(Handle:h_TopMenu)
{
// block double calls
if (h_TopMenu == gH_TopMenu)
{
return;
}
gH_TopMenu = h_TopMenu;
// Build Hosties menu
gM_Hosties = AddToTopMenu(gH_TopMenu, "Hosties", TopMenuObject_Category, HostiesCategoryHandler, INVALID_TOPMENUOBJECT);
if (gM_Hosties == INVALID_TOPMENUOBJECT)
{
return;
}
// Let other modules add menu objects
LastRequest_Menus(gH_TopMenu, gM_Hosties);
GunSafety_Menus(gH_TopMenu, gM_Hosties);
Respawn_Menus(gH_TopMenu, gM_Hosties);
}public Action:Command_HostiesAdmin(client, args)
{
DisplayTopMenu(gH_TopMenu, client, TopMenuPosition_LastRoot);
return Plugin_Handled;
}public HostiesCategoryHandler(Handle:h_TopMenu, TopMenuAction:action, TopMenuObject:item, param, String:buffer[], maxlength)
{
switch (action)
{
case (TopMenuAction_DisplayTitle):
{
if (item == gM_Hosties)
{
Format(buffer, maxlength, "Hosties:");
}
}
case (TopMenuAction_DisplayOption):
{
if (item == gM_Hosties)
{
Format(buffer, maxlength, "Hosties");
}
}
}
} -
-
-
Dopiero chciał kupić a już mi sprzedaje....
-
Szukam działających pluginów na skiny i kosy na serwer. Nwm czy źle szukam ale od dwóch dni siedzę i znajduje chujowe plugi co albo nie dizałaja albo dzialaja z błedami
-
Zainstalowałem paczke dd2 od zmoorga i na serwerze występują takie bugi jak to że jak wpiszę !paints to bronie się bugują jak bym spamował qqqqqqqqqqqqq
Serwer też dostaje disconnect co kilka min
-
Jakiejś konkretnej linijki szukać?
To wszystko co tam mam
res_ct_path "misc/tecnohard" - Path of sounds played when ct wins.
res_tr_path "misc/tecnohard" - Path of sounds played when t wins.
res_draw_path "1" - Path of sounds played when Round Draw or 0 - Don´t play sounds, 1 - Play TR sounds, 2 - Play CT sounds
res_play_type "1" - Play type 1 - Random, 2- Play in queue
res_rounddraw_play - To choose if you wan´t play sounds whena no one wins.******
// This file was auto-generated by SourceMod (v1.8.0.5969)
// ConVars for plugin "abner_res.smx"
// Plugin version
// -
// Default: "3.5fix"
abner_res_version "3.5fix"// Enable/Disable client preferences
// -
// Default: "1"
res_client_preferences "1"// Path of sounds played when Counter-Terrorists Win the round
// -
// Default: "misc/tecnohard"
res_ct_path "misc/tecnohard"// Path of sounds played when Round Draw or 0 - Don´t play sounds, 1 - Play TR sounds, 2 - Play CT sounds
// -
// Default: "1"
res_draw_path "1"// 1 - Random, 2 - Play in queue
// -
// Default: "1"
res_play_type "1"// Print mp3 name in chat (Suggested by m22b)
// -
// Default: "0"
res_print_to_chat_mp3_name "1"// Stop map musics
// -
// Default: "1"
res_stop_map_music "1"// Path of sounds played when Terrorists Win the round
// -
// Default: "misc/tecnohard"
res_tr_path "misc/tecnohard"działa juz dopisałem kilka linijek
// -
// Default: "misc/tecnohard"
res_ct_path "misc/tecnohard"// Path of sounds played when Round Draw or 0 - Don´t play sounds, 1 - Play TR sounds, 2 - Play CT sounds
// -
// Default: "1"
res_draw_path "1"// 1 - Random, 2 - Play in queue
// -
// Default: "1"
res_play_type "1"// Print mp3 name in chat (Suggested by m22b)
// -
// Default: "0"
res_print_to_chat_mp3_name "1"// Stop map musics
// -
// Default: "1"
res_stop_map_music "1" -
-
-
rankme
w Pytania ogólne
Opublikowano
rank me działał i po czasie kiedy postanowiłem zresetować ranking graczy juz nie diziała
nie wyswielta nic po wpisaniu /rank
fast help