-
Postów
1007 -
Dołączył
-
Ostatnia wizyta
-
Wygrane w rankingu
72
Odpowiedzi opublikowane przez SUPER TIMOR
-
-
Ale mój "Expert" napisał mi tak jak ja napisałem, że dziwne że to nie działa bo przecież robi się w ten sposób, który zaprezentował kolega wyżej.
Kod wkleiłem dobrze, jednakże return bez ; był i pewnie to jest problemem. Zaraz sprawdzę, czy patent działa.
Przekazać chciałem to, że jestem Ci wdzięczny za zaangażowanie i (cenzura) że odbieracie w ten sposób moje wypowiedzi - już więcej nie będę szczery, obiecuję.
W dzisiejszych czasach trzeba zgrywać żeby wyglądać na to wychodzi :D
A kod zamierzam skompilować i wgrać jako osobny plugin - czy nie?
//edit
dobra, (cenzura) serio ja was nie rozumiem - podchodzę do tematu z kulturą, opisuję DOSŁOWNIE co się dzieje to doszukujecie się niestworzonych rzeczy i się o nie obrażacie .. dosłownie jak moja kobieta (czyt. nie przynależność, traktuj jako - gwara młodzieżowa, nawiązanie do pary (2 osoby w związku - stąd "moja", bo nie "wasza"/"jego") <- dla jasności, żebyście się tego nie czepili .... Przeczytajcie jeszcze raz moją pierwszą "kontrowersyjną" na to wychodzi wypowiedź i doszukajcie się w niej głównego sensu, a nie drugiego dna którego nie ma XD?
// poza tym przyznałem się pisząc
17 godzin temu, Bartosz Borowski napisał:Tak naprawdę wgrałem go odrazu, ślinka mi ciekła.
Nie zadziałał, więc odpisałem tutaj udając głupio-mądrego.
Sprawdzę jutro, mój ekspert-programista napisał mi "przecież tak się robi, to nie żart", więc podziękuję Ci już teraz.
Pozdro!
do skłamania w 1 poście. To ja może rozłożę to na czynniki pierwsze :
Tak naprawdę wgrałem go odrazu, ślinka mi ciekła. - Tutaj autor miał na myśli, że był bardzo szczęśliwy z tego, że ktoś napisał dla niego plugin za darmo. Z głupiej prośby na forum. Skopiował więc zawartość by ją skompilować i wrzucić na hosting.
Nie zadziałał, więc odpisałem tutaj udając głupio-mądrego. - Podmiot liryczny miał na myśli, że w pierwszym poście chciał udowodnić, że ma jakieś pojęcie na temat tego co tu się w ogóle odstawia, więc zapisał swoje obserwacje udając właśnie przysłowiowego "głupio-mądrego".
Sprawdzę jutro, mój ekspert-programista napisał mi "przecież tak się robi, to nie żart", więc podziękuję Ci już teraz. - W międzyczasie autor kierując się brakiem poczucia własnej wartości zapytał kolegę, który na co dzień zajmuje się podobnymi sprawami a ten mu odpowiedział "ale wszystko tam jest ok". Osoba, o której mowa została żartobliwie nazwana "ekspertem-programistą". Środek stylistyczny użyty w zdaniu to hiperbola.
Pozdro! - Inaczej pozdrowienie. http://www.miejski.pl/slowo-Pozdro
Pozdro!
-
Najwidoczniej nie warto być szczerym :P
Poważnie, nie użyłem ironii w tamtej wypowiedzi i nie starajcie się tam jej doszukać.
Serio, sprawdzałem, nie zadziałało więc wpadłem tu i napisałem obserwacje :v wiem o co wam chodzi, ale macie błędne myślenie. Dziękuję :)
-
Tak naprawdę wgrałem go odrazu, ślinka mi ciekła.
Nie zadziałał, więc odpisałem tutaj udając głupio-mądrego.
Sprawdzę jutro, mój ekspert-programista napisał mi "przecież tak się robi, to nie żart", więc podziękuję Ci już teraz.
Pozdro!
-
No niestety na szybko i nawet nie wgrywam, bo widzę, że nie zadziała..
Plugin wykryje użycie komendy i wyświetli na czacie po ponownym napisaniu "EJ EJ ZA SZYBKO!", jednak nie zablokuje wykonania czynności.
Masz jakieś inne pomysły? Napisałbym to sam, uwierz - gdybym umiał.
Pozdrawiam!
-
Spoiler
#include "prophunt/include/phclient.inc" // say /tp /third /thirdperson public Action Cmd_ToggleThirdPerson(int client, int args) { if (!IsClientInGame(client) || !IsPlayerAlive(client)) return Plugin_Stop; // Only allow Terrorists to use thirdperson view if (GetClientTeam(client) != CS_TEAM_T) { PrintToChat(client, "%s%t", PREFIX, "Only terrorists can use"); return Plugin_Handled; } if (!g_bInThirdPersonView[client]) { SetThirdPersonView(client, true); PrintToChat(client, "%s%t", PREFIX, "Type again for ego"); } else { SetThirdPersonView(client, false); } return Plugin_Continue; } // say /whistle public Action Cmd_PlayWhistle(int _client, int args) { PHClient client = GetPHClient(_client); // check if whistling is enabled if (!GetConVarBool(cvar_Whistle) || !client.isAlive) return Plugin_Handled; bool cvarWhistleSeeker = view_as<bool>(GetConVarInt(cvar_WhistleSeeker)); if (!cvarWhistleSeeker && client.team != CS_TEAM_T) { PrintToChat(client.index, "%s%t", PREFIX, "Only terrorists can use"); return Plugin_Handled; } int cvarWhistleTimes = GetConVarInt(cvar_WhistleTimes); if (client.team == CS_TEAM_T || g_iWhistleCount[client.index] < cvarWhistleTimes) { if (client.team == CS_TEAM_T) { MakeClientWhistle(client.index); PrintToChatAll("%s%N %t", PREFIX, client, "whistled"); } else { int target, iCount; float maxrange, range, clientOrigin[3]; client.GetOrigin(clientOrigin); for (int i = 1; i <= MaxClients; i++) { PHClient c = GetPHClient(i); if (c && c.isAlive && c.team == CS_TEAM_T) { iCount++; float targetOrigin[3]; c.GetOrigin(targetOrigin); range = GetVectorDistance(clientOrigin, targetOrigin); if (range > maxrange) { maxrange = range; target = i; } } } if (iCount > 1) { MakeClientWhistle(target); PrintToChatAll("%s %N forced %N to whistle.", PREFIX, client, target); g_iWhistleCount[client.index]++; PrintToChat(client.index, "%s%t", PREFIX, "whistles left", (cvarWhistleTimes - g_iWhistleCount[client.index])); } } } else { PrintToChat(client.index, "%s%t", PREFIX, "whistle limit exceeded", cvarWhistleTimes); } return Plugin_Handled; } // say /help public Action Cmd_DisplayHelp(int client, int args) { ShowMOTDPanel(client, "PropHunt", "https://tilastokeskus.github.io/sm-PropHunt/r_rules.html", MOTDPANEL_TYPE_URL); return Plugin_Handled; } // say /freeze // Freeze hiders in position public Action Cmd_Freeze(int _client, int args) { PHClient client = GetPHClient(_client); if (!GetConVarInt(cvar_HiderFreezeMode) || client.team != CS_TEAM_T || !client.isAlive) return Plugin_Handled; if (client.isFreezed) { client.SetFreezed(false); PrintToChat(client.index, "%s%t", PREFIX, "Hider Unfreezed"); } else if (GetConVarBool(cvar_HiderFreezeInAir) || (GetEntityFlags(client.index) & FL_ONGROUND)) { client.SetFreezed(true); char buffer[128]; Format(buffer, sizeof(buffer), "*/%s", g_sndFreeze); EmitSoundToClient(client.index, buffer); PrintToChat(client.index, "%s%t", PREFIX, "Hider Freezed"); } return Plugin_Handled; } // Admin Command // ph_force_whistle // Forces a terrorist player to whistle public Action ForceWhistle(int client, int args) { if (!GetConVarBool(cvar_Whistle)) { ReplyToCommand(client, "Disabled."); return Plugin_Handled; } if (GetCmdArgs() < 1) { ReplyToCommand(client, "Usage: ph_force_whistle <#userid|steamid|name>"); return Plugin_Handled; } char player[70]; GetCmdArg(1, player, sizeof(player)); int target = FindTarget(client, player); if (target == -1) return Plugin_Handled; if (GetClientTeam(target) == CS_TEAM_T && IsPlayerAlive(target)) { char sound[MAX_WHISTLE_LENGTH]; g_WhistleSounds.GetString(GetRandomInt(0, g_WhistleSounds.Length - 1), sound, MAX_WHISTLE_LENGTH); EmitSoundToAll(sound, target, SNDCHAN_AUTO, SNDLEVEL_GUNFIRE); PrintToChatAll("%s%N %t", PREFIX, target, "whistled"); } else { ReplyToCommand(client, "Hide and Seek: %t", "Only terrorists can use"); } return Plugin_Handled; } // say /whoami // displays the model name in chat again public Action Cmd_DisplayModelName(int client, int args) { // only enable command, if player already chose a model if (!IsPlayerAlive(client) || g_iModelChangeCount[client] == 0) return Plugin_Handled; // only Ts can use a model if (GetClientTeam(client) != CS_TEAM_T) { PrintToChat(client, "%s%t", PREFIX, "Only terrorists can use"); return Plugin_Handled; } char modelName[128]; GetClientModel(client, modelName, sizeof(modelName)); PrintToChat(client, "%s%t\x01 %s.", PREFIX, "Model Changed", modelName); return Plugin_Handled; } // say /ct public Action Cmd_RequestCT(int client, int args) { if (GetConVarBool(cvar_TurnsToScramble)) { PrintToChat(client, "%sCommand disabled.", PREFIX); return Plugin_Handled; } if (GetClientTeam(client) == CS_TEAM_CT) { PrintToChat(client, "%sYou are already on the seeking side", PREFIX); return Plugin_Handled; } if (g_iHiderToSeekerQueue[client] != NOT_IN_QUEUE) { PrintToChat(client, "%sYou are already in the queue", PREFIX); return Plugin_Stop; } g_iHidersInSeekerQueue++; g_iHiderToSeekerQueue[client] = g_iHidersInSeekerQueue; PrintToChat(client, "%sYou are now in the seeker queue", PREFIX); PrintToChat(client, "%sTurns until team switch: %d", PREFIX, SimulateTurnsToSeeker(g_iHidersInSeekerQueue)); return Plugin_Handled; } public Action Cmd_JoinTeam(int client, int args) { if (!client || !IsClientInGame(client) || FloatCompare(GetConVarFloat(cvar_CTRatio), 0.0) == 0) { return Plugin_Continue; } char arg[5]; if (!GetCmdArgString(arg, sizeof(arg))) { return Plugin_Continue; } int team = StringToInt(arg); // Player wants to join CT if (team == CS_TEAM_CT) { int teamClientCount[5]; teamClientCount[CS_TEAM_CT] = GetTeamClientCount(CS_TEAM_CT); teamClientCount[CS_TEAM_T] = GetTeamClientCount(CS_TEAM_T); // This client would be in CT if we continue. teamClientCount[CS_TEAM_CT]++; // And would leave T if (GetClientTeam(client) == CS_TEAM_T) teamClientCount[CS_TEAM_T]--; // Check, how many terrors are going to get switched to ct at the end of the round for (int i = 1; i <= MaxClients; i++) { if (IsClientInGame(i)) { teamClientCount[g_iClientTeam[i]]++; teamClientCount[GetClientTeam(i)]--; } } float fRatio = FloatDiv(float(teamClientCount[CS_TEAM_T]), float(teamClientCount[CS_TEAM_CT])); float fCFGRatio = GetConVarFloat(cvar_CTRatio); //PrintToServer("Debug: Player %N wants to join CT. CTCount: %d TCount: %d Ratio: %f", client, iCTCount, iTCount, FloatDiv(float(iCTCount), float(iTCount))); // There are more CTs than we want in the CT team. if (teamClientCount[CS_TEAM_CT] > 1 && fRatio < fCFGRatio) { PrintCenterText(client, "CT team is full"); //PrintToServer("Debug: Blocked."); return Plugin_Stop; } } else if (team == CS_TEAM_T) { int iCTCount = GetTeamClientCount(CS_TEAM_CT); int iTCount = GetTeamClientCount(CS_TEAM_T); iTCount++; if (GetClientTeam(client) == CS_TEAM_CT) iCTCount--; if (iCTCount == 0 && iTCount >= 2) { PrintCenterText(client, "Cannot leave CT empty"); //PrintToServer("Debug: Blocked."); return Plugin_Stop; } } return Plugin_Continue; } public Action Cmd_SelectModelMenu(int client, int args) { return ShowSelectModelMenu(client, args); }
Spoiler/* ------------------------------------------------------------------ ABOUT / CREDITS This is a revived version of PropHunt for CS:GO, written by Statistician (I sometimes go by the alias Tilastokeskus). Although this plugin has essentially been written from scratch, many snippets originate from the earlier CS:S plugin written (and abandoned) by SelaX. Anyone who thinks I should give credit to other people should call me out on it, and I'll make sure they will be mentioned appropriately. LICENCE I'm publishing this under the MIT licence, but I don't really give a shit. ------------------------------------------------------------------ */ #pragma semicolon 1 #include <sourcemod> #include <sdktools> #include <cstrike> #include <sdkhooks> #include "prophunt/include/globals.inc" #include "prophunt/include/keyvalues.inc" #include "prophunt/include/utils.inc" #pragma newdecls required #define PLUGIN_VERSION "1.0.5" public Plugin myinfo = { name = "PropHunt", author = "Statistician", description = "Terrorists choose a model and hide, CTs try to find and kill them.", version = PLUGIN_VERSION, url = "http://github.com/tilastokeskus/sm-PropHunt" }; public void OnPluginStart() { Handle hVersion = CreateConVar("ph_version", PLUGIN_VERSION, "PropHunt", FCVAR_PLUGIN | FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY | FCVAR_DONTRECORD); SetConVarString(hVersion, PLUGIN_VERSION); CreateConVars(); RegisterCommands(); AddListeners(); SetOffsets(); LoadLang(); // init clients for (int x = 1; x <= MaxClients; x++) { if (IsClientInGame(x)) OnClientPutInServer(x); } CreateTimer(120.0, SpamCommands, 0); g_hForceCamera = FindConVar("mp_forcecamera"); AutoExecConfig(true, "prophunt"); } public void OnPluginEnd() { ServerCommand("mp_restartgame 1"); for (int client = 1; client <= MaxClients; client++) { if (g_hAutoFreezeTimers[client] != INVALID_HANDLE) { KillTimer(g_hAutoFreezeTimers[client]); g_hAutoFreezeTimers[client] = INVALID_HANDLE; } } } public void OnConfigsExecuted() { // set bad server cvars for (int i = 0; i < sizeof(protected_cvars); i++) { g_hProtectedConvar[i] = FindConVar(protected_cvars[i]); if (g_hProtectedConvar[i] == INVALID_HANDLE) continue; previous_values[i] = GetConVarInt(g_hProtectedConvar[i]); SetConVarInt(g_hProtectedConvar[i], forced_values[i], true); HookConVarChange(g_hProtectedConvar[i], OnCvarChange); } } // teach the players the /whistle and /tp commands public Action SpamCommands(Handle timer, int data) { if (GetConVarBool(cvar_Whistle) && data == 1) PrintToChatAll("%s%t", PREFIX, "T type /whistle"); else if (!GetConVarBool(cvar_Whistle) || data == 0) { for (int i = 1; i <= MaxClients; i++) if (IsClientInGame(i) && GetClientTeam(i) == CS_TEAM_T) PrintToChat(i, "%s%t", PREFIX, "T type /tp"); } CreateTimer(120.0, SpamCommands, (data == 0 ? 1 : 0)); return Plugin_Continue; } // prevent changes to protected cvars public void OnCvarChange(Handle convar, const char[] oldValue, const char[] newValue) { char cvarName[50]; GetConVarName(convar, cvarName, sizeof(cvarName)); for (int i = 0; i < sizeof(protected_cvars); i++) { if (StrEqual(protected_cvars[i], cvarName) && StringToInt(newValue) != forced_values[i]) { SetConVarInt(convar, forced_values[i]); PrintToServer("Hide and Seek: %T", "protected cvar", LANG_SERVER); break; } } } // prevent changes to hider speed public void OnChangeHiderSpeed(Handle convar, const char[] oldValue, const char[] newValue) { for (int i = 1; i <= MaxClients; i++) { if (IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == CS_TEAM_T) SetEntDataFloat(i, g_flLaggedMovementValue, GetConVarFloat(cvar_HiderSpeed), true); } } static void CreateConVars() { cvar_FreezeCTs = CreateConVar("ph_freezects", "1", "Should CTs get freezed and blinded on spawn?", FCVAR_PLUGIN, true, 0.0, true, 1.0); cvar_FreezeTime = CreateConVar("ph_freezetime", "45.0", "How long should the CTs be freezed after spawn?", FCVAR_PLUGIN, true, 1.00, true, 120.00); cvar_ChangeLimit = CreateConVar("ph_changelimit", "2", "How often a T is allowed to choose his model ingame? 0 = unlimited", FCVAR_PLUGIN, true, 0.00); cvar_ChangeLimittime = CreateConVar("ph_changelimittime", "30.0", "How long should a T be allowed to change his model again after spawn?", FCVAR_PLUGIN, true, 0.00); cvar_AutoChoose = CreateConVar("ph_autochoose", "0", "Should the plugin choose models for the hiders automatically?", FCVAR_PLUGIN, true, 0.0, true, 1.0); cvar_Whistle = CreateConVar("ph_whistle", "1", "Are terrorists allowed to whistle?", FCVAR_PLUGIN); cvar_WhistleTimes = CreateConVar("ph_whistle_times", "5", "How many times a hider is allowed to whistle per round?", FCVAR_PLUGIN); cvar_WhistleSeeker = CreateConVar("ph_whistle_seeker", "0", "Allow CTs to enforce T whistle?", FCVAR_PLUGIN); cvar_HiderWinFrags = CreateConVar("ph_hider_win_frags", "5", "How many frags should surviving terrorists gain?", FCVAR_PLUGIN, true, 0.00, true, 10.00); cvar_SlaySeekers = CreateConVar("ph_slay_seekers", "0", "Should we slay all seekers on round end and there are still some hiders alive? (Default: 0)", FCVAR_PLUGIN, true, 0.0, true, 1.0); cvar_HPSeekerEnable = CreateConVar("ph_hp_seeker_enable", "1", "Should CT lose HP when shooting, 0 = off/1 = on.", FCVAR_PLUGIN, true, 0.0, true, 1.0); cvar_HPSeekerDec = CreateConVar("ph_hp_seeker_dec", "5", "How many hp should a CT lose on shooting?", FCVAR_PLUGIN, true, 0.00); cvar_HPSeekerInc = CreateConVar("ph_hp_seeker_inc", "15", "How many hp should a CT gain when hitting a hider?", FCVAR_PLUGIN, true, 0.00); cvar_HPSeekerIncShotgun = CreateConVar("ph_hp_seeker_inc_shotgun", "5", "How many hp should a CT gain when hitting a hider with shotgun? (CS:GO only)", FCVAR_PLUGIN, true, 0.00); cvar_HPSeekerBonus = CreateConVar("ph_hp_seeker_bonus", "50", "How many hp should a CT gain when killing a hider?", FCVAR_PLUGIN, true, 0.00); cvar_HiderSpeed = CreateConVar("ph_hidersspeed", "1.00", "Hiders speed (Default: 1.00).", FCVAR_PLUGIN, true, 1.00, true, 3.00); cvar_DisableDucking = CreateConVar("ph_disable_ducking", "1", "Disable ducking. (Default: 1).", FCVAR_PLUGIN, true, 0.00, true, 1.00); cvar_AutoThirdPerson = CreateConVar("ph_auto_thirdperson", "1", "Enable thirdperson view for hiders automatically. (Default: 1)", FCVAR_PLUGIN, true, 0.00, true, 1.00); cvar_HiderFreezeMode = CreateConVar("ph_hider_freeze_mode", "1", "0: Disables /freeze command for hiders, 1: Only freeze on position, be able to move camera, 2: Freeze completely (no cameramovements) (Default: 2)", FCVAR_PLUGIN, true, 0.00, true, 2.00); cvar_HideBlood = CreateConVar("ph_hide_blood", "1", "Hide blood on hider damage. (Default: 1)", FCVAR_PLUGIN, true, 0.00, true, 1.00); cvar_ShowHelp = CreateConVar("ph_show_help", "0", "Show help explaining the game on first player spawn. (Default: 0)", FCVAR_PLUGIN, true, 0.00, true, 1.00); cvar_CTRatio = CreateConVar("ph_ct_ratio", "3", "The ratio of hiders to 1 seeker. 0 to disables teambalance. (Default: 3)", FCVAR_PLUGIN, true, 0.00, true, 64.00); cvar_DisableUse = CreateConVar("ph_disable_use", "1", "Disable CTs pushing things. (Default: 1)", FCVAR_PLUGIN, true, 0.00, true, 1.00); cvar_HiderFreezeInAir = CreateConVar("ph_hider_freeze_inair", "0", "Are hiders allowed to freeze in the air? (Default: 0)", FCVAR_PLUGIN, true, 0.00, true, 1.00); cvar_HidePlayerLocation = CreateConVar("ph_hide_player_locations", "1", "Hide the location info shown next to players name on voice chat and teamsay? (Default: 1)", FCVAR_PLUGIN, true, 0.00, true, 1.00); cvar_AutoFreezeTime = CreateConVar("ph_auto_freeze_time", "5", "Time after which stationary players should freeze automatically (Default: 5) - 0 to disable", FCVAR_PLUGIN, true, 0.00); cvar_GuaranteedCTTurns = CreateConVar("ph_guaranteed_ct_turns", "3", "Turns after which CTs might be switched to the T side (Default: 3) - 0 to never switch", FCVAR_PLUGIN, true, 0.00); cvar_KnifeSpeed = CreateConVar("ph_knifespeed", "1.40", "Running speed when holding a knife (multiplier)", FCVAR_PLUGIN, true, 0.00); cvar_LimitSpec = CreateConVar("ph_limitspec", "2", "0: Do not limit spectating, 1: Limit spectating to own team, 2: Limit spectating to CT. (Default: 2)", FCVAR_PLUGIN, true, 0.00, true, 2.00); cvar_IncludeDefaultModels = CreateConVar("ph_include_default_models", "1", "0: Include default model list only when there isn't one for the current map, 1: Always include default model list. (Default: 1)", FCVAR_PLUGIN, true, 0.00, true, 1.00); cvar_ForcePeriodicWhistle = CreateConVar("ph_force_periodic_whistle", "0", "Periodically, every x seconds, force a random hider to whistle. 0 to disable. (Default: 0)", FCVAR_PLUGIN, true, 0.00); cvar_PeriodicWhistleDelay = CreateConVar("ph_periodic_whistle_delay", "60", "Number of seconds for the first periodic whistle, if they are enabled. (Default: 60)", FCVAR_PLUGIN, true, 0.00); cvar_TurnsToScramble = CreateConVar("ph_turns_to_scramble", "0", "Scramble teams every x turns. 0 to disable scrambling. Disables the /ct command if enabled. (Default: 0)", FCVAR_PLUGIN, true, 0.00); } static void RegisterCommands() { RegConsoleCmd("rules", Cmd_DisplayHelp, "Displays a panel with information on how to play."); RegConsoleCmd("hide", Cmd_SelectModelMenu, "Opens a menu with different models to choose as hider."); RegConsoleCmd("prop", Cmd_SelectModelMenu, "Opens a menu with different models to choose as hider."); RegConsoleCmd("model", Cmd_SelectModelMenu, "Opens a menu with different models to choose as hider."); RegConsoleCmd("tp", Cmd_ToggleThirdPerson, "Toggles the view to thirdperson for hiders."); RegConsoleCmd("thirdperson", Cmd_ToggleThirdPerson, "Toggles the view to thirdperson for hiders."); RegConsoleCmd("third", Cmd_ToggleThirdPerson, "Toggles the view to thirdperson for hiders."); RegConsoleCmd("jointeam", Cmd_JoinTeam); RegConsoleCmd("whistle", Cmd_PlayWhistle, "Plays a random sound from the hiders position to give the seekers a hint."); RegConsoleCmd("whoami", Cmd_DisplayModelName, "Displays the current models description in chat."); RegConsoleCmd("freeze", Cmd_Freeze, "Toggles freezing for hiders."); RegConsoleCmd("ct", Cmd_RequestCT, "Requests a switch to the seeking side."); RegAdminCmd("ph_force_whistle", ForceWhistle, ADMFLAG_CHAT, "Force a player to whistle"); RegAdminCmd("ph_reload_models", ReloadModels, ADMFLAG_RCON, "Reload the modellist from the map config file."); } static void AddListeners() { HookConVarChange(cvar_HiderSpeed, OnChangeHiderSpeed); HookEvent("player_spawn", Event_OnPlayerSpawn); HookEvent("weapon_fire", Event_OnWeaponFire); HookEvent("player_death", Event_OnPlayerDeath); //HookEvent("player_death", Event_OnPlayerDeath_Pre, EventHookMode_Pre); HookEvent("round_start", Event_OnRoundStart); HookEvent("round_end", Event_OnRoundEnd); HookEvent("round_end", Event_OnRoundEnd_Pre, EventHookMode_Pre); HookEvent("player_team", Event_OnPlayerTeam); //HookEvent("teamchange_pending", Event_OnTeamChange); HookEvent("item_equip", Event_ItemEquip); AddCommandListener(Cmd_spec_next, "spec_next"); AddCommandListener(Cmd_spec_prev, "spec_prev"); AddCommandListener(Cmd_spec_player, "spec_player"); AddCommandListener(Cmd_spec_mode, "spec_mode"); } static void SetOffsets() { g_Freeze = FindSendPropOffs("CBasePlayer", "m_fFlags"); g_flLaggedMovementValue = FindSendPropOffs("CCSPlayer", "m_flLaggedMovementValue"); } static void LoadLang() { LoadTranslations("plugin.prophunt"); LoadTranslations("common.phrases"); } #include "prophunt/roundevents.sp" #include "prophunt/mapevents.sp" #include "prophunt/clientevents.sp" #include "prophunt/commands.sp" #include "prophunt/menus.sp" #include "prophunt/models.sp" #include "prophunt/spectate.sp" #include "prophunt/teamevents.sp"
Pierwsze to commands.sp
drugie to prophunt.sp
Chciałbym, żeby komenda !whistle miała cooldown, załóżmy 5 sekund.
Próbowałem to zrobić za pomocą tego - https://forums.alliedmods.net/showthread.php?t=182989?t=182989
Jednak mimo prostoty pluginu, nie byłem w stanie ograniczyć użycia tej komendy.
Jakieś porady z waszej strony? Pozdrawiam ciepło i dziękuję z góry.
ps. był już identyczny temat -
kolega znalazł rozwiązanie, ale się nie podzielił! haha
Pozdrawiam :)
-
Nie, raczej o to że ta klasa wyżej jest na otwartych przestrzeniach surfa troche zbyt OP, wiec pomyślałem żeby przy używaniu niewidzialnosci ograniczyć jej widoczność. Spróbuje dzisiaj wykorzystać kod z jednego perku, tj. Zaćmienie księżyca. Dam znać czy sie udało :)
-
Odswiezam temat, bo mam pytanie..
Czy wg was istnieje możliwość przyciemnienia ekranu graczowi podczas wlasnie uzywania niewidzialnosci? Efekt takiej mgły, o to mi chodzi
-
Świetny projekt, mogę szczerze polecić WSZYSTKO, co od tego gościa wychodzi.
Zawsze 100% od siebie, i nawet jeśli nie jest to idealne wystarczy krótka informacja i PYK, zrobione.
Szczerze, polecam.
- 1
-
Nie nie nie, już jest ok - pomoc udzielona, dzięki Ci bardzo :)
-
Suuuper, jest PRAWIE ok!
Teraz gdy plugin jest wgrany, gracz otrzymuje obrażenia przy strzale w kogoś, nie wiem od czego jest to zależne, w kodzie nic sensownego ku temu nie mogę znaleźć.
Czasami jak plugin był w wersji beta jakiś tam, załóżmy klasa czy inny item, to też się tak zdarzało i po ukończeniu problem znikał.
Może to mieć jakiś związek z zamknięciem pluginu, nie wiem, nie mam pojęcia. Jakieś pomysły?
// teraz o dziwo jest ok... potestuję jeszcze trochę i dam znać :) super chłopaki, dzięki za pomoc póki co =)
-
Osoba zostaje zamrożona, i tak jak wczesniej - musi podskoczyc/kucnac zeby sie ruszyc i to po kilku dobrych sekundach dopiero. Inaczej nie ma opcji. Nagrania :
Kolor nadal bordowy nie wiem czemu w sumie, ale ciul z tym kolorem już.
Może z tą kondycją to nie jest najlepszy pomysł?
Użyłem pluginu wyżej.
-
Przecież wstawiłem ostatnią "wersję" pluginu, którą testowałem, tak handle jest, tu :
new bool:ma_item[65],
wartosc_itemu[65];
new Handle:mrozenie_task[65]; -
Rzeczywiście, działa to lepiej niż wcześniejsza wersja, jednakże gracz zostaje w ułamku sekundy po strzale cofnięty kawałek w tył (jak w skoku to rzuca go maksymalnie na dół), po czym mijają 3 sekundy - kolor wraca do normy, ale ruszać się jeszcze nie może i analogowo wraca mu prędkość po ok 5sec.
użyty kod : (może coś źle wstawiłem po prostu, jestem lebiegą jeśli chodzi o te sprawy)
Spoiler#include <sourcemod>
#include <sdkhooks>
#include <sdktools>
#include <codmod>new const String:nazwa[] = "Miotacz lodu";
new const String:opis[] = "Posiadasz 1/LW szans na zamrożenie przeciwnika";new bool:ma_item[65],
wartosc_itemu[65];
new Handle:mrozenie_task[65];public Plugin:myinfo =
{
name = nazwa,
author = "Linux`",
description = "Cod Item",
version = "1.0",
url = "http://steamcommunity.com/id/linux2006"
};
public OnPluginStart()
{
cod_register_item(nazwa, opis, 1, 1);
}
public OnClientPutInServer(client)
{
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
{
if(mrozenie_task[client] != INVALID_HANDLE)
{
KillTimer(mrozenie_task[client]);
mrozenie_task[client] = INVALID_HANDLE;
}
}
}
public OnClientDisconnect(client)
{
SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}
public cod_item_enabled(client, wartosc)
{
ma_item[client] = true;
wartosc_itemu[client] = wartosc;
}
public cod_item_disabled(client)
{
ma_item[client] = false;
}
public Action:OnTakeDamage(client, &attacker, &inflictor, &Float:damage, &damagetype)
{
if(!IsValidClient(attacker) || !ma_item[attacker])
return Plugin_Continue;if(!IsValidClient(client) || !IsPlayerAlive(client))
return Plugin_Continue;if(GetClientTeam(client) == GetClientTeam(attacker))
return Plugin_Continue;if(GetRandomInt(1, wartosc_itemu[attacker]) == 1)
FreezePlayer(client)
return Plugin_Continue;
}
public Action:FreezePlayer(client)
{
if(mrozenie_task[client] != INVALID_HANDLE)
return Plugin_Continue;cod_set_user_bonus_trim(client, cod_get_user_trim(client, 0, 1, 0)-10000);
mrozenie_task[client] = CreateTimer(3.0, UnFreezePlayer, client, TIMER_FLAG_NO_MAPCHANGE);
PrintToChat(client, "[COD:MW] Zostaniesz odmrozony za 3 sekundy.");SetEntityRenderColor(client, 255, 0, 0, 174);
return Plugin_Continue;
}
public Action:UnFreezePlayer(Handle:timer, any:client)
{
if(!IsValidClient(client))
return Plugin_Continue;cod_set_user_bonus_trim(client, cod_get_user_trim(client, 0, 1, 0)+10000);
mrozenie_task[client] = INVALID_HANDLE;SetEntityRenderColor(client, 255, 255, 255, 255);
return Plugin_Continue;
}no pewnie, że źle wstawiłem - teraz sam już zauważyłem, poprawię i dam znać czy jest różnica.
kuuurczaki, próbując wstawić linijkę z
if(mrozenie_task[client] != INVALID_HANDLE) { KillTimer(mrozenie_task[client]); mrozenie_task[client] = INVALID_HANDLE;
w public OnClientDisconnect(client), program nie chce się skompilować - wyskakują błędy.
Chce Ci się, @Linux` poprawić kod wyżej, żeby działał? Ty tam widzisz sens, ja jeszcze zbiór literek, które ten sens mają, ale ukryty. :P
W ten sposób się uczę, na podstawie własnych błędów :P
Analogia, te sprawy.
-
Cześć!
Udało mi się spowodować, że po strzale osoba zostaje zamrożona. Jednak nie odmraża jej.
Mógłby ktoś to edytować i ustawić np 3 sekundy zamrożenia? I najlepiej komunikat dla osoby na @@@ (hint) Zostaniesz odmrożony za 3 sekundy. Dzięki i pozdrawiam! Na dole to, co udało mi się wypocić.
Cytat#include <sourcemod>
#include <sdkhooks>
#include <sdktools>
#include <codmod>new const String:nazwa[] = "Miotacz lodu";
new const String:opis[] = "Posiadasz 1/LW szans na zamrożenie przeciwnika";new bool:ma_item[65],
wartosc_itemu[65];public Plugin:myinfo =
{
name = nazwa,
author = "Linux`",
description = "Cod Item",
version = "1.0",
url = "http://steamcommunity.com/id/linux2006"
};
public OnPluginStart()
{
cod_register_item(nazwa, opis, 1, 1);
}
public OnClientPutInServer(client)
{
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}
public OnClientDisconnect(client)
{
SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}
public cod_item_enabled(client, wartosc)
{
ma_item[client] = true;
wartosc_itemu[client] = wartosc;
}
public cod_item_disabled(client)
{
ma_item[client] = false;
}
public Action:OnTakeDamage(client, &attacker, &inflictor, &Float:damage, &damagetype)
{
if(!IsValidClient(attacker) || !ma_item[attacker])
return Plugin_Continue;if(!IsValidClient(client) || !IsPlayerAlive(client))
return Plugin_Continue;if(GetClientTeam(client) == GetClientTeam(attacker))
return Plugin_Continue;if(GetRandomInt(1, wartosc_itemu[attacker]) == 1)
FreezePlayer(client)
return Plugin_Continue;
}
public FreezePlayer(client)
{
SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 0.0);
SetEntityRenderColor(client, 255, 0, 170, 174);
}public UnFreezePlayer(client)
{
SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.0);
SetEntityRenderColor(client, 255, 255, 255, 255);
return Plugin_Continue;
} -
Dobra, a jak zamrozić kogoś? Da się w ogóle? W api nie ma nic na ten temat, może znacie jakiś sposób?
// spróbuję jeszcze sam jednak, chyba #include funcommands
i dołączamy kod z ice.sp hm?
plugin.sp(5) : fatal error 183: cannot read from file: "funcommands/ice.sp"
dobra, jakieś porady proszę :P
-
Dobra to głupie, wystarczyło edytować drugą wartość XD
dzięki!
-
Siemka! Edytowałem perki na klasę - wszystko jest git. Proszę tylko o dodanie czasu podpalenia na końcu kodu bo nie za bardzo wiem jak się za to chwycić.
Załóżmy, że chciałbym aby takie podpalenie trwało ~5sec i podczas podpalenia nie było opcji podpalenia ponownie.
Taka pomoc okazuje się nie tylko przydatna ze względu na "gotowiec", ale też zaczynam to wszystko powoli rozumieć i łapać. Z góry bardzo dziękuję :)
Pozdrawiam!
Spoiler#include <sourcemod>
#include <sdkhooks>
#include <sdktools>
#include <codmod>new const String:nazwa[] = "Bomberman";
new const String:opis[] = "Wybucha po śmierci, zabijając wszystkich wokół. Ma szansę na podpalenie gracza +int";
new const String:bronie[] = "#weapon_mp7#weapon_glock";
new const inteligencja = 5;
new const zdrowie = 10;
new const obrazenia = 10;
new const wytrzymalosc = 10;
new const kondycja = 0;new sprite_explosion;
new bool:ma_klase[65];public Plugin:myinfo =
{
name = nazwa,
author = "Linux`",
description = "Cod Item",
version = "1.0",
url = "http://steamcommunity.com/id/linux2006"
};
public OnPluginStart()
{
cod_register_class(nazwa, opis, bronie, inteligencja, zdrowie, obrazenia, wytrzymalosc, kondycja);
HookEvent("player_death", SmiercGracza);
}
public OnMapStart()
{
sprite_explosion = PrecacheModel("materials/sprites/blueflare1.vmt");
PrecacheSound("weapons/hegrenade/explode5.wav");
}
public cod_class_enabled(client)
{
ma_klase[client] = true;
}
public cod_class_disabled(client)
{
ma_klase[client] = false;
}
public Action:SmiercGracza(Handle:event, String:name[], bool:dontbroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
new killer = GetClientOfUserId(GetEventInt(event, "attacker"));
if(!IsValidClient(client) || !ma_klase[client])
return Plugin_Continue;if(!IsValidClient(killer) || GetClientTeam(client) == GetClientTeam(killer))
return Plugin_Continue;new Float:forigin[3], Float:iorigin[3];
GetClientEyePosition(client, forigin);for(new i = 1; i <= MaxClients; i++)
{
if(!IsClientInGame(i) || !IsPlayerAlive(i))
continue;if(GetClientTeam(client) == GetClientTeam(i))
continue;GetClientEyePosition(i, iorigin);
if(GetVectorDistance(forigin, iorigin) <= 100.0)
cod_inflict_damage(i, client, GetClientHealth(i)+1);
}EmitSoundToAll("weapons/hegrenade/explode5.wav", client, SNDCHAN_AUTO, SNDLEVEL_GUNFIRE);
TE_SetupExplosion(forigin, sprite_explosion, 10.0, 1, 0, 100, 100);
TE_SendToAll();return Plugin_Continue;
}
public OnClientPutInServer(client)
{
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}
public OnClientDisconnect(client)
{
SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}
public Action:OnTakeDamage(client, &attacker, &inflictor, &Float:damage, &damagetype)
{
if(!IsValidClient(attacker) || !ma_klase[attacker])
return Plugin_Continue;if(!IsValidClient(client) || !IsPlayerAlive(client))
return Plugin_Continue;if(GetClientTeam(client) == GetClientTeam(attacker))
return Plugin_Continue;int random = GetRandomInt(0, 1000);
int prog = 50 + RoundFloat(cod_get_user_maks_intelligence(attacker)*1);
if (random <= prog) IgniteEntity(client, 2.0);
return Plugin_Continue;
} -
Nam pomogło usunięcie perku buty szturmowego i tyle, także rzeczywiście w tym leży problem.
-
Już mi się to podoba, łap plusa!
Dzięki Linuks :)
-
Warto było inwestować pieniądz w linuksa.
Dzięki wam chłopaki, zaraz lecę to testować.
Fachowa pomoc i obsługa widzę nawet nocą w niedzielę :D
@edit
A mam jeszcze takie pytanie..
Bo ogólnie to jestem mega zielony i dopiero wprowadzam się jakby w programowanie ale tylko w zakresie, w którym potrzebuję w sumie bo na codzień to jestem zupełnie kim innym :P wiadomo, lepiej wiedzieć więcej..
A teraz do rzeczy - ta niewidzialność ale na +int, że zaczynamy od 255 i stopniowo, żeby na max int dojść do samego 0?
Nie pamiętam ile było max int, chyba 30
-
Siemka,
Przerabiałem klasę COD od Linuxa i chciałem, żeby przy kucnięciu z nożem klasa ta miała niewidzialność na 50.
Oto kod :
#include <sourcemod>
#include <codmod>new const String:nazwa[] = "Kameleon";
new const String:opis[] = "Jest mniej widoczny na nożu na kucaka";
new const String:bronie[] = "#weapon_mp7#weapon_glock";
new const inteligencja = 0;
new const zdrowie = 0;
new const obrazenia = 0;
new const wytrzymalosc = 10;
new const kondycja = 0;new bool:ma_klase[65],
identifier
public Plugin:myinfo =
{
name = nazwa,
author = "Linux`",
description = "Cod Item",
version = "1.0",
url = "http://steamcommunity.com/id/linux2006"
};
public OnPluginStart()
{
cod_register_class(nazwa, opis, bronie, inteligencja, zdrowie, obrazenia, wytrzymalosc, kondycja);
ServerCommand("sv_disable_immunity_alpha 1");
HookEvent("player_spawn", OdrodzenieGracza);
}
public cod_class_enabled(client)
{
ma_klase[client] = true;SetEntityRenderMode(client, RENDER_TRANSCOLOR);
SetEntityRenderColor(client, 50, 50, 50, 50);
}
public cod_class_disabled(client)
{
ma_klase[client] = false;
SetEntityRenderMode(client, RENDER_TRANSCOLOR);
SetEntityRenderColor(client, 50, 50, 50, 50);
}
public client_PreThink(client)
{
if(!ma_klase[client])
return;
new String:weapon[32];
GetClientWeapon(weapon);
if(StrEqual (weapon, "weapon_knife") && IN_DUCK));
SetEntityRenderMode(client, RENDER_TRANSCOLOR);
SetEntityRenderColor(client, 50, 50, 50, 50);
}
public Action:OdrodzenieGracza(Handle:event, String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(!IsValidClient(client) || !ma_klase[client])
return Plugin_Continue;SetEntityRenderMode(client, RENDER_TRANSCOLOR);
SetEntityRenderColor(client, 50, 50, 50, 50);return Plugin_Continue;
}------------
Błędy :
SourcePawn Compiler 1.9.0.5921 Copyright (c) 1997-2006 ITB CompuPhase Copyright (c) 2004-2015 AlliedModders LLC
plugin.sp(46) : warning 217: loose indentation
plugin.sp(47) : warning 217: loose indentation
plugin.sp(47) : error 035: argument type mismatch (argument 1)
plugin.sp(48) : warning 217: loose indentation
plugin.sp(48) : error 029: invalid expression, assumed zero
plugin.sp(48) : warning 215: expression has no effect
plugin.sp(15) : warning 203: symbol is never used: "identifier"
2 Errors.
Jakieś solucje ? :(
Cooldown na komendę
w Problemy
Opublikowano
Spróbuję, dam CI znać jak mi poszło - jeszcze boczkiem - zrozumiałeś w końcu, o co mi chodziło?