Scripting/Squirrel/Functions/GetWeaponName: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "This function will get the weapon name from a given ID. == Syntax == <pre>GetWeaponName( id )</pre> == Arguments == * ''int'' '''id''' - The ID of the weapon == Return va...")
 
No edit summary
Line 14: Line 14:


== Example ==
== Example ==
 
<source lang=squirrel>
{{Scripting/Needs_Example}}
function onPlayerWeaponChange( player, oldWep, newWep )
{
if(oldWep != newWep)
{
ClientMessage("You changed your Weapon to : "+GetWeaponName(newWep),player,255,255,255);
}
return 1;
}
</source>


=== Notes ===
=== Notes ===
 
Call [[onPlayerWeaponChange]] were used in this example. More info about them in the corresponding pages.


== Related Functions ==
== Related Functions ==


{{Scripting/Squirrel/Functions/Game_Functions}}
{{Scripting/Squirrel/Functions/Game_Functions}}

Revision as of 16:31, 23 April 2016

This function will get the weapon name from a given ID.

Syntax

GetWeaponName( id )

Arguments

  • int id - The ID of the weapon

Return value

  • string name - The name of the weapon

Example

function onPlayerWeaponChange( player, oldWep, newWep )
{
	if(oldWep != newWep)
	{
		ClientMessage("You changed your Weapon to : "+GetWeaponName(newWep),player,255,255,255);	
	}
	return 1;
}

Notes

Call onPlayerWeaponChange were used in this example. More info about them in the corresponding pages.

Related Functions