Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

ogbudowa

Użytkownik
  • Postów

    26
  • Dołączył

  • Ostatnia wizyta

  • Wygrane w rankingu

    1

Treść opublikowana przez ogbudowa

  1. Wyświetla się ostatnia bo nadpisujesz zmienną chat Z której korzystasz tutaj
  2. Plugin "na rtv" domyślnie znajduje się w katalogu plugins/disabled pod nazwą "rockthevote.smx", wystarczy że przeniesiesz go do katalogu plugins.
  3. native float GoMod_AddEuro(int client, float amount); zgaduje że jak pod parametrem amount jest wartosc ujemna to odejmie graczowi euro
  4. #include <sourcemod> #include <cstrike> #include <sdktools> #define freeze_time 3.0 #define freeze_sound "physics/glass/glass_impact_bullet4.wav" float g_freeze_time[MAXPLAYERS + 1] = {0.0, ...} public OnPluginStart() { HookEvent("player_hurt", player_hurt); } public OnMapStart() { PrecacheSound(freeze_sound, true); } public Action player_hurt(Event e, const char[] n, bool b) { char weapon[256]; GetEventString(e, "weapon", weapon, sizeof(weapon)); if (strlen(weapon) > 0) { int vic = GetClientOfUserId(GetEventInt(e, "userid")); float vec[3]; GetClientAbsOrigin(vic, vec); EmitAmbientSound(freeze_sound, vec, vic, SNDLEVEL_RAIDSIREN); g_freeze_time[vic] = freeze_time; freeze_player(vic); CreateTimer(1.0, freeze_timer, vic, TIMER_REPEAT); } return Plugin_Continue; } public Action freeze_player(int client) { SetEntityMoveType(client, MOVETYPE_NONE); SetEntityRenderColor(client, 0, 128, 255, 192); } public Action unfreeze_player(int client) { SetEntityMoveType(client, MOVETYPE_WALK); SetEntityRenderColor(client, 255, 255, 255, 255); } public Action freeze_timer(Handle timer, int vic) { if (g_freeze_time[vic] == 0.0) { unfreeze_player(vic); KillTimer(timer); return Plugin_Stop; } g_freeze_time[vic]--; return Plugin_Continue; } powinno działać
  5. #include <sourcemod> #include <cstrike> #define tt_text "Terroryści" #define ct_text "Antyterroryści" #define refresh_time 0.5 public OnMapStart() { CreateTimer(refresh_time, refresh_hud, _, TIMER_REPEAT); } public Action refresh_hud(Handle timer) { for (int i = 1; i <= MaxClients; i++) { if (is_valid_client(i)) draw_text(i); } } int draw_text(int client) { if (!is_valid_client(client)) return 0; int count_tt = get_all_players(CS_TEAM_T); int count_ct = get_all_players(CS_TEAM_CT); SetHudTextParams(0.01, 0.02, refresh_time, 255, 255, 255, 0); ShowHudText(client, -1, "%s: %d", tt_text, count_tt); SetHudTextParams(0.01, 0.06, refresh_time, 255, 255, 255, 0); ShowHudText(client, -1, "%s: %d", ct_text, count_ct); return 0; } int get_all_players(int team) { int counter = 0; for (int i = 1; i <= MaxClients; i++) { if (is_valid_client(i) && IsPlayerAlive(i) && GetClientTeam(i) == team) counter++; } return counter; } stock bool is_valid_client(int client) { return (client >= 1 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && !IsClientSourceTV(client)); }
  6. raczej powinno działać losowyvip.sp losowyvip.smx dropbomb.sp dropbomb.smx
  7. #include <sourcemod> #include <sdktools> bool g_Msg[MAXPLAYERS + 1] = {true, ...}; char Toggler[256]; public OnPluginStart() { RegConsoleCmd("sm_menubroni", bronie); } public Action bronie(int client, int args) { Menu gMenu = new Menu(gMenu_Handler); gMenu.SetTitle("Wybierz broń!"); gMenu.AddItem("1", "BROŃ - AK-47"); gMenu.AddItem("2", "BROŃ - NEGEV"); Format(Toggler, sizeof(Toggler), "%s Wiadomości przy wybieraniu broni", (g_Msg[client] ? "[ON]" : "[OFF]")); gMenu.AddItem("3", Toggler); gMenu.Display(client, MENU_TIME_FOREVER); return Plugin_Handled; } int gMenu_Handler(Menu menu, MenuAction action, int client, int pos) { switch(action) { case MenuAction_Select: { switch(pos) { case 0: { GivePlayerItem(client, "weapon_ak47"); if (g_Msg[client]) PrintToChat(client, " \x0B [BRONIE] \x04 ★\x02Twoja broń to \x01 AK-47\x04★"); // wybierajac opcje nr3 chcialbym aby ta wiadomosc nie wyswietlala sie, lub jesli juz byly wylaczona to zeby sie wyswietlala } case 1: { GivePlayerItem(client, "weapon_negev"); if (g_Msg[client]) PrintToChat(client, " \x0B [BRONIE] \x04 ★\x02Twoja broń to \x01 NEGEV\x04★"); // wybierajac opcje nr3 chcialbym aby ta wiadomosc nie wyswietlala sie, lub jesli juz byly wylaczona to zeby sie wyswietlala } case 2: { PrintToChat(client, "\x03 Wiadomości zostały: %s.", (g_Msg[client] ? "wyłączone" : "włączone")); g_Msg[client] = !g_Msg[client]; FakeClientCommandEx(client, "sm_menubroni"); } } } case MenuAction_End: delete menu; } return 0; }
  8. #include <sourcemod> #include <sdktools> #define TAG " \x0F[STEAMID]\x01" #define FORMAT "%s %s - %s" public OnPluginStart() { RegConsoleCmd("sm_steamid", GetSteamID); LoadTranslations("common.phrases"); } public Action GetSteamID(int client, int args) { char arg[MAX_TARGET_LENGTH], ClientName[MAX_NAME_LENGTH], ClientSteamId[32]; GetCmdArg(1, arg, sizeof(arg)); int target = FindTarget(client, arg); if (target == -1) { return Plugin_Handled; } GetClientName(target, ClientName, sizeof(ClientName)); GetClientAuthId(target, AuthId_Steam2, ClientSteamId, sizeof(ClientSteamId)); PrintToChat(client, FORMAT, TAG, ClientName, ClientSteamId); return Plugin_Handled; }
  9. Nie wiem czy o to ci chodziło, tutaj możesz adminów dodawać do pliku .ini admins_list.ini admins_list.sp
  10. PrintHintText("Za dużo jest terrorystów!"); zmien na PrintHintText(client, "Za dużo jest terrorystów!");
  11. #include <sourcemod> #include <cstrike> public OnPluginStart() { AddCommandListener(CommandChangeTeam, "jointeam"); AddCommandListener(CommandChangeTeam, "changeteam"); } public Action CommandChangeTeam(int client, const char[] command, int argc) { char arg[32]; GetCmdArg(1, arg, sizeof(arg)); if (StringToInt(arg) == CS_TEAM_T) { int PlayersCT = GetClientsOfTeam(CS_TEAM_CT); int PlayersTT = GetClientsOfTeam(CS_TEAM_T); if ((PlayersTT / PlayersCT) > 0.25) { PrintHintText("Za dużo jest terrorystów!"); return Plugin_Handled; } } return Plugin_Continue; } stock bool IsValidClient(int client) { return (client >= 1 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && !IsClientSourceTV(client)); } stock int GetClientsOfTeam(int team) { int b = 0; for (int i = 1; i <= MaxClients; i++) { if(IsValidClient(i) && IsPlayerAlive(i) && GetClientTeam(i) == team) b++; } return b; } powinno zadziałać lecz nie testowałem bo nie mam jak
  12. #include <sourcemod> char ClientColor[MAXPLAYERS + 1][256]; char red[256], green[256], blue[256], tytul[256], path[256]; KeyValues kv; public OnPluginStart() { RegConsoleCmd("sm_kolorek", Menu_Colors); HookEvent("player_spawn", Player_Reset); } public Action Player_Reset(Event e, const char[] n, bool b) { int client = GetClientOfUserId(GetEventInt(e, "userid")); SetColor(client, ClientColor[client]); } public Action Menu_Colors(int client, int args) { Menu menu = new Menu(Menu_Handler); menu.SetTitle("Menu kolorów"); BuildPath(Path_SM, path, sizeof(path), "configs/plugin-kolory.ini"); kv = new KeyValues("Kolory"); kv.ImportFromFile(path); if (!kv.GotoFirstSubKey()) { delete kv; return Plugin_Handled; } do { kv.GetString("red", red, sizeof(red)); kv.GetString("green", green, sizeof(green)); kv.GetString("blue", blue, sizeof(blue)); kv.GetSectionName(tytul, sizeof(tytul)) menu.AddItem(tytul, tytul); } while (kv.GotoNextKey()); menu.Display(client, MENU_TIME_FOREVER); return Plugin_Handled; } void SetColor(int ent, const char[] Item) { kv.ImportFromFile(path); if (!kv.GotoFirstSubKey()) { delete kv; return Plugin_Handled; } do { char Wybor[64]; kv.GetSectionName(Wybor, sizeof(Wybor)); if (StrEqual(Item, Wybor)) { SetEntityRenderColor(ent, kv.GetNum("red"), kv.GetNum("green"), kv.GetNum("blue"), kv.GetNum("alpha")); break; } } while (kv.GotoNextKey()); } int Menu_Handler(Menu menu, MenuAction action, int client, int param2) { switch (action) { case MenuAction_Select: { char Item[64]; menu.GetItem(param2, Item, sizeof(Item)); ClientColor[client] = Item; SetColor(client, Item); } case MenuAction_End: delete menu; } return 0; } do tego pluginu potrzebujesz configu, którego wrzucasz do sourcemod/configs, w który podajesz nazwy kolorów wraz z paletą rgba #include <sourcemod> #include <sdktools> ConVar g_ShowDmgHintText; public OnPluginStart() { g_ShowDmgHintText = CreateConVar("sm_showdmg", "0", "Obrażenia"); HookEvent("player_hurt", Player_Hurt); AutoExecConfig(true, "cfg_showdmg"); } public Action Player_Hurt(Event e, const char[] n, bool b) { if (!g_ShowDmgHintText.BoolValue) return Plugin_Handled; int attacker = GetClientOfUserId(GetEventInt(e, "attacker")); int victim = GetClientOfUserId(GetEventInt(e, "userid")); int donedmg = GetEventInt(e, "dmg_health"); char victimName[64]; GetClientName(victim, victimName, sizeof(victimName)); PrintHintText(attacker, "Zadałeś %s %d obrażeń", victimName, donedmg); return Plugin_Continue; } a ten plugin sam tworzy plik cfg w csgo/cfg/sourcemod, w którym możesz pozmieniać cvary lub w grze jeżeli są to pojedyncze opcje to celowałbym w cvary, które nie wymagają aż tylu lini kodu
  13. Zależy co masz na myśli "config", chodzi ci o ConVary czy czytanie z pliku przez Kv
  14. zgaduję że twój serwer stoi na linuxie a pobierasz sm/mm na windowsa lub na odwrót
  15. public OnPluginStart() { AddCommandListener(BlockTeamChange, "jointeam"); } public Action BlockTeamChange(int client, const char[] command, int argc) { char arg[32]; GetCmdArg(1, arg, sizeof(arg)); if (StringToInt(arg) == CS_TEAM_T) { int CT_Players = GetClientsOfTeam(CS_TEAM_CT); int TT_Players = GetClientsOfTeam(CS_TEAM_T); if (CT_Players <= 4) { if (TT_Players) return Plugin_Handled; } else if (CT_Players > 4 && CT_Players <= 9) { if (TT_Players >= 2) return Plugin_Handled; } else if (CT_Players > 10 && CT_Players <= 14) { if (TT_Players >= 3) return Plugin_Handled; } else if (CT_Players > 15 && CT_Players <= 20) { if (TT_Players >= 4) return Plugin_Handled; } } return Plugin_Continue; } Najprościej możesz to zrobić w taki sposób
  16. tak a w cfg/sourcemod/bomb_sound.cfg zmieniasz na taka samą jak nazwa muzyki
  17. zależy to wszystko od tego jaki plugin na sklep posiadasz, jeżeli zephyrus to do używania w/w zadań na czacie wymagany jest Simple Chat Processor (Redux), jeżeli nie pokazują się modele, to nie są one wgrane poprawnie na twój serwer bądź zła ścieżka do modeli w items.txt
  18. #include <sourcemod> #include <sdktools> ConVar g_c4Timer; ConVar g_SoundName; ConVar g_SoundVolume; float c4Timer; float Tick = 0.0; char SoundName[256]; public OnPluginStart() { g_SoundName = CreateConVar("sm_bomb_sound_name", "nazwa_piosenki.mp3", "Nazwa pliku .mp3/.wav"); g_SoundVolume = CreateConVar("sm_bomb_sound_volume", "0.05", "Głośnośc piosenki"); HookEvent("bomb_planted", Bomb_Planted); AutoExecConfig(true, "bomb_sound"); } public Action Bomb_Planted(Event e, const char[] name, bool broadCast) { g_c4Timer = FindConVar("mp_c4timer"); c4Timer = GetConVarFloat(g_c4Timer); Tick = 0.0; CreateTimer(1.0, BombTick, _, TIMER_REPEAT); } public Action BombTick(Handle timer) { Tick++; float TimeToExplose = c4Timer - Tick; if (TimeToExplose == 12.0) EmitSoundToAll(SoundName, _, _, _, _, GetConVarFloat(g_SoundVolume), _, _, _, _, _, _); else { if (TimeToExplose <= 0) { for (int i = 1; i <= MaxClients; i++) StopSound(i, SNDCHAN_AUTO, SoundName); KillTimer(timer); } } } public OnClientConnected(int client) { PrecacheFix(); } void PrecacheFix() { GetConVarString(g_SoundName, SoundName, sizeof(SoundName)); Format(SoundName, sizeof(SoundName), "sound/%s", SoundName); AddFileToDownloadsTable(SoundName); GetConVarString(g_SoundName, SoundName, sizeof(SoundName)); Format(SoundName, sizeof(SoundName), "*/%s", SoundName); PrecacheSound(SoundName); } Piosenkę wrzucasz do folderu sound, a w cfg/sourcemod/bomb_sound.cfg ustawiasz nazwę oraz głośność
  19. #include <sourcemod> #include <cstrike> #include <clients> public OnPluginStart() { RegConsoleCmd("sm_menu", CMD_Menu); } public Action CMD_Menu(int client, int args) { if (!IsClientConnected(client) || IsFakeClient(client)) return Plugin_Handled; Menu menu = new Menu(Menu_Handle); menu.SetTitle("Wybór drużyny\nMenu dla [%s]", (GetClientTeam(client) == CS_TEAM_CT ? "CT" : "TT")); menu.AddItem("1", "CT", (GetClientTeam(client) == CS_TEAM_CT ? ITEMDRAW_DISABLED : ITEMDRAW_DEFAULT)); menu.AddItem("2", "TT", (GetClientTeam(client) == CS_TEAM_T ? ITEMDRAW_DISABLED : ITEMDRAW_DEFAULT)); menu.AddItem("3", "Spectator"); menu.ExitButton = true; menu.Display(client, MENU_TIME_FOREVER); return Plugin_Handled; } int Menu_Handle(Menu menu, MenuAction action, int client, int param2) { switch (action) { case MenuAction_Select: { char choice[32]; menu.GetItem(param2, choice, sizeof(choice)); if (StrEqual(choice, "1")) ChangeClientTeam(client, CS_TEAM_CT); else if (StrEqual(choice, "2")) ChangeClientTeam(client, CS_TEAM_T); else ChangeClientTeam(client, CS_TEAM_SPECTATOR); } } return 0; } lub możesz zrobić dwa menu dla CT oraz TT
×
×
  • Dodaj nową pozycję...