Getting cvars and getting spectating target.
Hi, Im quite new on the amxx modding scene, I aim mostly at modding counterstrike. My latest experience in modding was in quake 1 where I did a lot of custom stuff like complete sets of new weapons, rules, models and the whole shabang.
I most confess I got stuck on some very basic stuff that I cant figure out how to solve, I guess it is probably very easy if you know how, it usually is but in the beginning you have to get a "feel" for the new enviroment. I have tried searching the forums and checking various tutorials and checking other peoples plugins but the answer still eludes me. The problem: 1. I need to read a players cvars, more specifically, I need to check if a user have reverse mouse on or not. This is in the cvar m_pitch which is a float. If it is negative then the user has reverse mouse on. I need to check this in order to properly set it back later so I donīt mess the players setting up. I have not found a way to check users cvars in general. 2. I need to get hold of the player I am currently spectating. I am thinking about some various anti-cheat plugins and cheat-detection methods but I need to get the player I am spectating (as an admin) as a player number or perhaps as a target entity. I found it cumbersome running plugins affecting players by referring their name and so on, It would be much more easy for the admin to simply have it affect the player he is currently spectating. Thanks in advance! /Mind |
Re: Getting cvars and getting spectating target.
Quote:
|
Those are for server cvars, AFAIK there is no way to get most if not all of a client's cvars.
|
If you're wanting to get their m_pitch:
Quote:
As far as the spectator thing goes, I can't help you there. There IS a set_view command, which sets your view to chase someone else, but there doesn't seem to be a get_view. Perhaps there's a entry in the entity structure. Check out the engine_const.inc and see if you can find it there :) Hope I helped. |
Thanks a million! =)
One less problem to solve :P Strange thing, I actually looked at that exakt command but never got it working, and I see now that I read your example that I simply misunderstood how it worked =) |
Hmm... on second thought, now that I tried it out, it doesnt seem to work.
I took this: Code:
and made sure all the parameters are what they are supposed to be, like id in get_user_info should be index and so on.. when it didnt work (it compiled ok but I didnt get any value what so ever from m_pitch) I tried tweaking and changing and all sorts of stuff just to make sure that I didnt screw up somewhere else. If I take this code: Code:
I should be able to print it out with client_print... right? I tried typing out other stringvariables with it and it worked ok, but not when I try to type tempPitch. Take this snippet for example Code:
It prints out: Test is: Test2 is:Hello So the variable test is actually never getting anything. I figured I made something wrong with index or so... so I made damn sure I had playerindex there by using get_user_index(arg) where arg was the playername. Anyone have any suggestions on this? |
I see what you mean. cl_rate isn't working either. For some reason name does though.
|
Valve removed this feature. But it works for some cvars. If this feature worked I would force some cvars to stop cheating. Hlguard isn't hack proof. So you can't force some hack client cvars to be default settings.
|
| All times are GMT -4. The time now is 16:43. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.