Raised This Month: $ Target: $400
 0% 

warning 217: loose indentation


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rCa
Junior Member
Join Date: Jun 2007
Old 06-02-2007 , 05:35   warning 217: loose indentation
Reply With Quote #1

What this error means ? and how to fix it ?
rCa is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-02-2007 , 05:44   Re: warning 217: loose indentation
Reply With Quote #2

code?
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
rCa
Junior Member
Join Date: Jun 2007
Old 06-02-2007 , 06:03   Re: warning 217: loose indentation
Reply With Quote #3

Code:
#define PLUGINNAME "gg"
#define VERSION  "gg"
#define AUTHOR   "gg"
 
#include <amxmodx>
#include <dbi>
#include <amxmisc>
#include <engine>
 
#define CVAR_WHOST   "wwwreg_host"
#define CVAR_WUSER   "wwwreg_user"
#define CVAR_WPASS   "wwwreg_pass"
#define CVAR_WDB   "wwwreg_db"
// Global vars below
new g_regged[33]
// Global vars above
public plugin_modules() {
 require_module("engine")
 require_module("dbi")
}
public client_authorized(id) {
 if (is_user_bot(id))
  return PLUGIN_CONTINUE
 const LEN = 32
 new authid[LEN + 1], name[32]
 get_user_authid(id, authid, LEN)
 get_user_name(id, name, 31)
 g_regged[id] = checkreg(id,name)
 if (g_regged[id])
  server_print("[%s] %s (%s) is registered.", PLUGINNAME, name, authid)
 else {
  server_cmd("kick %s Prasome uzsiregistruokite www.gzn.lt", name)
  server_print("[%s] %s (%s) is not registered.", PLUGINNAME, name, authid)
 }
 return PLUGIN_CONTINUE
}
bool:checkreg(id,name[]) {
 new Sql:sql
 if (!connect(sql))
  return false
 const LONGER = 128
 new query[LONGER + 1]
 format(query, LONGER, "SELECT `pass` FROM server_users WHERE `nick` = ^"%s^" LIMIT 1", name)
 new Result:result = dbi_query(sql, query)
 if (result <= RESULT_FAILED) {
  new error[256]
  dbi_error(sql, error, 255)
  log_amx("Error while quering SQL server for %s, can't check registration: %s", name, error)
  dbi_close(sql)
  return false
 }
 else if (result == RESULT_NONE) {
  dbi_close(sql)
  return false
 }
 if (!dbi_nextrow(result)) {
  dbi_close(sql)
  return false // not regged
 }
 new regtime[64]
 dbi_field(result, 1, regtime, 63)
 new password[64]
 get_user_info(id, "setinfo _pw", password, 63)
         if(equal(regtime[0], password[0])
 || equal(regtime[1], password[1])
 || equal(regtime[2], password[2])
 || equal(regtime[3], password[3])
 || equal(regtime[4], password[4])
 || equal(regtime[5], password[5])
 || equal(regtime[6], password[6]))
{
 return true
}
         return false
}
bool:connect(&Sql:sql) {
 const LEN = 128
 new host[LEN], user[LEN], pass[LEN], db[LEN], error_msg[LEN]
 get_cvar_string(CVAR_WHOST, host, LEN - 1)
 get_cvar_string(CVAR_WUSER, user, LEN - 1)
 get_cvar_string(CVAR_WPASS, pass, LEN - 1)
 get_cvar_string(CVAR_WDB, db, LEN - 1)
 sql = dbi_connect(host, user, pass, db, error_msg, LEN - 1)
 if (!sql) {
  log_amx("ERROR - Can't connect to SQL db: %s", error_msg)
  return false
 }
 return true
}
public plugin_init() {
 register_plugin(PLUGINNAME, VERSION, AUTHOR)
 register_cvar(CVAR_WHOST, "127.0.0.1")
 register_cvar(CVAR_WUSER, "root")
 register_cvar(CVAR_WPASS, "")
 register_cvar(CVAR_WDB, "gzn")
 new sqlcfgpath[128]
 get_configsdir(sqlcfgpath, 127)
 format(sqlcfgpath, 127, "%s/sql.cfg", sqlcfgpath)
 server_cmd("exec %s", sqlcfgpath)
 server_exec()
 new Sql:sql
 if (!connect(sql)) {
  log_amx("Couldn't connect to SQL database at plugin_init! Pausing plugin.")
  pause("a")
  return
 } else { 
 server_print("[%s] Connected successfully to SQL database.", PLUGINNAME)
 dbi_close(sql)
}
}
i need that he get setinfo _pw pass and hes not geting it just clear
and then i mysql pass equal setinfo _pw then return true

Last edited by rCa; 06-02-2007 at 06:08.
rCa is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-02-2007 , 06:27   Re: warning 217: loose indentation
Reply With Quote #4

Compiled without any errors || warnings!
Attached Files
File Type: sma Get Plugin or Get Source (unnamed.sma - 974 views - 3.0 KB)
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
rCa
Junior Member
Join Date: Jun 2007
Old 06-02-2007 , 06:33   Re: warning 217: loose indentation
Reply With Quote #5

Thanks a lot for your help
but still when i connect with correct setingo _pw and nick hes still kick me maybe somebody know why ? :/

Last edited by rCa; 06-02-2007 at 06:37.
rCa is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 06-02-2007 , 06:39   Re: warning 217: loose indentation
Reply With Quote #6

change this
Code:
get_user_info(id, "setinfo _pw", password, 63)
to
Code:
get_user_info(id, "_pw", password, 63)
greetz regalis
__________________
regalis is offline
rCa
Junior Member
Join Date: Jun 2007
Old 06-02-2007 , 06:43   Re: warning 217: loose indentation
Reply With Quote #7

still
Reason: Kicked rasome uzsiregistruokite www.gzn.lt
:/ maybe is problem with equal ?
rCa is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 06-02-2007 , 07:13   Re: warning 217: loose indentation
Reply With Quote #8

You are hurting my eyes with this:
Code:
if(equal(regtime[0], password[0])
 || equal(regtime[1], password[1])
 || equal(regtime[2], password[2])
 || equal(regtime[3], password[3])
 || equal(regtime[4], password[4])
 || equal(regtime[5], password[5])
 || equal(regtime[6], password[6]))
please change it to
Code:
if(equal(regtime, password))

Last edited by _Master_; 06-02-2007 at 07:26.
_Master_ is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 06-02-2007 , 07:13   Re: warning 217: loose indentation
Reply With Quote #9

Code:
         if(equal(regtime[0], password[0])
 || equal(regtime[1], password[1])
 || equal(regtime[2], password[2])
 || equal(regtime[3], password[3])
 || equal(regtime[4], password[4])
 || equal(regtime[5], password[5])
 || equal(regtime[6], password[6]))
why not only if(equal(regtime, password)) ??

Btw.: insert debug messages if the passwort is correct..maybe you find the error with that messages !?
__________________
regalis is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 06-02-2007 , 07:13   Re: warning 217: loose indentation
Reply With Quote #10

looooooooooooooooooooooooooooooooool
__________________
regalis is offline
Reply


Thread Tools
Display Modes

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


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