当前位置: 首页>>代码示例>>PHP>>正文


PHP Messages::SendNear方法代码示例

本文整理汇总了PHP中Messages::SendNear方法的典型用法代码示例。如果您正苦于以下问题:PHP Messages::SendNear方法的具体用法?PHP Messages::SendNear怎么用?PHP Messages::SendNear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Messages的用法示例。


在下文中一共展示了Messages::SendNear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: cmdPay

 public static function cmdPay(Player $player, $numparams, $params)
 {
     if ($target = Core::FindPlayer($player, $params[1])) {
         if ($player->Position()->DistanceTo($target->Position()) > 5) {
             $player->Send(COLOR_TOO_FAR, '[ERROR] Given player is too far');
             return COMMAND_BREAK;
         }
         $amount = (int) $params[2];
         if ($amount > 100000) {
             $player->Send(COLOR_PAYMENT_TOO_HIGH, '[ERROR] You can pay a max of 100,000$');
             return COMMAND_BREAK;
         }
         if (Players::CheckPayment($player, $amount)) {
             $money = Core::FixIntegerDots($amount);
             $player->GiveMoney(-$amount);
             $player->Send(COLOR_YOU_PAY, "* You have given {$money}\$ to {$target->name}");
             $target->GiveMoney($amount);
             $target->Send(COLOR_GET_PAID, "* {$player->name} has given you {$money}\$");
             Messages::SendNear($player, COLOR_ACTION, "{$player->name} takes some money and gives it to {$target->name}");
         }
     }
     return COMMAND_BREAK;
 }
开发者ID:ryden,项目名称:ItalyMafia-3.0,代码行数:23,代码来源:main.php

示例2: cmdUnlockwindows

 public static function cmdUnlockwindows(Player $player, $numparams, $params)
 {
     $vehicle = $player->GetVehicle();
     if ($player->IsDriver() && $vehicle != null && $vehicle->HasRollableWindows()) {
         if ($vehicle->LockedWindows()) {
             $vehicle->LockWindows(false);
             Messages::SendNear($player, COLOR_LOCKING_WINDOWS, "{$player->name} has unlocked the vehicle windows");
         }
     }
     return COMMAND_OK;
 }
开发者ID:ryden,项目名称:ItalyMafia-3.0,代码行数:11,代码来源:main.php

示例3: cookItem

 public static function cookItem(Player $player, $item)
 {
     if ($player->location instanceof House && isset(Houses::$cookitems[$item])) {
         $house = $player->location;
         $room = $house->GetPlayerRoom($player);
         $cook = Houses::$cookitems[$item];
         $fridge = $room->GetFridge();
         if ($fridge < $cook->food) {
             $player->Send(COLOR_HOUSE_NOTENOUGHFOOD, "[ERROR] There is not enough food in your fridge to cook a {$item}");
         } else {
             if (($anim = $player->GetAnimation()) && $anim->stop_data instanceof CookItem) {
                 $player->Send(COLOR_HOUSE_ALREADYCOOKING, "[ERROR] You are already cooking something");
             } else {
                 Messages::SendNear($player, COLOR_ACTION, "{$player->name} is cooking {$cook->name}");
                 $cookanim = clone Houses::$cookanim;
                 $cookanim->steptime = $cook->time;
                 $cookanim->stop_cbk = array('Houses', 'playerCooked');
                 $cookanim->stop_data = $cook;
                 $player->Animate($cookanim);
                 $room->SetFridge($fridge - $cook->food);
             }
         }
     }
 }
开发者ID:ryden,项目名称:ItalyMafia-3.0,代码行数:24,代码来源:main.php


注:本文中的Messages::SendNear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。