Squirrel/Client/Functions/Players/RemoveLimb

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
(Example)
Line 28: Line 28:
 
</code>
 
</code>
  
[[Or]]
+
=== Notes ===
  
function onClientShot( pPlayer, iWeapon, iBodypart )
+
The function [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] and event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] were used in this example. More info about them in the corresponding pages.
{
+
if ( g_LocalPlayer.Immune == true )
+
{
+
if ( iWeapon == WEP_EXPLOSION )
+
  {
+
          g_LocalPlayer.RemoveLimb( BODYPART_LEFTARM );
+
  g_LocalPlayer.RemoveLimb( BODYPART_RIGHTARM );
+
          g_LocalPlayer.RemoveLimb( BODYPART_LEFTLEG );
+
  g_LocalPlayer.RemoveLimb( BODYPART_HEAD );
+
          g_LocalPlayer.RemoveLimb( BODYPART_RIGHTLEG );
+
  }
+
}
+
+
return 1;
+
}
+
</code>
+

Revision as of 13:51, 10 August 2013

This function allows you to remove one of the client's limbs.

Syntax

  1. g_LocalPlayer.RemoveLimb( int Bodypart )

Example

  1.  
  2. g_LocalPlayer <- FindLocalPlayer();
  3.  
  4. function onClientShot( pPlayer, iWeapon, iBodypart )
  5. {
  6. if ( g_LocalPlayer.Immune == true )
  7. {
  8. if ( iWeapon == WEP_EXPLOSION )
  9. {
  10. g_LocalPlayer.RemoveLimb( BODYPART_LEFTARM );
  11. g_LocalPlayer.RemoveLimb( BODYPART_RIGHTARM );
  12. g_LocalPlayer.RemoveLimb( BODYPART_LEFTLEG );
  13. g_LocalPlayer.RemoveLimb( BODYPART_HEAD );
  14. g_LocalPlayer.RemoveLimb( BODYPART_RIGHTLEG );
  15. }
  16. }
  17. return 1;
  18. }
  19.  

Notes

The function MessagePlayer and event onPlayerCommand were used in this example. More info about them in the corresponding pages.

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox