Roberrt Opublikowano Czerwiec 21, 2018 o 22:10 Udostępnij Opublikowano Czerwiec 21, 2018 o 22:10 Podsyłam rozszerzenie do swojego sklepusms na !freevip (Tutaj !start). Można przerabiać bawić się itp itd ale nie sprzedawać wiecie ocb. Spoiler #include <sourcemod> #include <sdktools> #include <clientprefs> #pragma semicolon 1 #pragma newdecls required ConVar cvTime; ConVar cvServiceID; ConVar cvServiceName; ConVar cvRequiredString; char cServiceName[64]; char cRequiredString[64]; int iServiceID; int iServiceTime; Handle hCookie; public Plugin myinfo = { name = "[Roberrt] SklepSMS: Darmowy VIP", author = "Roberrt", description = "", version = "1.0.0 <Stable>", url = "http://roberrt.ovh" }; public void OnPluginStart() { hCookie = RegClientCookie("shopsms_free_vip_cookie", "Usluga for free", CookieAccess_Private); cvTime = CreateConVar("shopsms_freevip_service_time", "2", "Czas trwania usługi (lub ilość)"); cvServiceID = CreateConVar("shopsms_freevip_service_id", "1", "ID nadawanej usługi"); cvServiceName = CreateConVar("shopsms_freevip_service_name", "VIP", "Nazwa nadawanej usługi"); cvRequiredString = CreateConVar("shopsms_freevip_required_string_in_name", "CS-4Frags.pl", "Wymagany tekst w nicku do odbioru usługi"); AutoExecConfig(true, "sklepsms_freevip", "sourcemod/sklepsms"); RegConsoleCmd("sm_start", Start); } public void OnConfigsExecuted() { char tempBuf[64]; cvTime.GetString(tempBuf, sizeof(tempBuf)); iServiceTime = StringToInt(tempBuf); cvServiceName.GetString(cServiceName, sizeof(cServiceName)); cvServiceID.GetString(tempBuf, sizeof(tempBuf)); iServiceID = StringToInt(tempBuf); cvRequiredString.GetString(cRequiredString, sizeof(cRequiredString)); } public Action Start(int client, int args) { char cState[10]; GetClientCookie(client, hCookie, cState, sizeof(cState)); if (StrEqual(cState, "")) { char cName[64]; GetClientName(client, cName, sizeof(cName)); if (StrContains(cName, cRequiredString) != -1) { Menu menu = new Menu(MenuHandler); char buffer[64]; menu.SetTitle("*** Wybierz swoją nagrodę ***\n "); Format(buffer, sizeof(buffer), "%s na %i %s", cServiceName, iServiceTime, iServiceTime == 1 ? "dzień":"dni"); menu.AddItem("vip", buffer); menu.Display(client, 69); } else PrintToChat(client, " \x01\x0B\x04[SklepSMS] \x01Dodaj do nicku \x02%s\x01 aby tego użyć.", cRequiredString); } else PrintToChat(client, " \x01\x0B\x04[SklepSMS] \x01Odebrałeś już swoją \x10nagrodę\x01."); } public int MenuHandler(Menu menu, MenuAction action, int client, int param) { switch (action) { case MenuAction_Select: { char item[64]; menu.GetItem(param, item, sizeof(item)); if (StrEqual("vip", item)) { SetClientCookie(client, hCookie, "used"); ServerCommand("sklepsms_api_execute add_service_silent \"%i\" \"%i\" \"%i\"", GetClientUserId(client), iServiceID, iServiceTime); PrintToChat(client, " \x01\x0B\x04[SklepSMS] \x01Poprawnie otrzymałeś \x10%s na %i %s\x01.", cServiceName, iServiceTime, iServiceTime == 1 ? "dzień":"dni"); } } } } regards. 2 Podziękuj! SklepSMS.ovh - Najlepszy Sklep Usług na serwer CS:GO Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi
Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto
Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.
Zarejestruj nowe konto
Załóż nowe konto. To bardzo proste!
Zarejestruj sięZaloguj się
Posiadasz już konto? Zaloguj się poniżej.
Zaloguj się