PDA

View Full Version : Adding a check for a shield?


Geesu
03-12-2004, 09:28
Can you guys just create a function that checks to see if a user has a shield? I've been able to do this w/ writing a plugin, but its a HUGE pain in the ass and there must be a more efficient way. Although I think most people are still confused about the shield in a programming aspect.

Johnny got his gun
03-12-2004, 10:23
How do you do this with scripting? Only way I can think of so far (without researching :-)) is to check current model, cause it usually contains something with model...
new model[32]
entity_get_string(player, EV_SZ_weaponmodel, model)
if (contain(model, "shield"))
playerhasshield = true

thats 4 lines... a native could be easier to use of course.
But it would be the same thing as writing a stock that does the same thing.

Geesu
03-12-2004, 10:30
Well that hard part is then finding if they've dropped it. And if they're say planting the bomb, the shield model won't come up(i think), even though they may have the shield. I just do a check .1 seconds after they execute the drop command to see if they still have it in the models. And then if they buy a primary weapon then i set hasshield to false. But there have still been times where its not fullproof.