Add shootable model
hi everybody,
i just started to wirte my first plugin so i have some basic questions i think :). I didn't find anything in the tutorials so i have to ask you guys... The problem is: I want to add at a random point in the map a model which can be shot by the players. The model should only be visible for some seconds and it would be great if it could move too. I already found some code to add a model to the map but how do i move the model or give it a hitbox so the players can shoot at it? I hope somebody could give me a hint... thx for the help in advance, Metabolic |
Re: Add shootable model
You'd need a model that was compiled so it can be runs as prop_dynamic or prop_physics because they would probably already have default hitboxes.
|
Re: Add shootable model
TeleportEntity should help with moving.
|
Re: Add shootable model
hi,
sry for my late reply... Thank you very much that realy helped me. But is there an event fired when the model is hit? I didn't find one... Because i want that the player can shoot at the model and then they get something for hitting it. |
Re: Add shootable model
Well, browse events. http://wiki.alliedmods.net/Game_Events_(Source)
As a workaround you can hook IN_ATTACK, and then use GetClientAimTarget to check if client is looking at a model and if he do, that means he is shooting at that model (you can check what weapons he using also, and if it is melee one - check distance before doing something). EDIT: Here it is, player_shoot event exists http://wiki.alliedmods.net/Generic_S...s#player_shoot |
All times are GMT -4. The time now is 00:09. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.