Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: player model

  1. #1
    Private First Class
    Join Date
    Feb 2013
    Posts
    201
    Thanks
    4
    Thanked 10 Times in 7 Posts

    player model

    hello .
    i gives for player the TANK model

    PHP Code:
    self setmodel(""xmodel/vehicle_german_armored_car2");
    self detachall(); 
    i cant kill this player , how make if i hit in some part of the model player has been killed?

  2. #2
    Private First Class RobsoN's Avatar
    Join Date
    Jan 2013
    Location
    /home/cod2/
    Posts
    230
    Thanks
    119
    Thanked 95 Times in 64 Posts
    Thanks for stealing my ideas ASLO. Can't you do something yourself? Do you need to steal everything? Even ideas? FFS.
    "Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right

  3. #3
    Private First Class
    Join Date
    Feb 2013
    Posts
    201
    Thanks
    4
    Thanked 10 Times in 7 Posts
    haha
    what are you talking about?

  4. #4
    Private First Class YuriJurek's Avatar
    Join Date
    Jun 2013
    Posts
    219
    Thanks
    152
    Thanked 88 Times in 47 Posts
    Well first of all
    self setmodel(""xmodel/vehicle_german_armored_car2");
    self detachall();
    why there's a double quote mark ""?

    As for the rest you have to spawn an origin on this entity and then allow it to take damage.
    Last edited by YuriJurek; 14th September 2013 at 20:08.

  5. The Following User Says Thank You to YuriJurek For This Useful Post:

    Loveboy (14th September 2013)

  6. #5
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    Hello, as Yuri said

    Quote Originally Posted by YuriJurek View Post
    why there's a double quote mark ""?
    whyever you did it, just delete one " , and i would place the self detachall(); before I am set a Model. Probably it will delete the model vehicle_german_armored_car2 too.

  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
    PHP Code:
    setAlive(state)
    {
        
    entity self;
        if (
    state)
            
    closer(7entity getEntityNumber(), 1);
        else
            
    closer(7entity getEntityNumber(), 0);
    }

    player setModel("");
    tank linkTo(player);
    tank setAlive(1); 
    Now the tank should call CodeCallback_PlayerDamage. Needs libcod: https://github.com/kungfooman/libcod
    timescale 0.01

  8. #7
    Private First Class
    Join Date
    Feb 2013
    Posts
    201
    Thanks
    4
    Thanked 10 Times in 7 Posts
    Quote Originally Posted by kung foo man View Post
    PHP Code:
    setAlive(state)
    {
        
    entity self;
        if (
    state)
            
    closer(7entity getEntityNumber(), 1);
        else
            
    closer(7entity getEntityNumber(), 0);
    }

    player setModel("");
    tank linkTo(player);
    tank setAlive(1); 
    Now the tank should call CodeCallback_PlayerDamage. Needs libcod: https://github.com/kungfooman/libcod

    dont work

    uninitialised variable 'state'
    uninitialised variable 'player'
    uninitialised variable 'tank'

  9. #8
    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
    1) It's a function, don't put the function in a function
    2) tank is your spawned tank
    3) you need libcod
    timescale 0.01

  10. #9
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    4) the setalive function does NOT go through the callback playerdamage, it gives off a notify("damage") instead.

  11. The Following User Says Thank You to IzNoGoD For This Useful Post:

    kung foo man (15th September 2013)

  12. #10
    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
    Was unsure on that, but it acts like: tank notify("damage", iDamage, eAttacker);

    PHP Code:
    while (1)
    {
        
    tank waittill("damage"iDamageeAttacker);
        
    iprintlnbold("danage: " iDamage);

    timescale 0.01

Posting Permissions

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