Raised This Month: $51 Target: $400
 12% 

This wont compile?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 03-29-2004 , 19:47   This wont compile?
Reply With Quote #1

Code:
#include <amxmodx> #include <amxmisc> #include <mysql> new mysql //MySQL Connection new sqlhost[64], sqluser[32], sqlpass[32], sqldb[32],sqlerror[256], sqlquery[256] //MySQL Connection Stuff public plugin_init() {     server_cmd("exec addons/amxx/configs/mysql.cfg")     register_plugin("MySQL Bans","0.1","devicenull")     register_concmd("mysql_ban","permban",ADMIN_BAN," Permanant ban someone")     set_task(float(10),"initmysql") } public initmysql() {     get_cvar_string("amx_mysql_host",sqlhost,64)     get_cvar_string("amx_mysql_user",sqluser,32)     get_cvar_string("amx_mysql_pass",sqlpass,32)     get_cvar_string("amx_mysql_db",sqldb,32)     mysql = mysql_connect(sqlhost,sqluser,sqlpass,sqldb,sqlerror,256) //Connect to sql database     if (sqlerror[0]) {         server_print("[NSX] Mysql error: %s",sqlerror)      }    } public permban(id) {     if (!(get_user_flags(id)&ADMIN_BAN)) {         console_print(id,"[NSX] Access Denied")         return PLUGIN_HANDLED     }     if (get_argc() <= 1) {         console_print(id,"[NSX] amx_pban <player>")         return PLUGIN_HANDLED     }     new pid = cmd_target(id,target,9)     if (!pid) {         // Possibly ban anyway with seperate flag?         console_print(id,"[NSX] Player Not Found")         return PLUGIN_HANDLED     }     new authid[32], name[32], uname[32], uauth[32] query[128], result[128], echo[128], args[256]     new reason[256]     read_args(args,256)     for (new i = 0; i<=256;i++) {         if (isspace(args[i]) {             new c = i             i = 256         }     }     i = 1     new a = 1     while (args[i]) {         reason[a] = args[i]     }     get_user_authid(pid,authid,32)     get_user_authid(id,uauth,32)     get_user_name(pid,name,32)     get_user_name(id,uname,32)     format(query,128,"INSERT INTO `bans`( `id` , `name` , `reason` ) VALUES(`%s`,`%s`,`%s`),authid,name,reason)     result = mysql_query(mysql,query)     if (result != 0) {         console_print(id,"[NSX] %s (%s) was sucessfully banned.",name,authid)         switch(get_cvar_num("amx_show_activity"))         {             case 1: client_print(0,print_chat,"[NSX] Admin banned %s",name)             case 2: client_print(0,print_chat,"[NSX] %s banned %s",uname,name)         }         server_cmd("banid ^"0^" ^"%s^"; wait; writeid")         format(echo,128,"echo [NSX] You have been permanantly banned by %s because %s",uname,reason)         client_cmd(pid,echo)         client_cmd(pid,"disconnect")         }         else {             server_print("[NSX] Error adding ban")         return PLUGIN_HANDLED         }         log_amx("PermaBan: %s (%s) banned %s (%s) reason: %s -> Ban added to mysql database",uname,uauth,name,authid,reason)     } return PLUGIN_HANDLED }

Why wont that compile
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 03-29-2004 , 19:50  
Reply With Quote #2

Code:
#inclde <amxmodmisc>

hehe use #include <amxmisc>
__________________

BigBaller is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 03-29-2004 , 19:53  
Reply With Quote #3

Still compiles to an empty file: Compiler gives me this error
Assertion failed: !_pushed, file sc2.c, line 1214
ABNORMAL TERMINATION
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
BigBaller
Veteran Member
Join Date: Mar 2004
Location: Everett, WA
Old 03-29-2004 , 19:56  
Reply With Quote #4

Code:
        return PLUGIN_HANDLED         }         log_amx("PermaBan: %s (%s) banned %s (%s) reason: %s -> Ban added to mysql database",uname,uauth,name,authid,reason)     } }

That is what you have at the bottom of the plugin

Try

Code:
        return PLUGIN_HANDLED         }         log_amx("PermaBan: %s (%s) banned %s (%s) reason: %s -> Ban added to mysql database",uname,uauth,name,authid,reason)     }     return PLUGIN_CONTINUE }

or use PLUGIN_HANDLED

w/e is your desire effect.

EDIT

When either using return PLUGIN_HANDLED or CONTINUE it will compile and return the .amx file as 0 bytes.
__________________

BigBaller is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 03-29-2004 , 19:58  
Reply With Quote #5

Did and still nothing
Still is an empty plugin
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
CheesyPeteza
Senior Member
Join Date: Feb 2004
Location: UK
Old 03-29-2004 , 20:48  
Reply With Quote #6

Code:
format(query,128,"INSERT INTO `bans`( `id` , `name` , `reason` ) VALUES(`%s`,`%s`,`%s`),authid,name,reason)     result = mysql_query(mysql,query)

You forgot the last double quote.
__________________
YO|Cheesy Peteza

[email protected]

CheesyPeteza is offline
Reply



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 04:42.


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