Page 5 of 13 FirstFirst ... 3 4 5 6 7 ... LastLast
Results 41 to 50 of 125

Thread: TEMPTii's help thread

  1. #41
    Senior Member TEMPTii's Avatar
    Join Date
    Aug 2009
    Location
    Colorado Springs, CO
    Posts
    155

    Ingame Scripting

    So I was experimenting with some of the commands dealing with units, players for that matter. I turned on devmode when I was hosting a server with 4 people. I wanted to do unit_kill_silent and choose a player to kill, I used the following code.

    Code:
    unit_kill_silent (unit (list_get (players) 2))
    This should have killed the second player right? The second player that was returned in the sv_players command? If not, how do I make it so I can choose which player to kill?
    Reply With Quote

  2. #42
    Senior Member
    Join Date
    Nov 2007
    Posts
    2,571

    Re: Ingame Scripting

    Actually it'd kill the third.

    It starts from 0.
    Reply With Quote

  3. #43
    Senior Member TEMPTii's Avatar
    Join Date
    Aug 2009
    Location
    Colorado Springs, CO
    Posts
    155

    Re: Ingame Scripting

    Damn arrays

    It worked for the first person. He was ID#2 so I unit_killed ID1 and it killed him. But when I set it to unit_kill 2 it killed me instead of the 3rd guy.
    Reply With Quote

  4. #44
    Chris chrisk123999's Avatar
    Join Date
    May 2009
    Location
    Florida, USA
    Posts
    646

    Re: Ingame Scripting

    It doesn't go by player index. If goes by the latest spawned. That's why scripting MP is hard. The number for a player changes all the time.
    Reply With Quote

  5. #45
    chilango Con's Avatar
    Join Date
    Aug 2006
    Location
    Victoria, BC, Canada
    Posts
    8,397

    Re: Ingame Scripting

    What always works for me is to bring up sv_players and count from the bottom of the list at 0 up to the player you want.
    Reply With Quote

  6. #46

    Re: Ingame Scripting

    Quote Originally Posted by Con View Post
    What always works for me is to bring up sv_players and count from the bottom of the list at 0 up to the player you want.
    This but only counting the players that are alive, which is why it 'changes'.
    Reply With Quote

  7. #47
    Neanderthal Dwood's Avatar
    Join Date
    Sep 2008
    Location
    Wouldn't u like to know?
    Posts
    4,186

    Re: Ingame Scripting

    Someone, quick make something that tracks that in os.
    Last edited by Dwood; March 8th, 2010 at 09:10 PM.
    Reply With Quote

  8. #48
    Untruely Bannable~ Inferno's Avatar
    Join Date
    Aug 2007
    Location
    In a Place
    Posts
    5,166

    Re: Ingame Scripting

    I'm pretty sure that shadow spartan tried to and it didn't work.
    I tested something like that while he was still working in OS.
    Reply With Quote

  9. #49
    Sarcastic Bitch
    Join Date
    Sep 2006
    Posts
    811

    Re: Ingame Scripting

    Quote Originally Posted by Inferno View Post
    I'm pretty sure that shadow spartan tried to and it didn't work.
    I tested something like that while he was still working in OS.
    That was something totally different.
    Reply With Quote

  10. #50
    Untruely Bannable~ Inferno's Avatar
    Join Date
    Aug 2007
    Location
    In a Place
    Posts
    5,166

    Re: Ingame Scripting

    You were trying to identify players by there key hash or something right?
    Reply With Quote

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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