Raised This Month: $ Target: $400
 0% 

FileExist or in Mysql number exist


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
BloodyNuker
Member
Join Date: Jan 2006
Old 03-28-2006 , 10:02  
Reply With Quote #5

I create this.. but i donīt know if correct, can you tell me if this need another comand or if I have got errors? (Sorry my bad english )

Code:
// MYSQL Show the number of the IP exist in a database XX
#include <amxmodx> 
#include <amxmisc> 
#include <dbi> 

new Plugin_Author[] = "Jajaja"; 
new Plugin_Version[] = "0.1"; 
new Plugin_Name[] = "ShowIPindatabase" 
new Sql:dbc 
new Result:result 

#define client_models_password "gordon" 

public plugin_init() 
{ 

register_plugin(Plugin_Name,Plugin_Version,Plugin_Author); 

register_concmd("amx_aca","client_info",ADMIN_ALL,"ACA Server-Side Plugin"); 

} 

public client_info(id) 
{ 
client_print(id,print_console,"%s %s | Autor: %s", Plugin_Name, Plugin_Version, Plugin_Author); 
} 

public client_putinserver(id) 
{ 
set_task(10.0, "client_connect", id, "b") 
set_task(15.0, "client_verification1", id, "b") 

} 

public client_connect()  { 
new host[64], username[32], password[32], dbname[32], error[32] 
get_cvar_string("amx_sql_host",host,64) 
get_cvar_string("amx_sql_user",username,32) 
get_cvar_string("amx_sql_pass",password,32) 
get_cvar_string("amx_sql_db",dbname,32) 

dbc = dbi_connect(host,username,password,dbname,error,32) 

if (dbc == SQL_FAILED) 
{ 
log_amx("SQL Connection Failed") 
dbi_close(dbc) 
return 
} 

} 



public client_verification1(id) 
{ 
new authid[32] 
get_user_ip(id, player_ip, 50, 1) 
result = dbi_query(dbc,"SELECT * FROM `myTable` WHERE `myColumn` = 'player_ip', player_ip") 
if(equal(player_ip,"result")) 
{ 
client_print(id,print_chat,"The IP are registered in DATA BASE") 
} 
else { 
client_print(id,print_chat,"The IP are not registered in DATA BASE") 
} 
dbi_free_result(result) 

return PLUGIN_CONTINUE 
}
BloodyNuker 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 16:42.


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