Search found 569 matches
- Sat Feb 10, 2018 3:13 am
- Forum: API Design
- Topic: Changing returning hooks works + better documentation?
- Replies: 5
- Views: 28047
Re: Changing returning hooks works + better documentation?
You can actually look at return None as of just return If you don't provide any operands to return , the effect will be the same as of returning None. Now, it's just a way of interpreting things, but for me it seems that saying "don't return anything to let the original function execute" i...
- Thu Jan 11, 2018 5:20 pm
- Forum: Plugin Development Support
- Topic: TypedSayCommand after unloading/loading plugin
- Replies: 6
- Views: 7519
Re: TypedSayCommand after unloading/loading plugin
There's a bug in a command manager which causes an issue with similar effects, but that issue is related to chain decorations. You, however, used only one decorator here.
- Sun Dec 17, 2017 2:45 am
- Forum: Plugin Development Support
- Topic: Crash when spawning entities from OnLevelInit
- Replies: 2
- Views: 4314
Re: Crash when spawning entities from OnLevelInit
Hold on a minute, why do you spawn those entities on level init? They'll get wiped out in the next round, unless they're entities like func_brush that don't get reset each round. Why don't you spawn them upon round_start event? Seems more correct way to do that, and it always worked perfectly.
- Tue Dec 12, 2017 2:16 pm
- Forum: Code examples / Cookbook
- Topic: Stripping weapons
- Replies: 45
- Views: 115104
Re: Stripping weapons
Try delaying weapon dropping/removing. @OnButtonStateChanged listener is based on a hook on player's run_command . Removing entities while in a hook can lead to crashes. So try this: weapon.delay(0, weapon.remove) Delaying by 0 seconds doesn't execute immediately. Your callback will still be...
- Wed Dec 06, 2017 9:04 am
- Forum: Plugin Development Support
- Topic: Way to reverse the spawn?
- Replies: 11
- Views: 13169
Re: Way to reverse the spawn?
Well, but if you swapped them, you should also edit your strings, because they have the opposite meaning now.
- Tue Dec 05, 2017 8:42 pm
- Forum: Plugin Development Support
- Topic: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener
- Replies: 19
- Views: 21586
Re: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener
23:35 - inf: mousedx and mousedy dont have any effect on bots either, strange I think this might be a bug in OnPlayerRunCommand listener . According to Ayuto , In CS:GO UserCmd stucture is different from BotCmd. But the listener never makes BotCmd objects, it always makes UserCmd objects, despite i...
- Tue Dec 05, 2017 8:16 pm
- Forum: Plugin Development Support
- Topic: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener
- Replies: 19
- Views: 21586
Re: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener
There's also other stuff in UserCmd, like mouse_dx, mouse_dy (something like that). Try replicating those properties too, because they should probably take part in determining player's view.
- Tue Dec 05, 2017 8:08 pm
- Forum: Plugin Development Support
- Topic: Way to reverse the spawn?
- Replies: 11
- Views: 13169
Re: Way to reverse the spawn?
For one, such hook should actually be split into two separate hooks. One with a EntityCondition for weapon classnames, the other one with EntityCondition.is_player Though it wouldn't make any difference, because you hooked CBaseEntity::StartTouch anyways. It's just that if you expect players to be h...
- Sat Dec 02, 2017 9:01 am
- Forum: Plugin Development Support
- Topic: Push a player to a given point
- Replies: 5
- Views: 6800
Re: Push a player to a given point
Oh yeah, I forgot that it's wrapped now.
- Sat Dec 02, 2017 8:36 am
- Forum: Plugin Development Support
- Topic: Push a player to a given point
- Replies: 5
- Views: 6800
Re: Push a player to a given point
Hey, Kami The main issue here is that your code doesn't push player towards any particular location. Instead it treats your coordinates as a vector to add to the player velocity. See, if you use type pushto 2 0 0 1000 (2 is my userid), your code will just add the vector (0, 0, 1000) to player's curr...
- Fri Dec 01, 2017 3:46 pm
- Forum: Plugin Development Support
- Topic: Way to reverse the spawn?
- Replies: 11
- Views: 13169
Re: Way to reverse the spawn?
I'll start with some common things and get to your goal in the end. ⋅ Use entities.dictionary.EntityDictionary class (or its derivatives like players.dictionary.PlayerDictionary or weapons.dictionary.WeaponDictionary ) whenever you need a container that is used to store Entity (or Player /...
- Fri Dec 01, 2017 12:17 pm
- Forum: Plugin Development Support
- Topic: How to use PlayerAnimation.RELOAD?
- Replies: 22
- Views: 70472
Re: How to use PlayerAnimation.RELOAD?
Edit: Does sv_infinite_ammo apply to grenades and so on as well? According to several grenade training tutorials like this one , yes. I guess the thread can be marked as solved now. Not sure if we can mark topics as "solved" on these forums besides stating that in the title directly. Whic...
- Fri Dec 01, 2017 10:01 am
- Forum: Plugin Development Support
- Topic: How to use PlayerAnimation.RELOAD?
- Replies: 22
- Views: 70472
Re: How to use PlayerAnimation.RELOAD?
I'd also mention CS:GO-specific cvar sv_infinite_ammo . It is used the stock DM mode. Setting it to 1 will get you an infinite reserve ammo, while setting it to 2 gets you an infinite clip, i.e. players won't need to reload at all. Default value is 0. I know your plugin is cross-game, but you may wa...
- Fri Dec 01, 2017 4:58 am
- Forum: Plugin Development Support
- Topic: How to use PlayerAnimation.RELOAD?
- Replies: 22
- Views: 70472
Re: How to use PlayerAnimation.RELOAD?
I think it's possible to hide the ammo without hiding the clip. According to this and this , setting primary clip size of a weapon type to WEAPON_NOCLIP (which is -1) will hide the ammo counter on player HUDs. This is partly achievable via SP weapons.scripts package that gives you access to weapon c...
- Fri Dec 01, 2017 4:19 am
- Forum: Plugin Development Support
- Topic: How to use PlayerAnimation.RELOAD?
- Replies: 22
- Views: 70472
Re: How to use PlayerAnimation.RELOAD?
I suspect it may be possible to hide the clip and the ammo counters altogether, but that causes more problems than it solves. People need to see how much ammo they've got in their clip. As for "999" number - I'd say it makes more sense in case of an infinite ammo. Not much. But default max...
- Fri Dec 01, 2017 3:44 am
- Forum: Plugin Development Support
- Topic: How to use PlayerAnimation.RELOAD?
- Replies: 22
- Views: 70472
Re: How to use PlayerAnimation.RELOAD?
Here's the source code of CAmmoDef::MaxCarry : int CAmmoDef::MaxCarry(int nAmmoIndex) { if ( nAmmoIndex < 1 || nAmmoIndex >= m_nAmmoIndex ) return 0; if ( m_AmmoType[nAmmoIndex].pMaxCarry == USE_CVAR ) { if ( m_AmmoType[nAmmoIndex].pMaxCarryCVar ) return m_AmmoType[n...
- Fri Dec 01, 2017 2:55 am
- Forum: Plugin Development Support
- Topic: How to use PlayerAnimation.RELOAD?
- Replies: 22
- Views: 70472
Re: How to use PlayerAnimation.RELOAD?
Why not simply hook CBaseCombatCharacter::RemoveAmmo and always block its execution? I was actually going to propose that in my next reply to BackRaw :) Along with refilling the ammo in a post-hook on CBaseCombatWeapon::FinishReload . But I'm kinda taught by you not to hook stuff without the need, ...
- Fri Dec 01, 2017 2:25 am
- Forum: Plugin Development Support
- Topic: How to use PlayerAnimation.RELOAD?
- Replies: 22
- Views: 70472
Re: How to use PlayerAnimation.RELOAD?
No, tickrate doesn't affect internal timer, because tick interval (ideal time spent per tick) is constant once you launch the server. The game is smart enough to do the math, given it knows the total tick count and the tick interval :) Also. I didn't see that you also launch your refilling routine (...
- Fri Dec 01, 2017 1:45 am
- Forum: Plugin Development Support
- Topic: How to use PlayerAnimation.RELOAD?
- Replies: 22
- Views: 70472
Re: How to use PlayerAnimation.RELOAD?
Well, can't really answer your question, but I'd point out the issue with your implementation. You delay the refilling procedure with Source.Python delay mechanism on a value based on m_flNextPrimaryAttack value. But the latter is expressed with time that can be affected by host_timescale , while So...
- Fri Dec 01, 2017 1:07 am
- Forum: Plugin Development Support
- Topic: How to use PlayerAnimation.RELOAD?
- Replies: 22
- Views: 70472
Re: How to use PlayerAnimation.RELOAD?
It's just one of the possible player animations. You can't really detect anything with it other than that reloading has begun. "Player intention detection" will more likely be described with PlayerButtons.RELOAD , but it will boil down to just checking R (or other key) state, even if a pla...