示例#1
0
 private void API_onPlayerDeath(GrandTheftMultiplayer.Server.Elements.Client player, GrandTheftMultiplayer.Shared.NetHandle entityKiller, int weapon)
 {
     API.setEntityData(player, "Hunger", GetPlayerHunger(player) + 5);
     API.setEntityData(player, "Thirsty", GetPlayerThirsty(player) + 5);
     Clients.ClientManager.UpdateHungerAndThirsty(player, GetPlayerHunger(player), GetPlayerThirsty(player));
 }
示例#2
0
 private void API_onEntityEnterColShape(GrandTheftMultiplayer.Server.Managers.ColShape colshape, GrandTheftMultiplayer.Shared.NetHandle entity)
 {
     if (API.hasEntityData(entity, JOB_ON) && Convert.ToInt32(API.getEntityData(entity, "JobId")) == 2)
     {
         Client sender = db_Accounts.GetPlayerById(API.getEntityData(entity, "ID"));
         if (sender.isInVehicle && API.getEntityData(sender, "ID") == API.getEntityData(sender.vehicle, JOB_VEHICLE))
         {
             var _Index = db_TirJob.FindTirDeliveryPointIndexById(API.getEntityData(sender, JOB_ON));
             if ((db_TirJob.CurrentDeliveryPoints.Item2[_Index] as ColShape) == colshape)
             {
                 API.triggerClientEvent(sender, "remove_marker");
                 API.setEntityData(sender, JOB_ON, 0);
                 API.setEntityData(sender, JOB_MONEY, db_TirJob.CurrentDeliveryPoints.Item1[_Index].DeliveryPointMoney);
                 API.sendNotificationToPlayer(sender, "Bu teslimattan ~g~$" + db_TirJob.CurrentDeliveryPoints.Item1[_Index].DeliveryPointMoney + " kazandınız. \n Paranızı tırı teslim ettiğinizde alacaksınız.");
                 var returnPoint = Jobs.db_Jobs.currentJobsList.FirstOrDefault(x => x.Item1.JobId == 2).Item1.TakingPosition;
                 API.triggerClientEvent(sender, "create_marker", returnPoint.X, returnPoint.Y, returnPoint.Z - 1);
                 API.sendChatMessageToPlayer(sender, "~y~Teslimatı tamamlamak için yük aldığınız noktaya gidip ~s~((//tir bitir )) ~y~komutunu kullanınız");
             }
         }
         else
         {
             API.sendChatMessageToPlayer(sender, "~r~UYARI: ~s~Bu mesleğe başladığınız trailer değil!");
         }
     }
 }
示例#3
0
        public static void ColshapeOnMap_onEntityEnterColShape(ColShape shape, GrandTheftMultiplayer.Shared.NetHandle entity)
        {
            if (!API.shared.hasEntityData(entity, "ID"))
            {
                return;
            }
            var _player     = (Client)db_Accounts.FindPlayerById(API.shared.getEntityData(entity, "ID"));
            var _shapeIndex = db_LicensePoints.currentVehLicenseCheckpoints.Items.IndexOf(db_LicensePoints.currentVehLicenseCheckpoints.Items.FirstOrDefault(x => x.ColshapeOnMap == (CylinderColShape)shape));

            API.shared.consoleOutput("shape ındex: " + _shapeIndex);
            if (_shapeIndex >= 0)
            {
                if (API.shared.getEntityData(_player, ON_LICENSE_EXAM) == _shapeIndex)
                {
                    if (API.shared.getEntityData(_player.vehicle, ON_LICENSE_EXAM_OWNER) != API.shared.getEntityData(_player, "ID"))
                    {
                        API.shared.sendChatMessageToPlayer(_player, "~r~HATA: ~s~Bu sınava başladığınız araba değil."); return;
                    }
                    _shapeIndex++;
                    if (_shapeIndex < db_LicensePoints.currentVehLicenseCheckpoints.Items.Count)
                    {
                        // SONRAKI CHECKPOINT
                        Clients.ClientManager.RemoveBlip(_player);
                        var pos = db_LicensePoints.currentVehLicenseCheckpoints.Items[_shapeIndex].Position;
                        Clients.ClientManager.ShowBlip(_player, pos.X, pos.Y, pos.Z);
                        API.shared.setEntityData(_player, ON_LICENSE_EXAM, _shapeIndex);
                        return;
                    }
                    else
                    {
                        //SON CHECKPOINT
                        var _vehicle = db_Vehicles.FindNearestVehicle(_player.position);
                        Clients.ClientManager.RemoveBlip(_player);

                        if (_player.vehicle.health == 1000)
                        {
                            if (_player.seatbelt)
                            {
                                int itemId = db_Items.GameItems.Values.FirstOrDefault(f => f.Type == ItemType.License && f.Value_0 == "0").ID;
                                API.shared.resetEntityData(_player, ON_LICENSE_EXAM);
                                API.shared.resetEntityData(_player.vehicle, ON_LICENSE_EXAM_OWNER);
                                if (InventoryManager.AddItemToPlayerInventory(_player, new Models.ClientItem
                                {
                                    Count = 1,
                                    Equipped = false,
                                    SpecifiedValue = _player.socialClubName,
                                    ItemId = itemId
                                }))
                                {
                                    API.shared.sendChatMessageToPlayer(_player, "~y~Ehliyetiniz envanterinize eklendi.");
                                }
                                else
                                {
                                    API.shared.sendChatMessageToPlayer(_player, "~r~HATA: ~s~Envanterinizde yeterli yer yok.");
                                    db_Items.DropItem(new Models.ClientItem {
                                        Count = 1, Equipped = false, ItemId = itemId, SpecifiedValue = _player.socialClubName
                                    }, _player);
                                }
                                db_Vehicles.Respawn(_vehicle.VehicleId);
                            }
                            else
                            {
                                API.shared.sendChatMessageToPlayer(_player, "~r~UYARI: ~s~Emniyet kemeriniz takılı olmadığı için sınavı geçemediniz.");
                                db_Vehicles.Respawn(_vehicle.VehicleId);
                            }
                        }
                        else
                        {
                            API.shared.sendChatMessageToPlayer(_player, "~r~UYARI: ~s~Sınav aracı hasar aldığından dolayı sınavı geçemediniz.");
                            db_Vehicles.Respawn(_vehicle.VehicleId);
                        }
                    }
                }
            }
            else
            {
                API.shared.consoleOutput("Ehliyette colshape index bulunamadı.");
            }
        }
示例#4
0
 private static void ColshapeOnMap_onEntityEnterColShape(GrandTheftMultiplayer.Server.Managers.ColShape shape, GrandTheftMultiplayer.Shared.NetHandle entity)
 {
     //API.shared.consoleOutput("triggered");
     Managers.LicenseManager.ColshapeOnMap_onEntityEnterColShape(shape, entity);
 }