Raised This Month: $51 Target: $400
 12% 

help for sql


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Miew
Member
Join Date: Jan 2014
Old 01-25-2014 , 17:41   help for sql
Reply With Quote #1

some one can help me for fix this plugin , cause he crash my server ...
PHP Code:
#include <sourcemod>
#include <cstrike>
#include <sdktools>
#include <smlib>

new Handle:DB INVALID_HANDLE;
new 
String:Error[100];

public 
Plugin:myinfo = {
name "MySQL",
author "Skuzy",
description "",
url ""
};

public 
OnPluginStart()
{
   
DB SQL_Connect("test"trueErrorsizeof(Error));
   if(
DB == INVALID_HANDLE)
   {
      
PrintToServer("Cannot connect to MySQL Server: %s"Error);
      
CloseHandle(DB);
   } else {
      
PrintToServer("Connection Successful");
   }

   
RegConsoleCmd("sm_clantag",CallBack_clantag);
}

GetClientPrefix(clientString:prefix[32])
{
   new 
String:steamid[32];
   
GetClientAuthString(clientsteamid32);
   
   new 
String:query[150];
   
Format(querysizeof(query), "SELECT prefix FROM chatcolor WHERE steamid='%s'"steamid);

   
SQL_LockDatabase(DB);

   new 
Handle:queryH SQL_Query(DBquery);
   
SQL_LockDatabase(DB);
   
SQL_FetchRow(queryH);

   
SQL_FetchString(queryH0prefixsizeof(prefix));

   
CloseHandle(queryH);

}

public 
Action:CallBack_clantag(client,args)
{
   new 
String:NewPrefix[32];
   
GetClientPrefix(clientNewPrefix);
   
CS_SetClientClanTag(clientNewPrefix);

Miew 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:10.


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