Raised This Month: $158 Target: $400
 39% 

[INC] Stringtables


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Location: Methamphetamine
Old 11-21-2019 , 23:29   [INC] Stringtables
Reply With Quote #1

Not so long ago I made a plugin Stringtables control and thought that it is better to make a methodmap and add support for other games not only L4D2 (As soon as possible I will try to add other games)

You can create your own tables and store data in it, but keep in mind that all tables are destroyed if the map end.
So you can also copy or fully clear them

Currently supported : L4D & 2, CS GO (Need some tests)

Some examples
PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>
#include <stringtables_data>

public void OnPluginStart()
{
    
RegConsoleCmd("sm_createtable"ct);
    
RegConsoleCmd("sm_cleantabledownloadables"cd);
}

public 
Action cd (int clientint args)
{
    
StringTable pTable StringTable.ByName("downloadables"); // Find Table
    
pTable.DeleteStrings(); // Delete Strings
}

public 
Action ct (int clientint args)
{
    
StringTable.SetStateCreate(true); // Allow Creation
    
    
char szBuffer[36], szSavedData[36];
    
Format(szBuffersizeof szBuffer"Some Data");
    
    
StringTable pTable StringTable.Create("MyTable"2048); // Create table
    
    
int stringindx pTable.StoreData(sizeof szBufferszBuffer); // Save data to table
    
pTable.GetData(stringindxsizeof szBufferszSavedData); // Get Data
    
    
PrintToServer(szSavedData); // ?
    
    
StringTable.SetStateCreate(false); // Disallow Creation 


yea its my first methodmap
Attached Files
File Type: txt stringtabledata.txt (4.6 KB, 3 views)
File Type: inc stringtables_data.inc (6.3 KB, 3 views)
__________________
Heart

Last edited by BHaType; Today at 01:30.
BHaType is offline
Send a message via AIM to BHaType
Kxnrl
AlliedModders Donor
Join Date: May 2015
Old 11-26-2019 , 20:15   Re: [INC] Stringtables
Reply With Quote #2

nice work
__________________
Kxnrl is offline
ReCreator
Member
Join Date: Nov 2017
Location: Ukraine,Kyiv
Old Yesterday , 17:04   Re: [INC] Stringtables
Reply With Quote #3

Is it possible to make it for sm 1.9 or later versions?
__________________
Sorry for my pure English...

Last edited by ReCreator; Yesterday at 17:04.
ReCreator is offline
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Location: Methamphetamine
Old Today , 01:31   Re: [INC] Stringtables
Reply With Quote #4

Updated

PHP Code:
Updated some sigs
Fixed function this.DeleteStrings 
__________________
Heart

Last edited by BHaType; Today at 01:31.
BHaType is offline
Send a message via AIM to BHaType
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Location: Methamphetamine
Old Today , 01:33   Re: [INC] Stringtables
Reply With Quote #5

Quote:
Originally Posted by ReCreator View Post
Is it possible to make it for sm 1.9 or later versions?
Just remove the GameData method from the inc file
__________________
Heart
BHaType is offline
Send a message via AIM to BHaType
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:22.


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode