mirror of
https://github.com/Resxt/Plutonium-T6-Scripts.git
synced 2025-04-19 13:42:54 +00:00
chat_command_give 1.0.1
Fixed weapon not given to the proper player in some scenarios Fixed player not switching to the weapon automatically in some scenarios Fixed multiple attachments not working
This commit is contained in:
parent
a4a714da47
commit
384b32f33a
@ -40,7 +40,19 @@ GivePlayerWeapon(targetedPlayerName, weaponName, camoIndex, takeCurrentWeapon, p
|
||||
weaponName = ToLower(weaponName);
|
||||
weaponSplitted = StrTok(weaponName, "+");
|
||||
weaponName = weaponSplitted[0];
|
||||
attachments = weaponSplitted[1];
|
||||
attachments = "";
|
||||
|
||||
for (i = 1; i < weaponSplitted.size; i++)
|
||||
{
|
||||
if (i == 1)
|
||||
{
|
||||
attachments += weaponSplitted[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
attachments += "+" + weaponSplitted[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (IsMultiplayerMode())
|
||||
{
|
||||
@ -67,7 +79,12 @@ GivePlayerWeapon(targetedPlayerName, weaponName, camoIndex, takeCurrentWeapon, p
|
||||
player TakeWeapon(player GetCurrentWeapon());
|
||||
}
|
||||
|
||||
DoGiveWeapon(weaponName, attachments, finalCamoIndex);
|
||||
if (IsDefined(attachments))
|
||||
{
|
||||
weaponName = weaponName + "+" + attachments;
|
||||
}
|
||||
|
||||
player GiveWeapon(weaponName, 0, finalCamoIndex);
|
||||
|
||||
if (IsDefined(playSwitchAnimation) && playSwitchAnimation)
|
||||
{
|
||||
@ -78,18 +95,3 @@ GivePlayerWeapon(targetedPlayerName, weaponName, camoIndex, takeCurrentWeapon, p
|
||||
player SetSpawnWeapon(weaponName);
|
||||
}
|
||||
}
|
||||
|
||||
DoGiveWeapon(weaponCodeName, attachments, camoIndex)
|
||||
{
|
||||
if (IsDefined(attachments) && attachments != "")
|
||||
{
|
||||
weaponCodeName = weaponCodeName+ "+" + attachments;
|
||||
}
|
||||
|
||||
if (!IsDefined(camoIndex))
|
||||
{
|
||||
camoIndex = 0;
|
||||
}
|
||||
|
||||
self GiveWeapon(weaponCodeName, 0, camoIndex);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user