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
No edit summary
No edit summary
 
Line 31: Line 31:


{{Scripting/Squirrel/Functions/Game_Functions}}
{{Scripting/Squirrel/Functions/Game_Functions}}
[[Category:Scripting/Squirrel/Functions/Game_Functions]]

Latest revision as of 18:05, 30 January 2017

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