Raised This Month: $ Target: $400
 0% 

Help With Plugin Calladmin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
geriks13
New Member
Join Date: May 2008
Old 10-15-2010 , 23:19   Help With Plugin Calladmin
Reply With Quote #1

i tryed to make plugin for calladmin on website chat its compile with no errors but it dosen't insert in database...
Code:
#include <amxmodx>
#include <dbi>
new Sql:dbc
new Result:result
public plugin_init(){
register_plugin("Call Admin From Website","0.1","GeRik")
register_clcmd("say","calladmin_say",0)
set_task(Float:10.0,"sql_init")
}
public sql_init() {
new host[64], username[32], password[32], dbname[32], error[32]
host="88.135.129.112"
username="root"
password="mypassword"
dbname="database"
log_amx("[CA Menu] SQL Init")
dbc = dbi_connect(host,username,password,dbname,error,32)
if (dbc == SQL_FAILED)         log_amx("[AMXX] SQL Connection Failed")
else
dbi_query(dbc,"CREATE TABLE IF NOT EXISTS `shoutbox` (`shout_id` int(5) NOT NULL auto_increment, `text` varchar(150) character set utf8 collate utf8_bin NOT NULL, `date` int(150) NOT NULL,`author` varchar(150) character set utf8 collate utf8_bin NOT NULL, `type` int(5) NOT NULL default '0', PRIMARY KEY  (`shout_id`)) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ;")
}
public calladmin_say(id) {
if (dbc == SQL_FAILED)
return PLUGIN_HANDLED
new szPlayerSay[61],szWhat[16]
remove_quotes(szPlayerSay)
if(equali(szWhat,"/calladmin")){
new ServerName[80]
new name[80]
new laiks[21]
get_user_info(id, "name", name, 31)
get_cvar_string("server_name", ServerName, 20)
get_time("%d.%m.%Y - %H:%M:%S",laiks,21)
result = dbi_query(dbc,"INSERT INTO shoutbox (author,type,text,date) VALUES ( '%s','%s','Izsauc Adminu uz serveri','%s' )",name,ServerName,laiks)
if (result == RESULT_OK) dbi_free_result(result)
if (result == RESULT_FAILED) return PLUGIN_HANDLED
new dbitype[32]
dbi_type(dbitype,32)
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}

Last edited by geriks13; 10-16-2010 at 09:27.
geriks13 is offline
 



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:17.


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