AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved SQL help (https://forums.alliedmods.net/showthread.php?t=294624)

Lawnmoverman 03-03-2017 16:45

SQL help
 
This plugins gives me compile error:

line 25 error 088: number of arguments does not match definition

And Im really cant get it: (whats missing?)
Code:
#include <amxmodx> #include <amxmisc> #include <dbi> public plugin_init() {     register_plugin("SQL Server Status", "1.0", "Lawnmoverman");     register_event("HLTV", "event_new_round", "a", "1=0", "2=0");     } public event_new_round() {     new Sql:mysql = dbi_connect("bla.bla.bla.bla", "bla", "blabla", "blablabla");       if (mysql < SQL_OK) {         new err[255];         new errNum = dbi_error(mysql, err, 254);         console_print(0, "[Status SQL]: %s|%d", err, errNum);         return 1;     }       console_print(0, "[Status SQL]: Successfully updated server status");     new Result:ret = dbi_query(mysql, "UPDATE servers SET map = '%s', players = '%d', maxplayers = '%d' WHERE hostname = 'cs.nozgaming.eu'", get_mapname(), get_playersnum(), get_maxplayers());       if (ret < RESULT_NONE) {         new err[255];         new errNum = dbi_error(mysql, err, 254);         console_print(0, "[Status SQL]: %s|%d", err, errNum);         return 1;     }       dbi_close(mysql);     return PLUGIN_HANDLED; }

Someone, please fix it! Thanks.

klippy 03-03-2017 17:59

Re: SQL help
 
First, don't use DBI, use SQLx: https://forums.alliedmods.net/showthread.php?t=46779.

The problem is in get_mapname() call; that's not how you call it. Take a look at the doc page for get_mapname() (also, always refer to docs first).

Lawnmoverman 03-03-2017 18:39

Re: SQL help
 
Solved


All times are GMT -4. The time now is 20:57.

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