Skip to content

Commit

Permalink
Merge branch 'master' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
TomGrobbe committed Sep 6, 2019
2 parents 2f1a080 + acd5cbc commit 22b26de
Show file tree
Hide file tree
Showing 20 changed files with 1,093 additions and 866 deletions.
20 changes: 2 additions & 18 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,7 @@ Tom Grobbe - https://www.vespura.com/

Copyright © 2017-2019

-----

THIS PROJECT USES A CUSTOM LICENSE. MAKE SURE TO READ IT BEFORE THINKING ABOUT DOING ANYTHING WITH VMENU.

-----

- YOU ARE ALLOWED TO USE VMENU ON AS MANY SERVERS AS YOU WANT.
- _YOU ARE ALSO ALLOWED TO EDIT THIS RESOURCE TO ADD/CHANGE/REMOVE WHATEVER YOU WANT._ (see the exception to this rule in the "credits" section below)
- **YOU ARE HOWEVER _NOT_ ALLOWED TO RE-RELEASE (EDITED OR NON-EDITED) VERSIONS OF THIS RESOURCE WITHOUT WRITTEN PERMISSIONS BY MYSELF (TOM GROBBE / VESPURA). FOR ADDED FEATURES/CHANGES, FEEL FREE TO CREATE A FORK & CREATE A PULL REQUEST.**

----

**Credits**

Never should you change the credits (for example in the in-game menu's about section) to claim this menu to be your own. 90% of the users will recognize this menu as being vMenu, so changing the name of it and removing the credits section, is just useless. You're just being extremely rude and nodoby likes you anymore if they find out you're a big fat liar.

-----

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
You can use and edit this code to your liking. However don't ever claim it to be your own code and always provide proper credit.
I will, however, not help you if you want to modify my code.
19 changes: 3 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,7 @@ Tom Grobbe - https://www.vespura.com/

Copyright © 2017-2019

----

THIS PROJECT USES A CUSTOM LICENSE. MAKE SURE TO READ IT BEFORE THINKING ABOUT DOING ANYTHING WITH VMENU.


- YOU ARE ALLOWED TO USE VMENU ON AS MANY SERVERS AS YOU WANT.
- _YOU ARE ALSO ALLOWED TO EDIT THIS RESOURCE TO ADD/CHANGE/REMOVE WHATEVER YOU WANT._ (see the exception to this rule in the "credits" section below)
- **YOU ARE HOWEVER _NOT_ ALLOWED TO RE-RELEASE (EDITED OR NON-EDITED) VERSIONS OF THIS RESOURCE WITHOUT WRITTEN PERMISSIONS BY MYSELF (TOM GROBBE / VESPURA). FOR ADDED FEATURES/CHANGES, FEEL FREE TO CREATE A FORK & CREATE A PULL REQUEST.**


**Credits**

Never should you change the credits (for example in the in-game menu's about section) to claim this menu to be your own. 90% of the users will recognize this menu as being vMenu, so changing the name of it and removing the credits section, is just useless. You're just being extremely rude and nodoby likes you anymore if they find out you're a big fat liar.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You can use and edit this code to your liking. However don't ever claim it to be your own code and always provide proper credit.
I will, however, not help you if you want to modify my code.
Binary file modified dependencies/client/MenuAPI.dll
Binary file not shown.
42 changes: 30 additions & 12 deletions vMenu/CommonFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1982,11 +1982,19 @@ public static async Task SetPlayerSkin(uint modelHash, PedInfo pedCustomizationO
Vehicle veh = Game.PlayerPed.CurrentVehicle;
VehicleSeat seat = Game.PlayerPed.SeatIndex;

int lastArmorValue = Game.PlayerPed.Armor;
int maxHealth = Game.PlayerPed.MaxHealth;
int maxArmour = Game.Player.MaxArmor;
int health = Game.PlayerPed.Health;
int armour = Game.PlayerPed.Armor;

// set the model
SetPlayerModel(Game.Player.Handle, modelHash);

Game.Player.MaxArmor = maxArmour;
Game.PlayerPed.MaxHealth = maxHealth;
Game.PlayerPed.Health = health;
Game.PlayerPed.Armor = armour;

// warp ped into vehicle if the player was in a vehicle.
if (wasInVehicle && veh != null && seat != VehicleSeat.None)
{
Expand All @@ -2005,9 +2013,6 @@ public static async Task SetPlayerSkin(uint modelHash, PedInfo pedCustomizationO
}
FreezeEntityPosition(Game.PlayerPed.Handle, false);
}

// restore armor.
Game.PlayerPed.Armor = lastArmorValue;
}

// Reset some stuff.
Expand Down Expand Up @@ -2508,7 +2513,7 @@ public static async Task SpawnWeaponLoadoutAsync(string saveName, bool appendWea
if (ignoreSettingsAndPerms || IsAllowed(w.Perm))
{
// Give the weapon
GiveWeaponToPed(Game.PlayerPed.Handle, w.Hash, w.CurrentAmmo > 0 ? w.CurrentAmmo : w.GetMaxAmmo, false, true);
GiveWeaponToPed(Game.PlayerPed.Handle, w.Hash, w.CurrentAmmo > -1 ? w.CurrentAmmo: w.GetMaxAmmo, false, false);

// Add components
if (w.Components.Count > 0)
Expand Down Expand Up @@ -2537,12 +2542,28 @@ public static async Task SpawnWeaponLoadoutAsync(string saveName, bool appendWea

if (w.CurrentAmmo > 0)
{
while (GetAmmoInPedWeapon(Game.PlayerPed.Handle, w.Hash) < 1)
int ammo = w.CurrentAmmo;
if (w.CurrentAmmo > w.GetMaxAmmo)
{
await Delay(0);
AddAmmoToPed(Game.PlayerPed.Handle, w.Hash, w.CurrentAmmo);
SetAmmoInClip(Game.PlayerPed.Handle, w.Hash, w.AmmoInClip);
ammo = w.GetMaxAmmo;
}
var doIt = false;
while (GetAmmoInPedWeapon(Game.PlayerPed.Handle, w.Hash) != ammo && w.CurrentAmmo != -1)
{
if (doIt)
{
SetCurrentPedWeapon(Game.PlayerPed.Handle, w.Hash, true);
}
doIt = true;
int ammoInClip = GetMaxAmmoInClip(Game.PlayerPed.Handle, w.Hash, false);
if (ammoInClip > ammo)
{
ammoInClip = ammo;
}
SetAmmoInClip(Game.PlayerPed.Handle, w.Hash, ammoInClip);
SetPedAmmo(Game.PlayerPed.Handle, w.Hash, ammo > -1 ? ammo : w.GetMaxAmmo);
Log($"waiting for ammo in {w.Name}");
await Delay(0);
}
}
}
Expand Down Expand Up @@ -2588,9 +2609,6 @@ public static bool SaveWeaponLoadout(string saveName)
};

weapon.CurrentAmmo = GetAmmoInPedWeapon(Game.PlayerPed.Handle, vw.Hash);
var ammoInClip = 0;
GetAmmoInClip(Game.PlayerPed.Handle, vw.Hash, ref ammoInClip);
weapon.AmmoInClip = ammoInClip;


// Check for and add components if applicable.
Expand Down
1 change: 0 additions & 1 deletion vMenu/EventManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@ bool IsTimeDifferenceTooSmall()
{
if (!DontDoTimeSyncRightNow)
{
bool frozen = freezeTime;
DontDoTimeSyncRightNow = true;
EventManager.freezeTime = false;

Expand Down
Loading

0 comments on commit 22b26de

Please sign in to comment.