Thread: [Weapon] Get Keyvalue from player using weapon

Results 1 to 7 of 7

Hybrid View

  1. #1
    Registered User KneeGrow's Avatar
    Join Date
    May 2013
    Posts
    25

    [Weapon] Get Keyvalue from player using weapon

    The weapon I'm trying to create needs its secondary fire to change a player's keyvalue ('effects'), only I don't know how to do get or set a keyvalue.
    I know what keyvalue I want to change but I don't know how to access it.

    From CBasePlayer section in the angelscript documentation:
    Code:
    void KeyValue(KeyValueData@)
    Sets keyvalue data on this entity
    What is KeyValueData@ ?

  2. #2
    Registered User
    Join Date
    Jul 2016
    Posts
    32

    Re: [Weapon] Get Keyvalue from player using weapon

    Code:
    player.pev.effects

  3. #3
    Registered User KneeGrow's Avatar
    Join Date
    May 2013
    Posts
    25

    Re: [Weapon] Get Keyvalue from player using weapon

    is that an integer value?

  4. #4
    200 MB Angelscript log file KernCore's Avatar
    Join Date
    Apr 2016
    Location
    Brazil
    Posts
    269

    Re: [Weapon] Get Keyvalue from player using weapon

    Quote Originally Posted by KneeGrow View Post
    is that an integer value?
    Yes. Please see: http://samvanheer.github.io/SC_Angel.../entvars_t.htm

    pev.effects uses the EFFECTS enum: http://samvanheer.github.io/SC_Angel...cs/EFFECTS.htm

  5. #5
    Registered User KneeGrow's Avatar
    Join Date
    May 2013
    Posts
    25

    Re: [Weapon] Get Keyvalue from player using weapon

    Thanks

    One last thing, is there a way for the weapon to decrease its clip over time while effects keyvalue is toggled? (making a 'glow stick', but I want to drain the battery like a flashlight)
    Is there a way I can use the player's default flashlight battery? If so, that would be optimal.

  6. #6
    200 MB Angelscript log file KernCore's Avatar
    Join Date
    Apr 2016
    Location
    Brazil
    Posts
    269

    Re: [Weapon] Get Keyvalue from player using weapon

    I'm not sure you can use the flashlight's hook or something like that.
    Maybe Nero's Flashlight Plugin might give you an idea of how to it: http://forums.svencoop.com/showthrea...tom-Flashlight

    If you want to check that, do that in ItemPreFrame() or ItemPostFrame()

  7. #7
    Japanese Wannabe NYO~~~! ゞ(´゜ω゜)つ~☆ Nero's Avatar
    Join Date
    Jul 2002
    Location
    Eskilstuna, Sweden.
    Posts
    579

    Re: [Weapon] Get Keyvalue from player using weapon

    Aye, but you can only add a flashlight battery, not hook into the existing one. (I didn't figure it out anyway ^^) Which is why you can use both the base flashlight and the custom one. And they are on separate batteries with overlapping HUD elements. (can't move them)
    Nero of TSP and Wotnet
    Ingame names: Nero, Horny-Girl-13
    IRC nick: Nero (probably)

Posting Permissions

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