Jump to content
php.lv forumi

Smart IRC + PHP


Kefiirs

Recommended Posts

Sveiki! Tad nu man ir problēma ar php un irc apvienošanu!

Nu ja šeit ir kāds irc pro, tad varētu palīdzēt!

Tad nu problēma:

Man ir spēļu serveris, serverī čatā uzrakstot komandu atveras logs, kurš aizceļo tālāk uz weblapu un tagad sākas labākā daļa...

Karoči sākumā viss notiek ar vienu failu, kurš ieliek _POST iekš tā loga un izvelk visu spēlētāju nikneimus, tādējādi tagad PHP var apstrādāt iegūto informāciju un konektēt tālāk uz to SmartIRC, kurš piekonektē irc.lv serverim un manam kanālam un iepousto kanālā tādu ziņu, kādu ir devis spēlētājs iekš tā loga!

 

Tad nu problēma rodas tajā, ka vai nu viņš nekonektē tajam irc'am vai nu arī kaut kas cits, nezinu kas!

 

Tad nu es pievienošu pie attačmentiem visu skriptu, lai Jums kāda skaidrība ir ap to!

 

To .sma failu var atvērt ar notepad un apskatīties!

 

Paldies!

 

admincall.zip

Edited by Kefiirs
Link to comment
Share on other sites

Kr4 tev ir jādara tā

Viss kas ir root mapītē, jāiemet iekš tava webservera mapes, admincall.sma jāiemet ieks cstrike/addons/amxmodx/scriptings/admincall.sma , palaid viņu ar notepad2 un ieraksti savu adresi , piemēram tu viņu iemet www/cs/ mapē un un tad raksti admincall_domain ", "tavaadrese/cs/");

un tad palaid compile.exe viņs nokompilēs iemet iekš plugins amxx failu ,kas ir parādas scripting/compiled/ un iekš amxmodx/configs/plugins.ini ieraksti admincall.amxx , un taāā tad atliek sakonfigurēt config.inc.php kas ir iekš www/cs/ mapes so es darītu tā:

<?
/*****************************************************************************
* ID: config.inc.php, v 1.0 2003/12/06
* Author: SentryIII
*
* Copyright (c) 2003 Josh "SentryIII"
* 
* Full LGPL License: <http://www.gnu.org/copyleft/lesser.txt>
* 
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
****************************************************************************/

// Site Design
$content[title] = "Chiteru nosudzeshana"; // <-- Main Title. BIG Font!
$content[subtitle] = "Request Admin"; // <-- Tell the players what their looking at.
$content[message] = "
In any case the problem player will not be kicked automatically, instead an admin will join the game and watch the player.
"; // The above text is shown to inform the player of any special instructions.
$font[text] = "#000000"; // <-- Default is black
$color[body] = "#696969";
$color[table] = "#000000";
$color[td] = "#C0C0C0";
$color[tdborder] = "#000000";

// Game Server Name
$servername = "Tavs servera nosaukums"; // This name shows in the IRC request so the admins know which server to goto!

// Problems List
$problem[0] = "Glitching";
$problem[1] = "Racist";
$problem[2] = "Team Killer";
$problem[3] = "Hostage Killer";
$problem[4] = "Spamer";
$problem[5] = "Language";
$problem[6] = "Hacks/Cheats";
//$problem[7] = "You can add more as needed!";
//$problem[8] = "";

// IRC Config
// Be sure you only have 1 server defined. 2 = PROBLEMATIC. So, if you uncomment one, comment the other!
//$server = "irc.gamesnet.net";
$server = "irc.lv";
$port = "6667";
$botname = "BOTA NIKS";
$channel = "#tavs channels";

// Bot Timer
$timer = "5000"; 
// In milliseconds (1000 = 1 Second) - If the bot never connects after you submit then its probably because its being disconnected too fast.
// If thats the case for you then raise this number higher to get better results.
// WARNING: You dont want the bot to stay connected too long because it consumes the servers resources.
// I cant tell you how many times I had to restart because the bot wouldnt disconnect.

?>

Link to comment
Share on other sites

Es jau to visu esmu izmēģinājis 100x

Ir kaut kāds černis, kad viņš nekonektē klāt tam mIRC'am

Visa ziņa paņemas un sūtās, bet manā mIRC kanālā vēl tas mIRC bots nav neko ierakstījis!

 

Nu tik dumjš, lai nokompilētu es neesmu :D

 

Visu pilnīgi saprotu, bet pie gala rezultāta netieku!

 

+ Neplāties tikai apkārt ar šo skriptu!

Edited by Kefiirs
Link to comment
Share on other sites

kas tur ko mācēt ....

ja dati nāk no mysql, tad:

mysql_connect("server","u","p") or die(mysql_error());
mysql_select_db("mydb") or die(mysql_error());
$sql = "kaut kads kverijs";
$dati = mysql_query($sql);
//vai
mysql_query($sql) or die(mysql_error());
if (!$dati){
//kaut kas nav ..
echo mysql_error();
echo '<br>' . $sql;
}

utt

Link to comment
Share on other sites

Dati nenāk no MySQL, tie nāk no skripta, ko ielādē spēļu serveris, tad spēlētājs ieraksta čatā komandu, viņam atveras logs, kur priekšā stāv visu spēlētāju nikneimi un viņš izvēlas, tad izvēlas iemeslu, nospiež AIZIET un tam automātiski ir jāparādas iekš mana mIRC kanāla, bet tā nenotiek!

Link to comment
Share on other sites

nu tā ir ar jebkuru mainīgo bezmazvai ...

 

paskaties manuāli ko izmantojamā fcija atgriež un tad skaties ... jo pārsvarā visas fcijas atgriež false ja nevar izpildīt prasīto uzdevumu ...

 

$kaut_kas = kaut_kada_fcija($paramtrs1, $paramtrs2);

if (!$kaut_kas)

{

echo "Kļūda. nevaru izpildīt fciju: kaut_kada_fcija( $paramtrs1 , $paramtrs2 ) ";

}

un aiziet, pēti

Edited by Klez
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...