Jump to content
Sign in to follow this  

About This Club

String roy = "gay";

  1. What's new in this club
  2. who can help with loading screens?
  3. Yea, you wind up writing some C++ and rust as glue, but once you get the flow right it's not bad. Plus, it buys you access to a lot of great rust libraries
  4. This is pretty cool. I always thought about whether it was feasible to write stuff like this in rust because you have to write a C wrapper for it first. Good luck with that project. Also funny because I started working on something similar in C++ before but never really worked on it.
  5. Hello again GFL, time to post about another SourceMod extension I've been working on. This time the main goal of the extension was to get a feel for what it's like to write SourceMod extensions in Rust instead of the more typical C++ This extension provides servers with methods to act as Discord bots, both send and receiving messages from Discord. In a nut shell you set the `discord_bot_token` console variable to a bot token generated on the Discord site, and the extension will automatically open a websocket connection to Discord and start processing messages. When a message is received a global forward is fired so plugins can process the message: public void OnDiscordMessage(DiscordUser author, DiscordMessage msg); The `DiscordMessage` and `DiscordUser` arguments passed in contain information about the message and its author. For example to read the content of the message: char content[512]; msg.GetContent(content, sizeof(content)); Or to get the ID of the guild (server) the message was sent to: int guildId[2]; msg.GuildId(guildId); Note: we define `guildId` as an `int[2]` because all Discord IDs are 64 bit integers. Because of this, the extension also provides utility functions for converting strings to and from 64 bit integers: native void UInt64ToString(int u64[2], char buffer[24]); native void StringToUInt64(const char[] buffer, int u64[2]); To send a message as a reply, we can use `ReplyToChannel` to send a message to the same channel the current message was received from. msg.ReplyToChannel("Hello there, %s", userName); Or if we want more control over the content of our message, we can construct a `NewDiscordMessage` and send it to the same channelId: NewDiscordMessage msg = new NewDiscordMessage(); msg.SetContent("Hello there, %s", userName); Discord_SendToChannel(channelId, msg); Note that `ReplyToChannel, and `SetContent` both support the full SourceMod string formatting rules. `NewDiscordMessage` supports adding embeds for a more rich message. For installation information, see the readme on the GitLab repository. For the full list of provided functions, look at the include file provided with the extension.
  6. thanks @ButterKing5000 il try that EDIT: you mfing G that worked thanks man, im such a retard should have tried that
  7. It looks like you are wanting to check your table for those three particular strings (weapons). With your current code you could use a loop. Idk how to use code tags on my phone for k, v in pairs(inv) do if v == "sword" then elseif v == "bow" then elseif v == "dagger" then end This loops through your table for each value in it, with k being the value’s key (in your case a number) and v being one of your strings. This tends to be a more or less frowned upon method of doing things, as it can potentially be problematic with large tables. A more optimized way to handle tables is to assign a string key a value. In your case, a simple Boolean will suffice. local inv = {} inv["bow"] = true if inv["bow"] then end I’ll put this in proper code tags tomorrow.
  8. im still really new and i dont know what any of that is but thanks for the tutorial, reading through it rn
  9. I'm not trying to show the "right" code. I can see errors here such as ignoring the key bool, but trying to show a framework or format I would recommend using. print("Welcome to my game.") print("You are in a small cave, there is a chest infront of you, and a locked door.") def OpenChest(): print("You open a chest and find a key") key=true def OpenDoor(): if key == true then print("You open a door, infront of you lay 3 weapons, a bow, a sword, and a dagger, which will you pick?") def exit(): input = "exit" def SwitchExample(Selection): Switch = {1: OpenChest() 2: OpenDoor() 0: exit() } while input ~= "exit" do print SwitchExample.get(Selection, 0) edit: You may find this link useful since my examples in the tutorial were in C: https://jaxenter.com/implement-switch-case-statement-python-138315.html
  10. that actually helped me out a lot joshy
  11. Be one of the big kids and use a switch instead.
  12. Just started to try and learn lua and im making this little text game project to test things out i insert and item into a table and i want a certain string to appear for different values in the table take a look: key=false inv={} input="" print("Welcome to my game.") print("You are in a small cave, there is a chest infront of you, and a locked door.") while input ~= "exit" do if input == "inv" then for i, v in pairs(inv) do print(i,v) end print("What will you do?") end input=io.read() if input == "open chest" then print("You open a chest and find a key") key=true elseif input == "open door" then if key == true then print("You open a door, infront of you lay 3 weapons, a bow, a sword, and a dagger, which will you pick?") elseif key == false then print("The door is locked, perhaps you should find a key.") end end if input == "bow" then table.insert(inv, "bow") print("You picked up a bow!") print("As you pick up your weapon, a trapdoor activates and you fall into a hole, you get back up and infront of you lies a goblin, what will you do?(attack, run)") elseif input == "sword" then table.insert(inv, "sword") print("You picked up a sword!") print("As you pick up your weapon, a trapdoor activates and you fall into a hole, you get back up and infront of you lies a goblin, what will you do?(attack, run)") elseif input == "dagger" then table.insert(inv, "dagger") print("You picked up a dagger!") print("As you pick up your weapon, a trapdoor activates and you fall into a hole, you get back up and infront of you lies a goblin, what will you do?(attack, run)") io.read() end if input == "attack" then if pairs(inv) == {"bow"} then print("With your bow you fire an arrow at the goblin, it hits it, and the goblin perishes") elseif inv == {"sword"} then print("With your sword you swing at the goblin and kill it") elseif inv == {"dagger"} then print("With your dagger, you thrust it into the globin, and it perishes") end end end as you see with the bow section I've tried using the pairs command to no avail, and in sword, and dagger, is how I wrote it previously any help, and a good explanation would be nice.
  13. That's cool what you do man. I might try to learn lua later on.
  14. The title might not really reflect the current state of the 'Timer' since it currently isn't anything you'd want to have on your server. In an attempt to learn more about the engine and (low level) C++ in general I started to look into how you can develop plugins for source engine servers in c++. After messing around with sourcemod extensions for a while I thought it would be a good idea to try creating a 'timer' as a metamod plugin just to get to know how stuff actually works. After a few weeks of more or less active coding, I came to the realization that I don't want to code my own thread library, database wrapper, translation system and several other things sourcemod provides c++ interfaces for so I rewrote most of it in C++ with a slightly different approach. As useful as these interfaces are, sourcemod doesn't provide c++ interfaces for client commands and a lot of other stuff and some of the interfaces need some further abstraction to be used in code which means there's a LOT of extra code you wouldn't need to write if you were writing a sourcemod plugin. TL;DR I only recommend doing this if you're either very experienced with low-level c++, know a lot about sourcemod plugins or a lot about the engine in general but I already learned a ton of it. My main goals with this timer if I ever finish it are: support for an 'infinite' amount of tracks and checkpoints easy configuration both c++ and sourcepawn interfaces for easy extensibility If you want to look at the sourcecode: GitHub
  15. This is a work in progress java game engine that I am working on so it is buggy but I thought I should spread the info about it. Source Code: https://github.com/XavierDD1st/Vine-Guard
  16. http://blog.counter-strike.net/index.php/2018/04/20400/ Should be fixed, i think
  17. Of course! It'll also take Valve another week to fix it as well I'm sure the community will find a fix soon. Thanks.
  18. Another new exploit... https://forums.alliedmods.net/showpost.php?p=2590111&postcount=112 Fix (but doesn't work): https://forums.alliedmods.net/showpost.php?p=2590123&postcount=113
  19. Thank you for pointing this out. According to this include file, the v1.x branch (stable?) uses SBPP_BanPlayer. I got SBBanPlayer and SBPP_BanPlayer mixed up. I apologize for that. Though, in the dev branch, it uses SourceBans_*. Regardless, I compiled it using the old native because we aren't running on the latest version of SourceBans yet. We currently have a modified version of SourceBans to implement member and supporter groups which is why it's hard to upgrade to the latest version. At some point I will be implementing our modifications into the newest version of SourceBans and deploying it onto all of our servers using SourceMod. Thanks!
  20. so btw. stable version is 1.6.3 with SourceBans_* natives (include is now named as "sourcebanspp.inc").
  21. @Bonk @xSnowyAngel - Please ensure this is added to all of our CS:GO servers. Thanks!
  22. Hello, As some of you may know, there is another CS:GO exploit that Valve has yet to patch. This exploit has been used to crash our servers last night and today. As usual, the community found a fix (#1 and #2) quicker than Valve. Since we use SourceBans, our servers will be using fix #2. However, that plugin is compiled with the dev version of SourceBans which I believe uses a different native than the stable version of SourceBans. I have recompiled the plugin with the native used in the stable version of SourceBans and I will attach it to the thread. New Source Code #include <sourcemod> #include <sdkhooks> #undef REQUIRE_PLUGIN #include <sourcebans> bool g_bFullyConnected[MAXPLAYERS+1] = {false,...}; int g_bConnectNetMsgCount[MAXPLAYERS+1] = 0; public Plugin myinfo = { name = "NullWaveCrashFix", author = "backwards", description = "Exploit Fix", version = SOURCEMOD_VERSION, url = "http://www.steamcommunity.com/id/mypassword" } public void OnPluginStart() { HookEvent("player_connect_full", Event_PlayerConnectFull, EventHookMode_Pre); } public void OnMapStart() { for(new i=1;i<=MaxClients;i++) { g_bFullyConnected[i] = false; g_bConnectNetMsgCount[i] = 0; } } public void OnClientDisconnect(int client) { g_bFullyConnected[client] = false; g_bConnectNetMsgCount[client] = 0; } public Action Event_PlayerConnectFull(Handle event, const char[] name, bool dontBroadcast) { int client = GetClientOfUserId(GetEventInt(event, "userid")); if(!IsValidClient(client)) return Plugin_Continue; g_bConnectNetMsgCount[client]++; if(g_bConnectNetMsgCount[client] > 5) { if(!IsClientInKickQueue(client)) SBBanPlayer(0, client, 0, "Attempted server crash exploit"); } if(g_bFullyConnected[client]) { SetEventBroadcast(event, true); return Plugin_Changed; } else g_bFullyConnected[client] = true; return Plugin_Continue; } bool IsValidClient(int client) { if (!(1 <= client <= MaxClients) || !IsClientInGame(client) || IsClientSourceTV(client) || IsClientReplay(client)) return false; return true; } Changed SourceBans_BanPlayer(0, client, 0, "Attempted server crash exploit"); To SBBanPlayer(0, client, 0, "Attempted server crash exploit"); Credits 1337norway - Creating the fix. sneaK - Integrating the fix with SourceBans. Plugin nullwavefix.smx Source nullwavefix.sp If you have any questions or concerns, please let me know. Thanks.
  23. Well if Ecplise was already installed you could have just used that since you only need the JVM or JRE (Java Runtime Environment) for it instead of the JDK unless you're doing more advanced stuff. A simple text-based game can be developed without JDK. Mainly because most IDEs already have their own Java Compiler and Debugger.