camerdisco
Użytkownik-
Postów
219 -
Dołączył
-
Ostatnia wizyta
-
Wygrane w rankingu
13
Treść opublikowana przez camerdisco
-
Najpewniej tak, https://sm.alliedmods.net/new-api/convars/SendConVarValue
-
ROZWIĄZANE Ustawienie reset score dla VIPa
camerdisco odpowiedział(a) na Młody Stark temat w Pytania ogólne
Tak w ogóle to najwygodniejsze tutaj będzie zastosowanie overidsów, a nie zmian w kodzie. https://wiki.alliedmods.net/Overriding_Command_Access_(Sourcemod)- 6 odpowiedzi
-
- 1
-
- ustawienie
- Ustawienie
-
(i 2 więcej)
Oznaczone tagami:
-
@Linux` jak to jest z licencją twojego codmoda? Według mnie takie "odsprzedawanie" czegoś czego się nie zrobiło jest krótko mówiąc nie na miejscu.
-
A cóż tu trzeba Cię kierować jak wszystko dalej tworzysz analogicznie, nawet nie trzeba rozumieć tego kodu w tym przypadku chyba, ale z nudów przepisałem to: #include <sourcemod> #include <sdktools> #pragma newdecls required public void OnPluginStart() { RegConsoleCmd("sm_menus", Menu_Test1_display); } public Action Menu_Test1_display(int client, int args) { Menu Menu_Test1 = CreateMenu(RGMenu_Test1); Menu_Test1.SetTitle("Title!"); Menu_Test1.AddItem("rgi", "adsa"); Menu_Test1.ExitButton = true; Menu_Test1.Display(client, 45); return Plugin_Handled; } public int RGMenu_Test1(Menu Menu_Test1, MenuAction action, int param1, int param2) { switch(action) { case MenuAction_Select: { char info[32]; GetMenuItem(Menu_Test1, param2, info, sizeof(info)); if(StrEqual(info, "rgi")) { SubMenu_Test2_display(param1); } } case MenuAction_End: { delete Menu_Test1; } } } public void SubMenu_Test2_display(int client) { Menu SubMenu_Test2 = CreateMenu(RG_SubMenu_Test2); SubMenu_Test2.SetTitle("Title2!"); SubMenu_Test2.AddItem("a", "a"); SubMenu_Test2.AddItem("b", "b"); SubMenu_Test2.AddItem("c", "c"); SubMenu_Test2.AddItem("d", "d"); SubMenu_Test2.AddItem("e", "e"); SubMenu_Test2.AddItem("f", "f"); SubMenu_Test2.ExitButton = true; SubMenu_Test2.Display(client, 45); } public int RG_SubMenu_Test2(Menu SubMenu_Test2, MenuAction action, int param1, int param2) { switch(action) { case MenuAction_Select: { char info[32]; GetMenuItem(SubMenu_Test2, param2, info, sizeof(info)); if(StrEqual(info, "a")) { SubMenu3(param1); } } case MenuAction_End: { delete SubMenu_Test2; } } } public void SubMenu3(int client) { Menu Menu3 = CreateMenu(Menu3Callback); Menu3.SetTitle("Title!"); Menu3.AddItem("costam", "costam"); Menu3.AddItem("costam", "costam"); Menu3.AddItem("costam", "costam"); Menu3.ExitButton = true; Menu3.Display(client, 45); } public int Menu3Callback(Menu SubMenu, MenuAction action, int param1, int param2) { switch(action) { case MenuAction_Select: { char info[32]; GetMenuItem(SubMenu, param2, info, sizeof(info)); } case MenuAction_End: { delete SubMenu; } } }
-
Ehh.. Czemu ludzie nigdy nie starają się do czegoś dojść samemu mając już praktycznie gotowe rozwiązania. #include <sourcemod> #include <sdktools> #include <cstrike> #include <sdkhooks> #include <multi1v1> public Plugin myinfo = { name = "VIP Generator", author = "Adi - live4net", description = "Automatycznie wygenerowany VIP na stronie sklepcs.pl", version = "1.02", url = "http://sklepcs.pl" } int offsetHe, offsetSmoke, offsetFlash, offsetDecoy, offsetHealth, offsetInc, offsetMol, offsetTa; public void OnMapStart() { int entindex = CreateEntityByName("weapon_hegrenade"); DispatchSpawn(entindex); offsetHe = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType"); AcceptEntityInput(entindex, "Kill"); entindex = CreateEntityByName("weapon_smokegrenade"); DispatchSpawn(entindex); offsetSmoke = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType"); AcceptEntityInput(entindex, "Kill"); entindex = CreateEntityByName("weapon_flashbang"); DispatchSpawn(entindex); offsetFlash = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType"); AcceptEntityInput(entindex, "Kill"); entindex = CreateEntityByName("weapon_decoy"); DispatchSpawn(entindex); offsetDecoy = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType"); AcceptEntityInput(entindex, "Kill"); entindex = CreateEntityByName("weapon_healthshot"); DispatchSpawn(entindex); offsetHealth = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType"); AcceptEntityInput(entindex, "Kill"); entindex = CreateEntityByName("weapon_incgrenade"); DispatchSpawn(entindex); offsetInc = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType"); AcceptEntityInput(entindex, "Kill"); entindex = CreateEntityByName("weapon_molotov"); DispatchSpawn(entindex); offsetMol = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType"); AcceptEntityInput(entindex, "Kill"); entindex = CreateEntityByName("weapon_tagrenade"); DispatchSpawn(entindex); offsetTa = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType"); AcceptEntityInput(entindex, "Kill"); } public void Multi1v1_AfterPlayerSetup(int client) { if (IsValidPlayer(client) && IsPlayerVip(client)) { if ((GetTeamScore(CS_TEAM_T) + GetTeamScore(CS_TEAM_CT)) > 0) SetEntProp(client ,Prop_Send,"m_ArmorValue",100,1); if ((GetTeamScore(CS_TEAM_T) + GetTeamScore(CS_TEAM_CT)) > 0) SetEntProp(client , Prop_Send, "m_bHasHelmet", 1); if (PlayerGrenade(client, 3) < 1) GivePlayerItem(client, "weapon_flashbang"); if (PlayerGrenade(client, 7) < 1) GivePlayerItem(client, "weapon_tagrenade"); } } stock bool IsValidPlayer(int client) { if(client >= 1 && client <= MaxClients && IsClientConnected(client) && !IsFakeClient(client) && IsClientInGame(client) ) return true; return false; } stock int PlayerGrenade(int client, int granat) { if (granat == 1) return GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetHe); else if (granat == 2) return GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetSmoke); else if (granat == 3) return GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetFlash); else if (granat == 4) return GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetDecoy); else if (granat == 5) return GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetHealth); else if (granat == 6) { if (GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetInc) > GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetMol)) return GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetInc); else return GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetMol); } else if (granat == 7) return GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetTa); return 0; }stock bool IsPlayerVip(int client) { if (CheckCommandAccess(client, "check_vip", ADMFLAG_CUSTOM1, false)) return true; return false; }
-
To jest kluczem forward void Multi1v1_AfterPlayerSetup(int client);
-
Tak, cały kod w moim poście jest w pełni w nowym syntaxie.
-
Nie trzeba ingerować w kod źródłowy multi1v1, wystarczy użyć forwardu udostępnionego przez autora zamiast nadawania broni przy Spawnie gracza.
-
Wprowadzenie pobierania userid zamiast numeru klienta służy do lepszej walidacji klienta, w takim przypadku nie jest to konieczne, jednak przy jakichś powtarzających się timerach warto tego używać. btw. Mieszasz stary syntax z nowym
-
#include <sourcemod> #include <cstrike> public void OnPluginStart() { HookEvent("player_spawn", Spawn); } public Action Spawn(Event event, const char[] name, bool dontBroadcast) { int client = GetClientOfUserId(event.GetInt("userid")); CreateTimer(0.5, TimerCallBack, GetClientUserId(client)); } public Action TimerCallBack(Handle timer, any userid) { int client = GetClientOfUserId(userid); char tag[64]; CS_GetClientClanTag(client, tag, sizeof(tag)); if(StrEqual(tag, "[Plac Zabaw]")) { SetEntityHealth(client, 160); SetEntProp(client, Prop_Send, "m_ArmorValue", 99, 1); } else { SetEntityHealth(client, 145); SetEntProp(client, Prop_Send, "m_ArmorValue", 99, 1); } }
-
cmd > ping twojastrona O ile rzecz jasna mysql stoi na tym serwerze co apache/nginx.
- 12 odpowiedzi
-
- SourceBans
- buguje
-
(i 1 więcej)
Oznaczone tagami:
-
W takim przypadku łapiesz wszystkich graczy przy pomocy pętli. W twojej sytuacji zrobiłbym po prostu timer na powiedzmy 0.5, który wtedy nadawałby owe bonusy.
-
Brakuje biblioteki cstrike.
-
To co wysłałem to jest właśnie odwołanie do komendy. Wykonanie komendy to ServerCommand.
-
#include <sourcemod> public void OnPluginStart() { RegConsoleCmd("mp_pause_match", Komenda, "Pauza"); } public Action Komenda(int client, int args) { }
-
BaseBuilder info o usunieciu bloku
camerdisco odpowiedział(a) na sdasdas temat w Pytania na temat kodowania
Powyżej mały błąd się wkradł, powinno być: Admin %N usunal klocek gracza %N- 5 odpowiedzi
-
- BaseBuilder
- usunieciu
-
(i 1 więcej)
Oznaczone tagami:
-
Pobieranie clantagu po dołączeniu gracza do serwera
camerdisco odpowiedział(a) na z0y temat w Problem z kodem
Spróbuj czegoś takiego: #pragma semicolon 1 #include <sourcemod> #include <cstrike> #pragma newdecls required bool bClan[MAXPLAYERS + 1]; public void OnPluginStart() { HookEvent("player_spawn", Spawn); } public Action Spawn(Event event, const char[] name, bool dontBroadcast) { int client = GetClientOfUserId(event.GetInt("userid")); if(IsValidClient(client) && !bClan[client]) { CreateTimer(0.5, Pobierz, GetClientUserId(client)); } } public Action Pobierz(Handle timer, any userid) { int client = GetClientOfUserId(userid); bClan[client] = true; char clan[64]; CS_GetClientClanTag(client, clan, sizeof(clan)); PrintToServer("Player %N Clan Tag: %s", client, clan); } public void OnClientPostAdminCheck(int client) { bClan[client] = false; } stock bool IsValidClient(int client) { if(client >= 1 && client <= MaxClients && IsClientInGame(client) && IsPlayerAlive(client)) return true; return false; }- 9 odpowiedzi
-
- clantagu
- Pobieranie
-
(i 3 więcej)
Oznaczone tagami:
-
Nie za bardzo rozumiem twojego problemu.
-
Pobieranie clantagu po dołączeniu gracza do serwera
camerdisco odpowiedział(a) na z0y temat w Problem z kodem
Skopiowałeś nie to co trzeba lub coś nie tak wgrałeś.- 9 odpowiedzi
-
- clantagu
- Pobieranie
-
(i 3 więcej)
Oznaczone tagami:
-
Pobieranie clantagu po dołączeniu gracza do serwera
camerdisco odpowiedział(a) na z0y temat w Problem z kodem
Nie wiem w zasadzie w którym momencie pojawia się clantag, więc w takim razie spróbuj czegoś takiego: #pragma semicolon 1 #include <sourcemod> #include <cstrike> #pragma newdecls required bool bClan[MAXPLAYERS + 1]; public void OnPluginStart() { HookEvent("player_spawn", Spawn); } public Action Spawn(Event event, const char[] name, bool dontBroadcast) { int client = GetClientOfUserId(event.GetInt("userid")); if(!bClan[client]) { bClan[client] = true; char clan[64]; CS_GetClientClanTag(client, clan, sizeof(clan)); PrintToServer("Player %N Clan Tag: %s", client, clan); } } public void OnClientPostAdminCheck(int client) { bClan[client] = false; } Pobierze clantag za 1 spawnem gracza na serwerze.- 9 odpowiedzi
-
- clantagu
- Pobieranie
-
(i 3 więcej)
Oznaczone tagami:
-
Pobieranie clantagu po dołączeniu gracza do serwera
camerdisco odpowiedział(a) na z0y temat w Problem z kodem
public void OnClientPostAdminCheck(int client) { char clan[64]; CS_GetClientClanTag(client, clan, sizeof(clan)); PrintToServer("Player %N Clan Tag: %s", client, clan); }- 9 odpowiedzi
-
- clantagu
- Pobieranie
-
(i 3 więcej)
Oznaczone tagami:
-
#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 Action:FreezePlayer(client) { CreateTimer(3.0, UnFreezePlayer, client, TIMER_FLAG_NO_MAPCHANGE); PrintToChat(client, "[COD:MW] Zostaniesz odmrozony za 3 sekundy."); SetEntityMoveType(client, MoveType:0); SetEntityRenderColor(client, 0, 128, 255, 135); return Plugin_Continue; } public Action:UnFreezePlayer(Handle:timer, any:client) { if(!IsValidClient(client)) return Plugin_Continue; SetEntityRenderColor(client, 255, 255, 255, 255); SetEntityMoveType(client, MoveType:2); return Plugin_Continue; }
-
Na pewno dodałeś globalny handle na górze pluginu?
-
Nie rozumiem w jakim celu pobierz clantag do stringu zmName, twój zapis sugeruje, że clantag przetrzymujesz prawdopodobnie w tej zmiennej, ale już globalnej i z tablicą dodatkową na wskazanie gracza. Ew. zastosowałeś po prostu zły zapis przypadkiem.
- 5 odpowiedzi
-
- literki
- PrintHintText
-
(i 4 więcej)
Oznaczone tagami: