Weapon::getWeaponClipSize: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
(yay)
Line 1: Line 1:
// Returns the size of the default weapon component clip.<br><br>Use it like this:<br><br>char cClipSize[32];<br>Hash cur;<br>if (WEAPON::GET_CURRENT_PED_WEAPON(playerPed, &amp;cur, 1))<br>{<br>    if (WEAPON::IS_WEAPON_VALID(cur))<br>    {<br>        int iClipSize = WEAPON::GET_WEAPON_CLIP_SIZE(cur);<br>        sprintf_s(cClipSize, 'ClipSize: %.d', iClipSize);<br>        vDrawString(cClipSize, 0.5f, 0.5f);<br>    }<br>}<br>
// Returns the size of the default weapon component clip.<br><br>Use it like this:<br><br>char cClipSize[32];<br>Hash cur;<br>if (WEAPON::GET_CURRENT_PED_WEAPON(playerPed, &amp;cur, 1))<br>{<br>    if (WEAPON::IS_WEAPON_VALID(cur))<br>    {<br>        int iClipSize = WEAPON::GET_WEAPON_CLIP_SIZE(cur);<br>        sprintf_s(cClipSize, 'ClipSize: %.d', iClipSize);<br>        vDrawString(cClipSize, 0.5f, 0.5f);<br>    }<br>}<br>
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">weapon.getWeaponClipSize(weaponHash);</syntaxhighlight>
<syntaxhighlight lang="javascript">mp.game.weapon.getWeaponClipSize(weaponHash);</syntaxhighlight>
=== Required Arguments ===
=== Required Arguments ===
*'''weaponHash:''' Model hash or name
*'''weaponHash:''' Model hash or name
Line 8: Line 8:
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
todo
// todo
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Weapon_function_c}}
{{Weapon_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Revision as of 21:35, 6 May 2017

// Returns the size of the default weapon component clip.

Use it like this:

char cClipSize[32];
Hash cur;
if (WEAPON::GET_CURRENT_PED_WEAPON(playerPed, &cur, 1))
{
if (WEAPON::IS_WEAPON_VALID(cur))
{
int iClipSize = WEAPON::GET_WEAPON_CLIP_SIZE(cur);
sprintf_s(cClipSize, 'ClipSize: %.d', iClipSize);
vDrawString(cClipSize, 0.5f, 0.5f);
}
}

Syntax

mp.game.weapon.getWeaponClipSize(weaponHash);

Required Arguments

  • weaponHash: Model hash or name

Return value

  • int

Example

// todo

See also