function getcorpse($item) { global $db, $tablepre, $log, $mode; global $itm0, $itmk0, $itme0, $itms0, $itmsk0, $money, $pls, $action; $corpseid = strpos($action, 'corpse') === 0 ? str_replace('corpse', '', $action) : str_replace('pacorpse', '', $action); if (!$corpseid || strpos($action, 'corpse') === false) { $log .= '<span class="yellow">你没有遇到尸体,或已经离开现场!</span><br>'; $action = ''; $mode = 'command'; return; } $result = $db->query("SELECT * FROM {$tablepre}players WHERE pid='{$corpseid}'"); if (!$db->num_rows($result)) { $log .= '对方不存在!<br>'; $action = ''; $mode = 'command'; return; } $edata = $db->fetch_array($result); if ($edata['hp'] > 0) { $log .= '对方尚未死亡!<br>'; $action = ''; $mode = 'command'; return; } elseif ($edata['pls'] != $pls) { $log .= '对方跟你不在同一个地图!<br>'; $action = ''; $mode = 'command'; return; } if ($item == 'wep') { $itm0 = $edata['wep']; $itmk0 = $edata['wepk']; $itme0 = $edata['wepe']; $itms0 = $edata['weps']; $itmsk0 = $edata['wepsk']; $edata['wep'] = $edata['wepk'] = $edata['wepsk'] = ''; $edata['wepe'] = $edata['weps'] = 0; } elseif (strpos($item, 'ar') === 0) { $itm0 = $edata[$item]; $itmk0 = $edata[$item . 'k']; $itme0 = $edata[$item . 'e']; $itms0 = $edata[$item . 's']; $itmsk0 = $edata[$item . 'sk']; $edata[$item] = $edata[$item . 'k'] = $edata[$item . 'sk'] = ''; $edata[$item . 'e'] = $edata[$item . 's'] = 0; } elseif (strpos($item, 'itm') === 0) { $itmn = substr($item, 3, 1); $itm0 = $edata['itm' . $itmn]; $itmk0 = $edata['itmk' . $itmn]; $itme0 = $edata['itme' . $itmn]; $itms0 = $edata['itms' . $itmn]; $itmsk0 = $edata['itmsk' . $itmn]; $edata['itm' . $itmn] = $edata['itmk' . $itmn] = $edata['itmsk' . $itmn] = ''; $edata['itme' . $itmn] = $edata['itms' . $itmn] = 0; } elseif ($item == 'money') { $money += $edata['money']; $log .= '获得了金钱 <span class="yellow">' . $edata['money'] . '</span>。<br>'; $edata['money'] = 0; player_save($edata); $action = ''; $mode = 'command'; return; } else { $action = ''; return; } player_save($edata); if (!$itms0 || !$itmk0 || $itmk0 == 'WN' || $itmk0 == 'DN') { $log .= '该物品不存在!'; } else { itemget(); } $action = ''; $mode = 'command'; return; }
echo "deathnpckillername{$i}=-1\n"; } } $result = $db->query("SELECT sNo,pls,name,state,bid FROM {$tablepre}players WHERE type = 0 AND state >= 10 AND deathtime >= {$endtime}"); $rows = $db->num_rows($result); echo "pcdeathnum={$rows}\n"; $i = 0; while ($data = $db->fetch_array($result)) { $i++; echo "deathpcsNo{$i}={$data['sNo']}\n"; echo "deathpcpls{$i}={$data['pls']}\n"; echo "deathpcname{$i}={$data['name']}\n"; echo "deathpcstate{$i}={$data['state']}\n"; $t = $data['state']; if ($t == 20 || $t == 21 || $t == 22 || $t == 23 || $t == 24 || $t == 29) { $rs = $db->query("SELECT type,sNo,name FROM {$tablepre}players WHERE pid='{$data['bid']}'"); $dd = $db->fetch_array($rs); echo "deathpckillertype{$i}={$dd['type']}\n"; echo "deathpckillersNo{$i}={$dd['sNo']}\n"; echo "deathpckillername{$i}={$dd['name']}\n"; } else { echo "deathpckillertype{$i}=-1\n"; echo "deathpckillersNo{$i}=-1\n"; echo "deathpckillername{$i}=-1\n"; } } echo "weather={$weather}\n"; //echo "log=$log\n"; $endtime = $now; player_save($pdata);