AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   dbi_mysql doesnt see any tables /!\ (https://forums.alliedmods.net/showthread.php?t=108586)

nismo 11-07-2009 05:15

dbi_mysql doesnt see any tables /!\
 
Hello!

Is it possible to detect an extra string in clcmd command?
e.g.

USAGE: /command <reason>

/command Any text here

So how can I output the 'Any text here' part?

Thanks.

AoD90 11-07-2009 05:31

Re: CLCMD with extra string
 
Code:

public plugin_init() {
register_clcmd("say_team","cmdSay")
register_clcmd("say","cmdSay")
}

public cmdSay(id)
{
        new komanda[12]
        new text[200]
        new YourReason[32]
        read_args(text,199)
        remove_quotes(text)
        read_argv(0, komanda, 11)

        strtok(text, komanda, 11, text, 199, ' ')   
       
        if (equali(komanda, "/command"))
        {
                    strtok(text, YourReason, 31, text, 199, ' ')
        }
        return PLUGIN_CONTINUE
}


nismo 11-07-2009 08:06

Re: CLCMD with extra string
 
Thanks, that part works well, but now I`m a bit stuck with the mysql part.

I'm trying to use sqlite module, so I enabled it in the modules.ini file. But it seems that my plugin can't find any tables in my database. I'm also using the 'mysql' module for amxbans.

Console output:
[CALLADMIN]: Connected succesfully (localhost,CSuser,CSuser,*mypass*)!
[CALLADMIN]: Table Does not Exists!

Table really exists:
http://nismo.boxg.lv/images/other/table_exists.png

Whole code:
http://pastebin.com/me5f515f

Thanks!

nismo 11-07-2009 14:01

Re: dbi_mysql doesnt see any tables /!\
 
Quote:

Originally Posted by nismo (Post 983030)
Thanks, that part works well, but now I`m a bit stuck with the mysql part.

I'm trying to use sqlite module, so I enabled it in the modules.ini file. But it seems that my plugin can't find any tables in my database. I'm also using the 'mysql' module for amxbans.

Console output:
[CALLADMIN]: Connected succesfully (localhost,CSuser,CSuser,*mypass*)!
[CALLADMIN]: Table Does not Exists!

Table really exists:
http://nismo.boxg.lv/images/other/table_exists.png

Whole code:
http://pastebin.com/me5f515f

Thanks!


AoD90 11-07-2009 14:05

Re: dbi_mysql doesnt see any tables /!\
 
I'm no expert but I think this part need some changes:

Code:

if (equali(komanda, "/calladmin")) {

        if(!equali(text, "") && !equali(text, " ")) {




if (equali(komanda, "/calladmin")) {
            new cmdtext[32]
            strtok(text, cmdtext, 31, text, 199, ' ')

        if(!equali(cmdtext, "") && !equali(cmdtext, " ")) {


nismo 11-07-2009 14:12

Re: dbi_mysql doesnt see any tables /!\
 
As I said, that part is running good, output for 'text' is ok.

The problem is with 'sqlite' module. First of all, I get

[CALLADMIN]: Table Does not Exists!

from

if(!sqlite_table_exists(mysql, "server_calladmin")) server_print("[CALLADMIN]: Table Does not Exists!")

And if I try to run the command e.g. '/calladmin asdf' i get this:

[CALLADMIN]: no such table: server_calladmin|1

It's something to do with sqlite. Also updated the 'sqlite' library's for my server, the same result. The same with any other tables, databases, users.


All times are GMT -4. The time now is 17:47.

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