Shield Tutorial
Heres a new way of getting whether a person has shield.
By sequence Code:
|
Another one. Originaly posted by Ryan on AMX forums.
Code:
|
Hmm the shield Offset in CS is 494. Only a few bugs with it though. (engine problem of-course)
Im gonna do a few more tests and let you now about it |
The problem is finding an efficient way of getting the shield (ie- a forward).. having to listen to too many events for different parts makes for big and sloppy code to find out one simple thing! and setting a milisecond timer (task) is a no no.
the only ways to detect shield are... client command: shield (whatever buys it right out) menu command: equipment menu, key 8 touch event when walking over it to pick it up hideweapon event -OR- curweapon event... just in case any of the above were missed. however, many plugins give players shields via the give_item function, which does not trigger any of the above events. it's too bad valve (ming) didnt make this easier for scripters to detect. |
so you need shield_pickup , shield_drop forwards...
I did a look at messages when you drop/pickup shiled but none of them was send (even hide weapon and current weapon do not detect shield ... ). I will try to find another way but I can't promise you anything... |
the offset works fine but the engine seems to be messing up sometimes. i think i found a fix for it but dont noe yet. I got a custume edited cstrike with get_user_shield(id) native added and it seems to be working.
|
Quote:
ewww sounds yummy.... |
Code:
If it returns 0 you can be sure user has no shield... |
but sometimes we JUST want to know if it is a shield, like weapon reincarnation in war3 :)
Also, why is this needed: new arg[32] read_argv(1,arg,31) new vid = cmd_target(id,arg,8); |
Freecode ever get anywhere on that offset thing?
|
All times are GMT -4. The time now is 07:56. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.