Raised This Month: $ Target: $400
 0% 

help sqlx


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
thallysbar
Junior Member
Join Date: Oct 2007
Old 08-03-2009 , 00:00   help sqlx
Reply With Quote #1

Hello guys need a help with this script.
I will explain, I want the plugin to compare steamid the player in the mysql database if it is not registered is kick.
the original plugin does the same thing but in a file and I need q search the database.
someone help me?
sorry my english

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <sqlx>
 
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"
new g_configsdir[64]
new 
steamid_db[64]
new const 
restrict_msg[] = "Desculpe, mas voce deve estar registrado para entrar no servidor!"
public plugin_init() {
 
 
register_plugin(PLUGINVERSIONAUTHOR)
}
public 
plugin_cfg()
{
 
get_configsdir(g_configsdir63 )
 
format(steamid_db,63,"%s/steamid_db.ini",g_configsdir)
 
 if(!
file_exists(steamid_db))
  
write_file(steamid_db,"");
}
public 
client_connect(id)
{
 if(
is_steamid_in_file(id))
  return 
1;
 
 else
  
server_cmd("kick #%i ^"%s^"",get_user_userid(id),restrict_msg)
 
 return 
1;
}
 
stock is_steamid_in_file(id) {
 
 new 
file fopen(steamid_db,"r")
 
 new 
mauthid[30],pauthid[30]
 
get_user_authid(id,pauthid29)
 
 if (!
pauthid[0] )
  return 
0;
 
 while (!
feof(file))
 {
 
  
fgets(filemauthid19);
  new 
len strlen(pauthid);
 
  if (
equali(pauthidmauthidlen))
  {
   
fclose(file)
   return 
1;
  }
 }
 
fclose(file)
 return 
0;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1046\\ f0\\ fs16 \n\\ par }
*/ 
thallysbar 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:54.


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