need help with sql
im trying to make a VERY simple plugin that dumps the number of current players and the map into an sql database.... here is what i have and i get all kinds of errors..
Code:
#include <amxmodx>
#include <amxmisc>
#include <dbi>
new PLUGIN[]="Server Status"
new AUTHOR[]=".:OaB:."
new VERSION[]="1.00"
new host[64],user[64],pass[64],dbname[64]
get_cvar_string("amx_sql_host",host,63)
get_cvar_string("amx_sql_user",user,63)
get_cvar_string("amx_sql_pass",pass,63)
get_cvar_string("amx_sql_db",dbname,63)
new currentplayers
new maxplayers
new map
new Float:freq = 15
dbi_connect(host,user,pass,dbname)
public updateInfo()
{
currentplayers = get_playersnum(1)
maxplayers = get_maxplayers()
map = get_mapname()
dbi_query(sql,"UPDATE serverstatus SET currentplayers='%d', maxplayers='%d', map='%s'",currentplayers,maxplayers,map)
return PLUGIN_CONTINUE
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(freq,"updateInfo",0,"",0,"b")
return PLUGIN_CONTINUE
}
Quote:
Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
/home/groups/amxmodx/tmp3/phpVZt4q1.sma(10) : error 021: symbol already defined: "get_cvar_string"
/home/groups/amxmodx/tmp3/phpVZt4q1.sma(19) : warning 213: tag mismatch
/home/groups/amxmodx/tmp3/phpVZt4q1.sma(19) : error 021: symbol already defined: "dbi_connect"
/home/groups/amxmodx/tmp3/phpVZt4q1.sma(26) : error 088: number of arguments does not match definition
/home/groups/amxmodx/tmp3/phpVZt4q1.sma(27) : error 017: undefined symbol "sql"
/home/groups/amxmodx/tmp3/phpVZt4q1.sma(27) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/phpVZt4q1.sma(27) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/phpVZt4q1.sma(27) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/phpVZt4q1.sma(27) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/phpVZt4q1.sma(27) : error 001: expected token: ";", but found ")"
/home/groups/amxmodx/tmp3/phpVZt4q1.sma(27) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/phpVZt4q1.sma(27) : fatal error 107: too many error messages on one line
Compilation aborted.
7 Errors.
|
help would be awesome. thanks
|