Raised This Month: $ Target: $400
 0% 

[HELP] With SQL plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Magnetronkip
New Member
Join Date: Oct 2006
Old 01-19-2009 , 10:00   [HELP] With SQL plugin
Reply With Quote #1

Hi
i am making a plugin that should check the steamid of a user in a database. when the steamid is in the database the plugin will do nothing. when the steamid isn't in the database it wil give a kick. but i can't get it working the plugin is compiling and loaded at the server but it doesn't work...

Can somebody help me please ?

PHP Code:
public check_delayed(parm[])
{  
    
//Load database connection function  
    
sql_init()  
      
    
//Get connecting clients steamid and ipadress  
    
new client_steamid[40]   
    
get_user_authid(parm[0],client_steamid,50)   
    new 
client_ip[16]   
    
get_user_ip(parm[0],client_ip,15,1)  
    new 
client_name[40]  
    
get_user_name(parm[0],client_name,40)  
      
    
//Send a message to the server that a check is starting  
    
server_cmd("amx_say [SceneShockers Skillat Servert] Checking if %s is in the database.",client_name)  

    
//Format the database querry  
    
new query[256]   
    
format(query,255,"SELECT steamid,nickname FROM players WHERE steamid='%s'",client_steamid)   

    
//Execute querry  
    
dbi_query(mysql,query);   
    new 
merror[64]   
    
dbi_error(mysql,merror,63)  
      
    
//If an error occured  
    
if (merror[0])
    {   
        
server_print("amx_say [SceneShockers Skillat Servert] MYSQL error: %s",merror)  
        return 
PLUGIN_CONTINUE   
    
}  
    
    if (
res <= RESULT_NONE) {
    
server_cmd("amx_say [SceneShockers Skillat Servert] Checking if %s is in the database.",client_name)
        
server_cmd("amx_say [SceneShockers Skillat Servert] %s is in the database.",client_name)
    
        }else {
  
server_cmd("amx_say [SceneShockers Skillat Servert] %s wasn't in the database. Get out...",client_name)  
    
client_cmd(parm[0],"echo ^"[SceneShockers Skillat ServertYour SteamID has no access to this servert!.^"")  
    
client_cmd(parm[0],"echo ^"[SceneShockers Skillat ServertThis is an skillat people only servert!^"")    
    
client_cmd(parm[0],"disconnect")
    
dbi_free_result(res)
}
 
 if (
mysql == SQL_OK)
    {
        
dbi_close(mysql)
        return 
PLUGIN_HANDLED
    
}
            
    return 
PLUGIN_HANDLED     

*EDIT*
Oke i changed the code, but it still isn't working. i still can connect to the server and it will say that my steamid is in the database but it isnt... please help me !

Last edited by Magnetronkip; 01-19-2009 at 16:47.
Magnetronkip 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 01:54.


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