Results 1 to 7 of 7

Thread: Spawn on map (Toujane)

  1. #1
    Private Invictus's Avatar
    Join Date
    Mar 2013
    Location
    Poland
    Posts
    32
    Thanks
    25
    Thanked 13 Times in 6 Posts

    Exclamation Spawn on map (Toujane)

    Hi there. I have a problem with spawn "teddy bear" Here is the code.
    HTML Code:
    main()
    {
        teddy = getent("script_model");
        teddy setHintString("Press F to buy teddy");
        teddy = spawn("script_model", (174, -310, 16));
        teddy.angles = (0, 57, 0);
        teddy setmodel("xmodel/prop_bear_detail_sitting");
    }
    In menus.gsc I load the model teddy bear

    HTML Code:
    precacheModel("xmodel/prop_bear_detail_sitting");
    Teddy don't spawn. I don't now where is problem.

  2. #2
    Private Invictus's Avatar
    Join Date
    Mar 2013
    Location
    Poland
    Posts
    32
    Thanks
    25
    Thanked 13 Times in 6 Posts
    Ok. Teddy Spawn But i don't see "Press F to buy teddy".

  3. #3
    Private First Class Earliboy's Avatar
    Join Date
    Nov 2012
    Location
    Germany
    Posts
    130
    Thanks
    5
    Thanked 88 Times in 61 Posts
    Add under the "precacheModel"
    Code:
    precacheString(&"Press F to buy teddy");
    Then just add at the HintString
    Code:
    teddy setHintString(&"Press F to buy teddy");
    No ... No ... this is not possible .......

  4. The Following User Says Thank You to Earliboy For This Useful Post:

    Invictus (10th March 2013)

  5. #4
    Private First Class Earliboy's Avatar
    Join Date
    Nov 2012
    Location
    Germany
    Posts
    130
    Thanks
    5
    Thanked 88 Times in 61 Posts
    You also can use [[{USE}]] (if i´m right, may it was {{[use]}} but i´m not sure, that will show the button where Use is bind on)
    No ... No ... this is not possible .......

  6. #5
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Quote Originally Posted by Earliboy View Post
    You also can use [[{USE}]] (if i´m right, may it was {{[use]}} but i´m not sure, that will show the button where Use is bind on)
    Yes u are right [[{+use}]] should do the job

  7. #6
    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
    setHintString() doesnt work on spawned entities. So you need to do it manual:

    PHP Code:
    displayHintString(hintstringentity)
    {
        
    player self;

        if ( ! 
    isDefined(player))
            return;

        if ( ! 
    isDefined(hintstring))
            return;

        if (
    isdefined(player.hintstring))
            return;

        
    player.hintstring newClientHudElem(player);
        
    player.hintstring.horzAlign "fullscreen";
        
    player.hintstring.vertAlign "fullscreen";
        
    player.hintstring.alignX "center";
        
    player.hintstring.alignY "middle";
        
    player.hintstring.320// 640
        
    player.hintstring.300// 480
        
    player.hintstring.fontScale 1.6// 1.1
        
    player.hintstring.alpha 1// zero to one
        
    player.hintstring setText(hintstring);

        
    player thread deleteHintString(entity);
    }

    deleteHintString(entity)
    {
        
    player self;

        while (
    isdefined(player) && isdefined(player.hintstring))
        {
            if (
    player isTouching(entity.trigger))
            {
                
    wait 0.10;
                continue;
            }

            
    player.hintstring destroy();
        }

    timescale 0.01

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

    Invictus (10th March 2013)

  9. #7
    Private Invictus's Avatar
    Join Date
    Mar 2013
    Location
    Poland
    Posts
    32
    Thanks
    25
    Thanked 13 Times in 6 Posts
    Ok. I fix this. I add triger (radius) and string. All works. Thanks for help.

Tags for this Thread

Posting Permissions

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