Raised This Month: $ Target: $400
 0% 

Add shootable model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Metabolic
Member
Join Date: Sep 2009
Old 09-23-2009 , 22:29   Add shootable model
Reply With Quote #1

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
Metabolic is offline
NatalyaAF
Senior Member
Join Date: Dec 2008
Old 09-24-2009 , 17:37   Re: Add shootable model
Reply With Quote #2

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.
NatalyaAF is offline
olj
Veteran Member
Join Date: Jun 2009
Old 09-24-2009 , 18:49   Re: Add shootable model
Reply With Quote #3

TeleportEntity should help with moving.
__________________
olj is offline
Metabolic
Member
Join Date: Sep 2009
Old 09-29-2009 , 18:46   Re: Add shootable model
Reply With Quote #4

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.
Metabolic is offline
olj
Veteran Member
Join Date: Jun 2009
Old 10-02-2009 , 08:40   Re: Add shootable model
Reply With Quote #5

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
__________________
olj is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:58.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode