Results 1 to 3 of 3

Thread: press f

  1. #1
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts

    press f

    hello guys
    if i press f i will get a mp44.. i press but i dont get
    here script

    if(other useButtonPressed())
    {
    mp44_mp = "mp44_mp";
    other takeWeapon(other getCurrentWeapon());
    other giveWeapon(mp44_mp);
    }

    please help me

  2. The Following User Says Thank You to Loveboy For This Useful Post:

    firefox (8th January 2013)

  3. #2
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    It looks correct so far, but can you post the whole code with trigger etc.

    Also use [code][/code] to format source code (+ tabs for indention).
    timescale 0.01

  4. The Following User Says Thank You to kung foo man For This Useful Post:

    firefox (8th January 2013)

  5. #3
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by Loveboy View Post
    hello guys
    if i press f i will get a mp44.. i press but i dont get
    here script

    if(other useButtonPressed())
    {
    mp44_mp = "mp44_mp";
    other takeWeapon(other getCurrentWeapon());
    other giveWeapon(mp44_mp);
    }

    please help me
    Unless "other" is specifically defined as the player entity, always use "self" as the player entity:

    Code:
    	if( self useButtonPressed() )
    	{
    		self takeWeapon( self getCurrentWeapon() );
    		self giveWeapon( "mp44_mp" );
    		self setWeaponSlotWeapon( "primary", "mp44_mp" );
    		self giveMaxAmmo( "mp44_mp" );
    		self switchtoWeapon( "mp44_mp" );
    	}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •