Raised This Month: $ Target: $400
 0% 

Sourcemod member authorisation


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Corrosive
Junior Member
Join Date: Aug 2008
Old 08-08-2008 , 22:06   Re: Sourcemod member authorisation
Reply With Quote #1

We're trying it with the following code, but it isn't really responding

PHP Code:
#include <sourcemod>
 
public Plugin:myinfo =
{
 
name "Authentication",
 
author " ",
 
description "Client Authentication",
 
version "1.0.0.0",
 
url " "
};
 
public 
OnPluginStart()
{
}
 
new 
Handle:hDatabase INVALID_HANDLE;
StartSQL()
{
 
SQL_TConnect(GotDatabase);
}
 
public 
GotDatabase(Handle:ownerHandle:hndl, const String:error[], any:data)
{
 if (
hndl == INVALID_HANDLE)
 {
  
LogError("Database failure: %s"error);
 } else {
  
hDatabase hndl;
 }
}

CheckSteamID(userid, const String:auth[], maxstrlen)
{
 
decl String:query[255];
 
Format(querysizeof(query), "SELECT steamid FROM cpay_users WHERE steamid = '%s'"auth);
 
SQL_TQuery(hdatabaseT_CheckSteamIDqueryuserid)
}
 
public 
T_CheckSteamID(Handle:ownerHandle:hndl, const String:error[], any:data)
{
 new 
client;
 
 
/* Make sure the client didn't disconnect while the thread was running */
 
if ((client GetClientOfUserId(data)) == 0)
 {
  return;
 }
 
 if (
hndl == INVALID_HANDLE)
 {
  
LogError("Query failed! %s"error);
  
KickClient(client"Authorization failed");
 } else if (!
SQL_GetRowCount(hndl)) {
  
KickClient(client"You are not a member");
 }

Pleeeaase help us out here!!
Corrosive 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 21:30.


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