AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [INC/ ?ANY?] EZQL Plugin with SetValue/GetValue natives for MYSQL (https://forums.alliedmods.net/showthread.php?t=328410)

ladaladik 11-08-2020 03:37

[INC/ ?ANY?] EZQL Plugin with SetValue/GetValue natives for MYSQL
 
2 Attachment(s)
This plugin basically gives you option to use natives

L_GetValue(int client); and L_SetValue(int client, int value);
with those natives you can set players value and get clients value, all is saved in mysql so you can use it for your shop, free vip plugins and i guess many more.

bug reports and feedback would be nice.

How to use this:
Drop the .smx in your plugins folder
and then fill this info and put it in the databases.cfg in sourcemod/addons/configs/databases.cfg

Code:

        "Laff_DEV"
        {
                "driver" "mysql"
                "host" "your host"
                "database" "database"
                "user" "user"
                "pass" "password"
                "port" "3306"
        }

plugin example :
PHP Code:

public void OnPluginStart()
{
    
RegConsoleCmd("sm_setvalue"command_Set);
    
RegConsoleCmd("sm_getvalue"getval);
}
public 
Action command_Set(int clientint args)
{
    
char plusnum[10];
    
GetCmdArg(1plusnumsizeof(plusnum));
    
int value StringToInt(plusnumsizeof(plusnum));
    
L_SetClientValue(clientL_GetClientValue(client) + value);
}
public 
Action getval(int clientint args)
{
    
PrintToChatAll("%N has %i"clientL_GetClientValue(client));




All times are GMT -4. The time now is 04:09.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.