public void LoadCharacterClothesEvent(Client player) { // Initialize player clothes Customization.SetDefaultClothes(player); // Generate player's clothes Customization.ApplyPlayerClothes(player); }
public void DutyCommand(Client player) { // We get the sex, job and faction from the player int playerSex = player.GetData(EntityData.PLAYER_SEX); int playerJob = player.GetData(EntityData.PLAYER_JOB); int playerFaction = player.GetData(EntityData.PLAYER_FACTION); if (player.GetSharedData(EntityData.PLAYER_KILLED) != 0) { player.SendChatMessage(Constants.COLOR_ERROR + ErrRes.player_is_dead); } else if (playerJob == 0 && playerFaction == 0) { player.SendChatMessage(Constants.COLOR_ERROR + ErrRes.player_no_job); } else if (!IsPlayerOnWorkPlace(player)) { player.SendChatMessage(Constants.COLOR_ERROR + ErrRes.not_in_work_place); } else if (player.GetData(EntityData.PLAYER_ON_DUTY) == 1) { // Initialize player clothes Customization.SetDefaultClothes(player); // Populate player's clothes Customization.ApplyPlayerClothes(player); // We set the player off duty player.SetData(EntityData.PLAYER_ON_DUTY, 0); // Notification sent to the player player.SendNotification(InfoRes.player_free_time); } else { // Dress the player with the uniform foreach (UniformModel uniform in Constants.UNIFORM_LIST) { if (uniform.type == 0 && uniform.factionJob == playerFaction && playerSex == uniform.characterSex) { player.SetClothes(uniform.uniformSlot, uniform.uniformDrawable, uniform.uniformTexture); } else if (uniform.type == 1 && uniform.factionJob == playerJob && playerSex == uniform.characterSex) { player.SetClothes(uniform.uniformSlot, uniform.uniformDrawable, uniform.uniformTexture); } } // We set the player on duty player.SetData(EntityData.PLAYER_ON_DUTY, 1); // Notification sent to the player player.SendNotification(InfoRes.player_on_duty); } }
public void DutyCommand(Client player) { // We get the sex, job and faction from the player int playerSex = player.GetData(EntityData.PLAYER_SEX); int playerJob = player.GetData(EntityData.PLAYER_JOB); int playerFaction = player.GetData(EntityData.PLAYER_FACTION); if (player.GetData(EntityData.PLAYER_KILLED) != 0) { player.SendChatMessage(Constants.COLOR_ERROR + Messages.ERR_PLAYER_IS_DEAD); } else if (playerJob == 0 && playerFaction == 0) { player.SendChatMessage(Constants.COLOR_ERROR + Messages.ERR_PLAYER_NO_JOB); } else if (player.GetData(EntityData.PLAYER_ON_DUTY) == 1) { // Populate player's clothes Customization.ApplyPlayerClothes(player); // We set the player off duty player.SetData(EntityData.PLAYER_ON_DUTY, 0); // Notification sent to the player player.SendNotification(Messages.INF_PLAYER_FREE_TIME); } else { // Dress the player with the uniform foreach (UniformModel uniform in Constants.UNIFORM_LIST) { if (uniform.type == 0 && uniform.factionJob == playerFaction && playerSex == uniform.characterSex) { player.SetClothes(uniform.uniformSlot, uniform.uniformDrawable, uniform.uniformTexture); } else if (uniform.type == 1 && uniform.factionJob == playerJob && playerSex == uniform.characterSex) { player.SetClothes(uniform.uniformSlot, uniform.uniformDrawable, uniform.uniformTexture); } } // We set the player on duty player.SetData(EntityData.PLAYER_ON_DUTY, 1); // Notification sent to the player player.SendNotification(Messages.INF_PLAYER_ON_DUTY); } }
public static void OnCharSelected(Client player, string characterName) { NAPI.Task.Run(() => { CharacterModel characterModel = Database.Database.LoadCharacterByName(characterName, player.Name, player.Address); SkinModel skinModel = Database.Database.GetCharacterSkin(characterModel.id); List <ClothesModel> clothesModel = Database.Database.GetCharacterClothes(characterModel.id); NAPI.Util.ConsoleOutput(characterName + " вошел на сервер."); LoadCharacterData(player, characterModel); NAPI.Player.SetPlayerNametag(player, characterName); NAPI.Util.ConsoleOutput("{0}", characterModel.sex); NAPI.Player.SetPlayerSkin(player, characterModel.sex == 0 ? PedHash.FreemodeMale01 : PedHash.FreemodeFemale01); // Устанавливаем внешний вид игроку (в том числе и волосы). Customization.ApplyPlayerCustomization(player, skinModel, characterModel.sex); // Устанавливаем одежду игроку. Customization.ApplyPlayerClothes(player, clothesModel); }); //player.TriggerEvent("destroyBrowser"); player.TriggerEvent("keyListener"); }
public void LoadCharacterClothesEvent(Client player) { // Generate player's clothes Customization.ApplyPlayerClothes(player); }