Code formatiert
This commit is contained in:
@@ -12,7 +12,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
[RemoteEvent("updateWeaponSelection")]
|
||||
public void UpdateWeaponSelection(Client client, string weaponModel, int slot)
|
||||
{
|
||||
if(weaponModel == "Keine")
|
||||
if (weaponModel == "Keine")
|
||||
{
|
||||
client.RemoveAllWeapons();
|
||||
return;
|
||||
@@ -38,14 +38,14 @@ namespace ReallifeGamemode.Server.Events
|
||||
if (slot == 4)
|
||||
{
|
||||
client.RemoveAllWeapons();
|
||||
client.GiveWeapon(weaponHash, 0);
|
||||
client.GiveWeapon(weaponHash, 0);
|
||||
}
|
||||
}
|
||||
|
||||
[RemoteEvent("cancelWeaponSelection")]
|
||||
public void CancelWeaponSelection(Client client)
|
||||
{
|
||||
client.RemoveAllWeapons();
|
||||
client.RemoveAllWeapons();
|
||||
}
|
||||
|
||||
|
||||
@@ -68,12 +68,12 @@ namespace ReallifeGamemode.Server.Events
|
||||
if (meleeModel.Contains("mk2") && !meleeModel.Contains("_mk2")) meleeModel = meleeModel.Replace("mk2", "_mk2");
|
||||
melee = NAPI.Util.GetHashKey($"weapon_{meleeModel}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
client.GiveWeapon((WeaponHash)primary, 50);
|
||||
client.GiveWeapon((WeaponHash)secondary, 150);
|
||||
client.GiveWeapon((WeaponHash)melee, 1);
|
||||
if(specialModel != "Schutzweste")
|
||||
if (specialModel != "Schutzweste")
|
||||
{
|
||||
client.Armor = 0;
|
||||
if (!uint.TryParse(specialModel, out uint special))
|
||||
@@ -87,8 +87,8 @@ namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
client.Armor = 50;
|
||||
}
|
||||
|
||||
using(var context = new DatabaseContext())
|
||||
|
||||
using (var context = new DatabaseContext())
|
||||
{
|
||||
User user = client.GetUser();
|
||||
FactionWeapon slot1 = context.FactionWeapons.Where(w => w.FactionId == user.FactionId && w.WeaponModel == primaryModel).FirstOrDefault();
|
||||
|
||||
Reference in New Issue
Block a user