Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Spray (flat model)

  1. #11
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by RobsoN View Post
    Ofc,

    fx spawn code:

    PHP Code:
    self playFx(level.robsonTestEffectself.origin); 
    fx precache:

    PHP Code:
    level.robsonTestEffect loadfx("fx/robson.efx"); 
    Using this code:

    Code:
    self playFX( <nameoffx>, <origin> );
    Will incur a runtime error "unknown function". I don't know the technical name for it, but playFX() is one of those script functions which run independently of any entity - be that a world entity or a player entity. Entities cannot run it; they can only be assigned to it.

    You will need to make a player flag out of it and assign it to the playfx() function like this:

    Code:
    self.test = playfx( <nameoffx>, <origin> );

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

    kung foo man (13th February 2013)

  3. #12
    Private First Class RobsoN's Avatar
    Join Date
    Jan 2013
    Location
    /home/cod2/
    Posts
    230
    Thanks
    119
    Thanked 95 Times in 64 Posts
    Quote Originally Posted by Tally View Post
    Using this code:

    Code:
    self playFX( <nameoffx>, <origin> );
    Will incur a runtime error "unknown function". I don't know the technical name for it, but playFX() is one of those script functions which run independently of any entity - be that a world entity or a player entity. Entities cannot run it; they can only be assigned to it.

    You will need to make a player flag out of it and assign it to the playfx() function like this:

    Code:
    self.test = playfx( <nameoffx>, <origin> );
    I'm sorry, while rewriting the script to this forum I just made ​​a mistake. Normally I have a correctly function without 'self' object.

    To IzNoGod:

    I got same problem with 2 vectors.

    My code:

    PHP Code:
    _spray()
    {
        
    //while( !self useButtonPressed() )
            //wait .2;


        
    angles self getPlayerAngles();
        
    eye self getEye();
        
    forward eye maps\mp\_utility::vectorScaleanglesToForwardangles ), 70 );
        
    trace bulletTraceeyeforwardfalseself );
        
        
    iprintln("fr:"trace["fraction"]);
        
        if( 
    trace["fraction"] == )
        {
            
    iprintln("return");
            return;
        }

        
    position trace["position"] - maps\mp\_utility::vectorScaleanglesToForwardangles ), -);
        
    angles vectorToAngleseye position );
        
    forward anglesToForwardangles );
        
    up anglesToUpangles );

        
    playFxlevel.testfxpositionforwardup );
        
    //self playSound

    This isn't effect problem maybe..?

    Thanks for reply.
    Last edited by RobsoN; 13th February 2013 at 12:20.

Posting Permissions

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