Author Topic: Dont Remove Head  (Read 7173 times)

gamelaster

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Dont Remove Head
« on: January 02, 2012, 02:15:38 pm »
Hello, this is code:

function onPlayerCommand( pPlayer, szCmd, szParams )
{
   if( szCmd = "kill" )
   {
      pPlayer.RemoveLimb( BODYPART_HEAD );
      MessagePlayer( "Zabil si sa", pPlayer );
   }
}


What Is bad???
If im type /kill, not send message and dont remove head

Thijn

  • Tester
  • Sr. Member
  • ****
  • Posts: 531
  • Karma: +27/-16
    • View Profile
Re: Dont Remove Head
« Reply #1 on: January 02, 2012, 04:15:48 pm »
You're mixing client scripts with server scripts.

Add this to your client script:
Code: [Select]
pPlayer <- FindLocalPlayer();

function onClientCommand( szCmd, szParams )
{
   if( szCmd == "kill" )
   {
      pPlayer.RemoveLimb( BODYPART_HEAD );
      Message( "Zabil si sa" );
   }
}
« Last Edit: January 03, 2012, 02:54:58 pm by Thijn »

stormeus

  • No-Lifer
  • Developer
  • Full Member
  • *****
  • Posts: 112
  • Karma: +13/-2
    • View Profile
Re: Dont Remove Head
« Reply #2 on: January 02, 2012, 07:18:16 pm »
Use thijn's code and make it szCmd == "kill", with two equal signs.
Quote
Morphine says:
    them LU devs ranting about how LU doesn't have client pickups
    while us VC:MPers don't have client anything
    ;_;

Stormeus Argo says:
    we have client crashes though
    ohohohohoho

Morphine says:
    LU DOESN'T HAVE THAT

Stormeus Argo says:
    LU - 0
    VC:MP - 1

Thijn

  • Tester
  • Sr. Member
  • ****
  • Posts: 531
  • Karma: +27/-16
    • View Profile
Re: Dont Remove Head
« Reply #3 on: January 03, 2012, 02:55:09 pm »
Use thijn's code and make it szCmd == "kill", with two equal signs.
ah right, fixed.

 

© Liberty Unleashed Team.