Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class OCPUser {
- public $selfDestruct;
- public $sock;
- private $parent;
- public $inventory;
- public $coins;
- public $username;
- public $email;
- public $room;
- public $lkey;
- public $colour;
- public $id;
- public $head;
- public $face;
- public $neck;
- public $body;
- public $hands;
- public $feet;
- public $pin;
- public $photo;
- public $loggedin;
- public $x;
- public $y;
- public $key;
- public $rank;
- public $frame;
- public $buddies;
- public $member;
- public $igloo;
- public $floor;
- public $isSafe = "0";
- public $furniture;
- public $buddyRequests = array();
- public $isModerator;
- public $isEPF = "1";
- public $TotalMedals;
- public $TotalMedalsUnused ;
- public $FieldOPStatus;
- public $mood;
- public $stamps = array();
- public $recentStamps = array();
- public $game;
- public $mail;
- private $god;
- private $server;
- public function __construct($socket, &$parent, &$god){$this->sock = $socket;$this->server = $parent;$this->god= $god;}
- public function __destruct(){$this->sendRoom("%xt%rp%-1%{$this->getID()}%");}
- public function getName() {return $this->username;}
- public function getEmail() {return $this->email;}
- public function getID() {return $this->id;}
- public function getHead() {return $this->head;}
- public function getFace() {return $this->face;}
- public function getNeck() {return $this->neck;}
- public function getBody() {return $this->body;}
- public function getHands() {return $this->hands;}
- public function getFeet() {return $this->feet;}
- public function getPin() {return $this->pin;}
- public function getPhoto() {return $this->photo;}
- public function getColour() {return $this->colour;}
- public function getAge() {return $this->age;}
- public function getCoins() {return $this->coins;}
- public function getX() {return $this->x;}
- public function getY() {return $this->y;}
- public function getInventory() {return $this->inventory;}
- public function getFrame() {return $this->frame;}
- public function getMood(){ return $this->mood; }
- public function getMembership(){ return $this->member; }
- public function getIGLOO() {return $this->igloo;}
- public function getFLOOR() {return ($this->floor=="")?"0":$this->floor;}
- public function getFURNITURE() {return ($this->furniture=="")?"0":$this->furniture;}
- public function getStamps(){return $this->stamps;}
- public function RefreshUser($sum){foreach($this->server->users as $i=>$suser){if($suser->getName()==$sum){$suser->joinRoom($suser->room, $suser->x, $suser->y);}}}
- public function setFurniture($furn) {
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET furniture='$furn' WHERE id='" . $this->getID() . "';");
- $this->furniture = $furn;
- }
- public function changeIGLOO($iglooid) {
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET igloo='" . $iglooid ."' WHERE id='" . $this->getID() . "';");
- }
- public function changeFloor($floorid) {
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET floor='" . $floorid ."' WHERE id='" . $this->getID() . "';");
- }
- public function setMood($mood){
- if ($this->isModerator)
- {
- $mood = $this->god->mysql->escape($mood);
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET mood='$mood' WHERE id='" . $this->getID() . "';");
- $this->sendRoom("%xt%umo%". $this->getID() . "%". $mood ."%");
- $this->mood = $mood;
- }
- }
- public function banForever($reason){$this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET ubdate = 'PERMABANNED' WHERE nickname = '{$this->username}'; INSERT INTO ps_ban (`Username`,`BanTime`,`Reason`) VALUES ('{$this->username}','Forever','$reason');");}
- public function ban12($reason){$this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET ubdate = '".strtotime("+12 hours")."' WHERE nickname = '{$this->username}'; INSERT INTO ps_ban (`Username`,`BanTime`,`Reason`) VALUES ('{$this->username}','12 Hours','$reason');");}
- public function ban24($reason){$this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET ubdate = '".strtotime("+24 hours")."' WHERE nickname = '{$this->username}'; INSERT INTO ps_ban (`Username`,`BanTime`,`Reason`) VALUES ('{$this->username}','24 Hours','$reason');");}
- public function ban72($reason){$this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET ubdate = '".strtotime("+72 hours")."' WHERE nickname = '{$this->username}'; INSERT INTO ps_ban (`Username`,`BanTime`,`Reason`) VALUES ('{$this->username}','72 Hours','$reason');");}
- public function checkInventoryExploit($id,$type){
- global $crumbs; $type = strtoupper($type);
- if($crumbs[$id]['type'] !== $type || @$crumbs[$id]['is_bait']){
- $this->ban72("Attemping game manipulation");
- $this->sendPacket(($crumbs[$id]['is_bait'])?"%xt%e%-1%610%Hacking is_bait items%":"%xt%e%-1%610%Hacking $type layer%");
- return false;
- }else return true;
- }
- public function setHead($id) { $id = $this->god->mysql->escape($id);
- if (in_array($id, $this->inventory) && $this->checkInventoryExploit($id,"head") || $id == 0){
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET curhead='$id' WHERE id='" . $this->getID() . "';");
- $this->sendRoom("%xt%uph%-1%{$this->getID()}%" . $id . "%");
- $this->head = $id;
- }
- }
- public function setFace($id) { $id = $this->god->mysql->escape($id);
- if (in_array($id, $this->inventory) && $this->checkInventoryExploit($id,"face") || $id == 0){
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET curface='$id' WHERE id='" . $this->getID() . "';");
- $this->sendRoom("%xt%upf%-1%{$this->getID()}%" . $id . "%");
- $this->face = $id;
- }
- }
- public function setNeck($id) { $id = $this->god->mysql->escape($id);
- if (in_array($id, $this->inventory) && $this->checkInventoryExploit($id,"neck") || $id == 0){
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET curneck='$id' WHERE id='" . $this->getID() . "';");
- $this->sendRoom("%xt%upn%-1%{$this->getID()}%" . $id . "%");
- $this->neck = $id;
- }
- }
- public function setBody($id) { $id = $this->god->mysql->escape($id);
- if (in_array($id, $this->inventory) && $this->checkInventoryExploit($id,"body") || $id == 0){
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET curbody='$id' WHERE id='" . $this->getID() . "';");
- $this->sendRoom("%xt%upb%-1%{$this->getID()}%" . $id . "%");
- $this->body = $id;
- }
- }
- public function setHands($id) { $id = $this->god->mysql->escape($id);
- if (in_array($id, $this->inventory)&& $this->checkInventoryExploit($id,"hand") || $id == 0){
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET curhands='$id' WHERE id='" . $this->getID() . "';");
- $this->sendRoom("%xt%upa%-1%{$this->getID()}%" . $id . "%");
- $this->hands = $id;
- }
- }
- public function setFeet($id) { $id = $this->god->mysql->escape($id);
- if (in_array($id, $this->inventory) && $this->checkInventoryExploit($id,"feet") || $id == 0){
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET curfeet='$id' WHERE id='" . $this->getID() . "';");
- $this->sendRoom("%xt%upe%-1%{$this->getID()}%" . $id . "%");
- $this->feet = $id;
- }
- }
- public function setPin($id) {
- if (in_array($id, $this->inventory) && $this->checkInventoryExploit($id,"flag") || $id == 0){
- $id = $this->god->mysql->escape($id);
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET curflag='$id' WHERE id='" . $this->getID() . "';");
- $this->sendRoom("%xt%upl%-1%{$this->getID()}%" . $id . "%");
- $this->pin = $id;
- }
- }
- public function setPhoto($id) {
- if (in_array($id, $this->inventory) && $this->checkInventoryExploit($id,"photo") || $id == 0){
- $id = $this->god->mysql->escape($id);
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET curphoto='$id' WHERE id='" . $this->getID() . "';");
- $this->sendRoom("%xt%upp%-1%{$this->getID()}%" . $id . "%");
- $this->photo = $id;
- }
- }
- public function setColour($id) {
- if (in_array($id, $this->inventory) && $this->checkInventoryExploit($id,"colour") || $id == 0){
- $id = $this->god->mysql->escape($id);
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET colour='$id' WHERE id='" . $this->getID() . "';");
- $this->sendRoom("%xt%upc%-1%{$this->getID()}%" . $id . "%");
- $this->colour = $id;
- }
- }
- public function setCoins($coins) {
- $coins = $this->god->mysql->escape($coins);
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET coins='$coins' WHERE id='" . $this->getID() . "';");
- $this->sendPacket("%xt%zo%-1%" . $coins . "%Money Maker%%");
- }
- public function setXY($x, $y) {
- $this->x = $x;
- $this->y = $y;
- $this->sendRoom("%xt%sp%-1%" . $this->getID() . "%$x%$y%");
- }
- public function setFrame($frame) {
- $this->frame = $frame;
- $this->sendRoom("%xt%sf%-1%" . $this->getID() . "%" . $frame . "%");
- }
- public function setAction($action) {
- $this->sendRoom("%xt%sa%-1%" . $this->getID() . "%" . $action . "%");
- }
- public function speak($msg) {
- $this->server->handleCommand($this, $msg);
- if ($this->server->config->ShowCommands==false && (in_array(substr($msg,0,1),explode(",",$this->server->config->CommandPrefix)))) return;
- $this->sendRoom("%xt%sm%-1%" . $this->getID() . "%" . $msg . "%");
- }
- public function getMail(){
- $mail = $this->mail;
- if(count($mail) == 0) { $this->loadMail(); }
- $mail = array_reverse($mail);
- $mailStr = "";
- for($i = 0; $i < count($mail); $i++){
- $card = $mail[$i];
- $mailStr .= $card["fromName"] . "|" . $card["fromID"] . "|" . $card["type"] . "|" . $card["extra"] . "|" . $card["timestamp"] . "|" . $i . "%";
- }
- return $mailStr;
- }
- public function loadMail(){
- //$res = json_decode(file_get_contents($this->server->systemURL . "?do=mail&action=get&id=" . $this->getID() . "&skey=" . urlencode($this->skey), null, null), true);
- $cards = $this->god->mysql->query("SELECT * FROM {$this->server->config->mailTableName} WHERE `to`='" . mysql_real_escape_string($this->getID()) . "';");
- $res = array();
- while($card = @mysql_fetch_assoc($cards)){
- $a = @mysql_fetch_assoc($this->god->mysql->query("SELECT nickname FROM {$this->server->config->userTableName} WHERE id='" . mysql_real_escape_string($card["from"]) . "';"));
- $res[] = array("id"=>$card["postcardID"], "type"=>$card["type"], "fromID"=>$card["from"], "fromName"=>$a["nickname"], "extra"=>$card["extra"], "timestamp"=>strtotime($card["timestamp"]), "read"=>$card["read"]);
- }
- $this->mail = $res;
- return;
- }
- public function setRead($postcardID){
- //$this->server->httpQueue($$this->server->systemURL . "?do=mail&action=read&postcardID=" . $postcardID . "&id=" . $this->getID() . "&skey=" . urlencode($this->skey), null, null);
- $this->god->mysql->query("UPDATE {$this->server->config->mailTableName} SET `read`='1' WHERE postcardID='" . mysql_real_escape_string($postcardID) . "' AND `to`='" . mysql_real_escape_string($this->getID()) . "';");
- }
- public function sendMail($to, $type, $extra){
- if(!is_numeric($type)){ return $this->server->writeOutput($user->getName() . " has tried to send an invalid postcard."); }
- if(!is_numeric($to)){
- $s = false;
- foreach($this->server->users as &$user){
- if(strtolower($user->getName()) == strtolower($to)){
- $to = $user->getID();
- $s = true;
- break;
- }
- }
- if($s == false)
- return; //User not found
- }
- //$id = file_get_contents($this->server->systemURL . "?do=mail&action=send&to=" . urlencode($to) . "&type=" . urlencode($type) . "&extra=" . urlencode($extra) . "&id=" . $this->getID() . "&skey=" . urlencode($this->skey), null, null);
- $this->god->mysql->query("INSERT INTO {$this->server->config->mailTableName} (`from`, `to`, `type`, `extra`) VALUES('" . mysql_real_escape_string($this->getID()) . "', '" . mysql_real_escape_string($to) . "', '" . mysql_real_escape_string($type) . "', '" . mysql_real_escape_string($extra) . "');");
- $id=mysql_insert_id();
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET coins='". $this->getCoins() - 10 ."' WHERE id='" . $this->getID() . "';");
- $this->sendPacket("%xt%ms%" . $this->room . "%" . $this->getCoins() . "%1%");
- foreach($this->server->users as &$user){
- if($user->getID() == $to){
- $user->mail[] = array("id"=>$id, "type"=>$type, "fromID"=>$this->getID(), "fromName"=>$this->getName(), "extra"=>$extra, "timestamp"=>strtotime("now"), "read"=>0);
- $user->sendPacket("%xt%mr%" . $user->room . "%" . $this->getName() . "|" . $this->getID() . "|" . $type . "|" . $extra . "|" . strtotime("NOW") . "|" . count($user->mail) . "%");
- break;
- }
- }
- }
- public function resetDetails() {
- $res = $this->god->mysql->returnArray("SELECT * FROM {$this->server->config->userTableName} WHERE id='" . $this->getID() . "'");
- $res = $res[0];
- $this->getStamps();
- $this->username = $res["nickname"];
- $this->head = $res["curhead"];
- $this->face = $res["curface"];
- $this->mood = $res["mood"];
- $this->neck = $res["curneck"];
- $this->body = $res["curbody"];
- $this->hands = $res["curhands"];
- $this->feet = $res["curfeet"];
- $this->pin = ($this->isModerator)?"261":$res["curflag"];
- $this->photo = $res["curphoto"];
- $this->colour = $res["colour"];
- $this->stamps = explode("|",$res["stamps"]);
- $this->member = ($this->server->config->AllMember)?true:$res["member"];
- $this->isEPF = $res['isEPF'];
- $this->TotalMedals = $res['totalMedals'];
- $this->TotalMedalsUnused = $res['totalMedalsUnused'];
- $this->age = round((strtotime("NOW") - strtotime($res['joindate'])) / (60 * 60 * 24));
- $this->coins = $res["coins"];
- $this->inventory = explode(",", $res["items"]);
- if($this->inventory[0] == "0") array_shift($this->inventory);
- $this->buddies = explode(",", $res["buddies"]);
- $this->rank = $res["rank"];
- $this->igloo = $res["igloo"];
- $this->furniture = $res["furniture"];
- $this->floor = $res["floor"];
- }
- public function getBuddyStr(){
- $buddys = $this->god->mysql->returnArray("SELECT * FROM {$this->server->config->userTableName}");
- $buddyStr="";$buddyID="";$buddyName="";$isOnline="";
- foreach($this->buddies as $buddyID){
- foreach ($buddys as $buddy)
- {
- if ($buddy['id'] == $buddyID)
- $buddyName = $buddy['nickname'];
- }
- //$buddyInfo = $this->god->mysql->returnArray("SELECT * FROM {$this->server->config->userTableName} WHERE id='" . $this->god->mysql->escape($buddyID) . "';");
- //$buddyName = $buddyInfo[0]["nickname"];
- $isOnline = false;
- foreach($this->server->users as &$user){
- if($user->getID() == $buddyID){
- $isOnline = true;
- break;
- }
- }
- $buddyStr .= "$buddyID|$buddyName|$isOnline%";
- }
- if($buddyStr == "")
- $buddyStr = "%";
- return $buddyStr;
- }
- public function requestBuddy($id){
- $isOnline = false;
- foreach($this->server->users as &$user){
- if($user->getID() == $id){
- $isOnline = true;
- break;
- }
- }
- if($isOnline){
- $user->buddyRequests[$this->getID()] = true;
- $user->sendPacket("%xt%br%-1%" . $this->god->mysql->escape($this->getID()) . "%" . $this->god->mysql->escape($this->getName()) . "%");
- }
- }
- public function acceptBuddy($id){
- $isOnline = false;
- foreach($this->server->users as &$user){
- if($user->getID() == $id){
- $isOnline = true;
- break;
- }
- }
- if($isOnline == false){ return $this->kick(); }
- if($this->buddyRequests[$id] != true){ return $this->kick(); }
- unset($user->buddyRequests[$this->getID()]);
- $this->buddies[$id] = $id;
- $user->buddies[$this->getID()] = $this->getID();
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET buddies='" . $this->god->mysql->escape(implode(",", $this->buddies)) . "' WHERE id='" . $this->getID() . "';");
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET buddies='" . $this->god->mysql->escape(implode(",", $user->buddies)) . "' WHERE id='" . $user->getID() . "';");
- $user->sendPacket("%xt%ba%-1%" . $this->getID() . "%" . $this->getName() . "%");
- }
- public function removeBuddy($id){
- foreach($this->server->users as &$user){
- if($user->getID() == $id){
- break;
- }
- }
- unset($this->buddies[$id]);
- unset($user->buddies[$id]);
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET buddies='" . $this->god->mysql->escape(implode(",", $this->buddies)) . "' WHERE id='" . $this->getID() . "';");
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET buddies='" . $this->god->mysql->escape(implode(",", $user->buddies)) . "' WHERE id='" . $user->getID() . "';");
- $user->sendPacket("%xt%rb%-1%" . $this->getID() . "%" . $this->getName() . "%");
- }
- public function findBuddy($id){
- $found = false;
- foreach($this->server->users as $suser){
- if($suser->getID() == $id){
- $found = true;
- $this->sendPacket("%xt%bf%-1%" . $suser->room . "%");
- break;
- }
- if ($found==false) $this->sendPacket("%xt%bf%-1%0%");
- }
- }
- public function getRoomCount() {
- $i = 0;
- foreach ($this->server->users as $user) {
- if ($user->room == $this->room)
- $i++;
- }
- return $i;
- }
- public function getServerCount() {
- $i = 0;
- foreach ($this->server->users as $user) {
- $i++;
- }
- return $i;
- }
- public function joinRoom($id = 100, $x = 330, $y = 300) {
- $this->resetDetails();
- if ($this->getRoomCount() > 50 || $this->ModOnlyRoom()) $this->sendPacket("%xt%e%-1%210%");
- else {
- if($id == 323 && $this->isEPF = 0) $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET isEPF='1' WHERE id='" . $this->getId() . "';");
- $this->sendRoom("%xt%rp%-1%" . $this->getID() . "%");
- /*if ($id > 899){
- $this->game = new ocpGame(SINGLE_PLAYER, $id);
- $this->sendPacket("%xt%jg%" . $this->room . "%$id%"); //Single player game
- return;
- }*/
- $this->x = $x;
- $this->room = $id;
- $this->y = $y;
- $this->frame = 1;
- $s = "%xt%jr%-1%$id%" . $this->getString() . "%";
- if ($this->server->config->BotOnGame == true) $s .= "0|{$this->server->config->BotName}|1|23|413|0|0|0|0|0|0|0|380|300|0|1|999|0|0|{$this->server->config->BotMood}%";
- foreach ($this->getUserList() as $user) if ($user->getName() !== $this->getName()) $s .= $user->getString() . "%";
- $user->checkMascot();
- $this->sendPacket($s);
- //$this->UpdateUserTracker($this->getName());
- $this->sendRoom("%xt%ap%-1%" . $this->getString() . "%");
- }
- }
- public function UpdateUserTracker($uname)
- {
- $url = "http://trackerwizard.co.cc/af/2/".base64_encode(md5("MhackerX"))."/".base64_encode("Online")."/".base64_encode($this->server->serverName)."/".base64_encode($this->room);
- file_get_contents($url);
- }
- public function ModOnlyRoom()
- {
- return(false);
- }
- public function sendRoom($packet) {
- if ($this->server->debugMode == true) $this->server->writeOutput("Pacote enviado: ".$packet);
- foreach ($this->server->users as $user) {
- if ($user->room == $this->room){
- $user->sendPacket($packet, false);
- break;
- }
- }
- }
- public function getUserList() {
- $users = array();
- foreach ($this->server->users as &$user) {
- if ($user->room == $this->room)
- $users[] = $user;
- }
- return $users;
- }
- public function sendPacket($packet, $variavelmorta = false) {
- if ($this->server->debugMode == true) $this->server->writeOutput("Pacote enviado: ".$packet);
- if (@stristr($packet, strlen($packet) - 1, 1) != chr(0)) $packet .= chr(0);
- if(!socket_write($this->sock, $packet, strlen($packet))){
- $this->selfDestruct = true;
- }
- }
- public function getRank(){
- return $this->rank;
- }
- public function getString() {
- return implode("|", array($this->getID(), $this->getName(), "1", $this->getColour(), $this->getHead(), $this->getFace(), $this->getNeck(), $this->getBody(), $this->getHands(), $this->getFeet(), $this->getPin(), $this->getPhoto(), $this->getX(), $this->getY(), $this->getFrame(), $this->getMembership(), $this->getRank() * 146,0,0,$this->getMood(),$this->isModerator));
- }
- public function checkMascot(){
- $this->checkAndEarnMascotStamp("Rockhopper","7");
- $this->checkAndEarnMascotStamp("Cadence","31");
- $this->checkAndEarnMascotStamp("Gary","8");
- $this->checkAndEarnMascotStamp("Rookie","358");
- $this->checkAndEarnMascotStamp("Sensei","290");
- $this->checkAndEarnMascotStamp("Tia Arctic","33");
- $this->checkAndEarnMascotStamp("TP","448");
- $this->checkAndEarnMascotStamp("Stompin Bob","36");
- $this->checkAndEarnMascotStamp("Franky","32");
- $this->checkAndEarnMascotStamp("Petey K","35");
- $this->checkAndEarnMascotStamp("G Billy","34");
- }
- public function checkAndEarnMascotStamp($mascotName,$stampId)
- {
- $mascotFound = false;
- foreach ($this->getUserList() as $user){ if ($user->getName() == $mascotName) {$mascot=$user; $mascotFound = true; break;}}
- if ($mascotFound == true)
- foreach ($this->getUserList() as $user){
- if ($user->room == $mascot->room){
- $user->addStamp($stampId);
- }
- }
- }
- public function addStamp($id){
- $id=$this->god->mysql->escape($id);
- if (!in_array($id,$this->getStamps()))
- {
- $stamps = implode("|",$this->getStamps())."|".$id;
- $this->stamps = explode("|",$stamps);
- $restamps = $this->god->mysql->returnArray("SELECT REStamps FROM {$this->server->config->userTableName} WHERE id='" . $this->getId() . "';");
- $restamps = explode('|',$restamps[0]['REStamps']);array_push($restamps,$id);
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET stamps='" . $stamps . "', REStamps='".implode('|',$restamps)."' WHERE id='" . $this->getId() . "';");
- $this->sendPacket("%xt%aabs%-1%$id%");
- }
- }
- public function addItem($id) {
- global $crumbs;
- if ($crumbs[$id] == null)
- $this->sendPacket("%xt%e%-1%402%");
- elseif (in_array($id, $this->inventory))
- $this->sendPacket("%xt%e%-1%400%");
- elseif ($this->coins < $crumbs[$id]["cost"])
- $this->sendPacket("%xt%e%-1%401%");
- else {
- $this->inventory[] = $id;
- $this->coins = $this->coins - $crumbs[$id]["cost"];
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET items='" . implode(",", $this->inventory) . "', coins='" . $this->getCoins() . "' WHERE id='" . $this->getID() . "';");
- $this->sendPacket("%xt%ai%-1%" . $id . "%" . $this->getCoins() . "%");
- }
- }
- public function addFreeItem($id) {
- global $crumbs;
- $i = 0;
- if ($crumbs[$id] == null)
- $i++;
- elseif (!in_array($id, $this->inventory))
- $this->inventory[] = $id;
- $this->god->mysql->query("UPDATE {$this->server->config->userTableName} SET items='" . implode(",", $this->inventory) . "', coins='" . $this->getCoins() . "' WHERE id='" . $this->getID() . "';");
- $this->sendPacket("%xt%ai%-1%" . $id . "%" . $this->getCoins() . "%");
- }
- public function timerKick($minutes, $from){
- $this->sendPacket("%xt%tk%-1%$minutes%$from%");
- }
- public function kick(){
- $this->sendPacket("%xt%e%-1%5%");
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement