Hi
ich will, dass mir die Waffe in eine MYsqltabelle geloggt wird, wenn ich jemanden kille
Also MP5 = 2 .... Ak = 938 ...
LOG
Spoiler anzeigen
0:00 [13.12.10 16:10:49] Notice: ========================================== 
0:00 [13.12.10 16:10:49] Notice: Manu-Admin-Mod v0.11.3 beta.gif" wcf_src=http://manuadminmod.de/forum/wcf/images/smilies/beta.gif alt="beta">.gif" wcf_src=http://manuadminmod.de/forum/wcf/images/smilies/beta.gif alt="beta"> is starting... 
0:00 [13.12.10 16:10:49] Notice: ========================================== 
0:00 [13.12.10 16:10:49] Notice: !! Please wait until the mod is completely initialised 
0:00 [13.12.10 16:10:49] Notice: Config loaded: config.cfg 
0:00 [13.12.10 16:10:49] Notice: Config loaded: maps.cfg 
0:00 [13.12.10 16:10:49] Notice: Config loaded: admins.cfg 
0:00 [13.12.10 16:10:49] Notice: Config loaded: groups.cfg 
0:00 [13.12.10 16:10:49] Notice: Config loaded: reasons.cfg 
0:00 [13.12.10 16:10:49] Notice: Language files loaded: en 
0:00 [13.12.10 16:10:49] Notice: All config files were parsed 
0:00 [13.12.10 16:10:50] Notice: RCON connection established (127.0.0.1:28960) 
0:00 [13.12.10 16:10:51] Notice: Game detected: Call of Duty 4 
0:00 [13.12.10 16:10:51] Notice: Dvar check successful 
0:00 [13.12.10 16:10:52] Notice: Synced playerlist with 'status' 
0:00 [13.12.10 16:10:53] Notice: Updated Dvar g_gametype 
0:00 [13.12.10 16:10:53] Notice: Updated teamnames (usmc vs. arab) 
0:00 [13.12.10 16:10:54] Notice: Sets Dvar _manuadminmod to '0.11.3 beta.gif" wcf_src=http://manuadminmod.de/forum/wcf/images/smilies/beta.gif alt="beta">.gif" wcf_src=http://manuadminmod.de/forum/wcf/images/smilies/beta.gif alt="beta">' 
0:00 [13.12.10 16:10:54] Notice: == Loading plugins and commands == 
0:00 [13.12.10 16:10:54] Notice: - Loading mam_weaponrestrictions.php 
0:00 [13.12.10 16:10:54] Notice: - Loading badwords.php 
0:00 [13.12.10 16:10:54] Notice: - Loading punkbuster.php 
0:00 [13.12.10 16:10:55] Notice: - Loading basiccommands.php 
0:00 [13.12.10 16:10:55] Notice: - Loading serverrules.php 
0:00 [13.12.10 16:10:55] Notice: - Loading funmessages.php 
0:00 [13.12.10 16:10:55] Notice: - Loading pingkicker.php 
0:00 [13.12.10 16:10:55] Notice: - Loading warns.php 
0:00 [13.12.10 16:10:55] Notice: - Loading nameprotection.php 
0:00 [13.12.10 16:10:55] Notice: - Loading plugin_geoip.php 
0:00 [13.12.10 16:10:55] Notice: - Loading voting.php 
0:00 [13.12.10 16:10:55] Notice: - Loading modstuff.php 
0:00 [13.12.10 16:10:57] Notice: Heartbeat has been sent to serverlist at manuadminmod.de: Server successfully added 
0:00 [13.12.10 16:10:57] Notice: - Loading antiteamkiller.php 
0:00 [13.12.10 16:10:57] Notice: - Loading statistics.php 
0:00 [13.12.10 16:10:57] Notice: - Loading banner.php 
0:00 [13.12.10 16:10:57] Notice: - Loading randommapcycle.php 
0:00 [13.12.10 16:10:57] Notice: Randommapcycle: Setting nextmap to mp_backlot_2 (sd) 
0:00 [13.12.10 16:10:58] Notice: Set Dvar sv_maprotationcurrent to 'gametype sd map mp_backlot_2' 
0:00 [13.12.10 16:10:58] Notice: - Loading tcp_query.php 
0:00 [13.12.10 16:10:58] Notice: - Loading spreemessages.php 
0:00 [13.12.10 16:10:58] Notice: - Loading mapvote.php 
0:00 [13.12.10 16:10:58] Notice: - Loading welcomemessages.php 
0:00 [13.12.10 16:10:58] Notice: - Loading customcommands.php 
0:00 [13.12.10 16:10:58] Notice: - Loading scream.php 
0:00 [13.12.10 16:10:58] Notice: == Finished loading plugins == 
0:00 [13.12.10 16:10:58] Notice: !! Finished initialisation 
0:00 [13.12.10 16:10:58] Notice: === Start processing loglines... === 
0:00 [13.12.10 16:11:00] Notice: Banner message was sent: ^0Next map is: ^5mp_backlot_2
Code mit ausgeklammertem MYSQL export
<?php
/*
PLUGIN: Weaponrestrictions
================
Kicks players automatically when they are using a restricted weapon
CONFIG:
-------
[weaponrestrictions]
enabled = 1                                   ;Enable plugin
weapons = "gl,frag_grenade_short"             ;restricted weapons
warnstokick = 2                               ;Warns until players get kicked
mode = "tempban"                              ;kick/ban/tempban
kickreason = "Used a restricted weapon: <WEAPON>" ;Reason of the kick
NAMESPACE: weaponrestrictions
Functions:
 weaponrestrictions_main
 weaponrestrictions_playerInit
 
 DATABASE==============================
 
-- phpMyAdmin SQL Dump
-- version 2.11.8.1deb5+lenny6
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Erstellungszeit: 10. Dezember 2010 um 18:33
-- Server Version: 5.0.51
-- PHP-Version: 5.2.6-1+lenny9
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Datenbank: `mamstats`
--
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `waffen`
--
ALTER TABLE `mam01_user` ADD(
  `ak47_mp` int(11) NOT NULL,
  `g36c_mp` int(11) NOT NULL,
  `g3_mp` int(11) NOT NULL,
  `m14_mp` int(11) NOT NULL,
  `m16_mp` int(11) NOT NULL,
  `m4_mp` int(11) NOT NULL,
  `mp44_mp` int(11) NOT NULL,
  `mp5_mp` int(11) NOT NULL,
  `skorpion_mp` int(11) NOT NULL,
  `uzi_mp` int(11) NOT NULL,
  `ak74u_mp` int(11) NOT NULL,
  `p90_mp` int(11) NOT NULL,
  `saw_mp` int(11) NOT NULL,
  `rpd_mp` int(11) NOT NULL,
  `m60e4_mp` int(11) NOT NULL,
  `m1014_mp` int(11) NOT NULL,
  `winchester1200_mp` int(11) NOT NULL,
  `m40a3_mp` int(11) NOT NULL,
  `m21_mp` int(11) NOT NULL,
  `dragunov_mp` int(11) NOT NULL,
  `barrett_mp` int(11) NOT NULL,
  `remington700_mp` int(11) NOT NULL,
  `beretta_mp` int(11) NOT NULL,
  `usp_mp` int(11) NOT NULL,
  `colt45_mp` int(11) NOT NULL,
  `deserteagle_mp` int(11) NOT NULL,
  `flash_mp` int(11) NOT NULL,
  `frag_mp` int(11) NOT NULL,
  `smoke_mp` int(11) NOT NULL,
  `concussion_mp` int(11) NOT NULL,
  `frag_grenade_short_mp` int(11) NOT NULL,
  `artillery_mp` int(11) NOT NULL,
  `c4_mp` int(11) NOT NULL,
  `claymore_mp` int(11) NOT NULL,
  `cobra_mp` int(11) NOT NULL,
  `gl_mp` int(11) NOT NULL,
  `rpg_mp` int(11) NOT NULL
) ;
*/
$mod->setDefaultCV("weaponrestrictions", "enabled", 0);
$mod->setDefaultCV("weaponrestrictions", "weapons", "");
$mod->setDefaultCV("weaponrestrictions", "warnstokick", 2);
$mod->setDefaultCV("weaponrestrictions", "mode", "tempban");
$mod->setDefaultCV("weaponrestrictions", "kickreason", "Used a restricted weapon: <WEAPON>");
$mod->registerEvent("playerJoined", "weaponrestrictions_playerInit");
$mod->registerEvent("playerKill", "weaponrestrictions_main");
$mod->registerEvent("playerTeamKill", "weaponrestrictions_main");
//Init Players because playerJoined isn't called at startup
//Init Players because playerJoined isn't called at startup
array_map("weaponrestrictions_playerInit", array_keys($players));
function weaponrestrictions_main($parameters) {
global $mod;
global $players;
global $logging;
global $logkickbans_filehandle;
list($killer_guid, $victim_guid, $weapon) = $parameters;
  //  if ($weapon[1] == "MOD_MELEE") {
  //  //Dont warn when player knived while he had a restricted weapon
  //  return;
   // }
$weapon = $weapon[0];
if (!$mod->getCV("weaponrestrictions", "enabled")) {
    return;
}
$weapons = explode(",", $mod->getCV("weaponrestrictions", "weapons"));
$restricted = false;
foreach ($weapons as $value) {
if (strpos($weapon, $value . "_") === 0) {
$restricted = true;
break;
}
}
 mysql_connect("localhost","root","werdaskiestwüsstewohlgernemeinmysqlrootpwxD");
  mysql_select_db("mamstats");
  // Make a MySQL Connection
$sql = "SELECT * FROM `mam01_user` WHERE `guid` = $killer_guid" ;
 
$result = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_array($result)){
  $row[$weapon] = $row[$weapon]++;
}
   
$sql1= "select * from 'mam01_nicks' UPDATE $weapon = $weapon +1 where 'guid' = $killer_guid ;";
mysql_query($sql1);
}
function weaponrestrictions_playerInit($guid) {
$GLOBALS['players'][$guid]->weaponrestrictions_warns = 0;
}
?>Wo liegt der Fehöer
