Raised This Month: $ Target: $400
 0% 

Sky


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 12-08-2007 , 23:16   Sky
Reply With Quote #1

ok using engine how can i make it so if im aiming at the sky i cant use the hook?

Code:
 if (iContents == CONTENTS_SKY)
 {
  return PLUGIN_HANDLED
 }
i saw this in the new hook mod but i just want to add it to mine. how can i do that.. thanks for helping
Doc-Holiday is offline
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 12-08-2007 , 23:37   Re: Sky
Reply With Quote #2

That looks right. You need to fill in what iContents is first.

PHP Code:
// If cvar sv_hooksky is 0 and hook is in the sky remove it!
    
new iContents engfunc(EngFunc_PointContentsentOrigin)
    if (!
get_pcvar_num(pHookSky) && iContents == CONTENTS_SKY)
    {
        if(
get_pcvar_num(pSound))
            
emit_sound(HookEntCHAN_STATIC"weapons/xbow_hit2.wav"1.0ATTN_NORM0PITCH_NORM)
        
remove_hook(id)
    } 
From the new hook
__________________
M249-M4A1 is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 12-08-2007 , 23:47   Re: Sky
Reply With Quote #3

i know what the new hook says but

i want it so that if i aim at the sky and hook it wont connect.... if you know what i mean...

Also can some one right me a function that will allow a hook to open a door?
Doc-Holiday is offline
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 12-08-2007 , 23:51   Re: Sky
Reply With Quote #4

PHP Code:
new iContents engfunc(EngFunc_PointContentsentOrigin)

if (
iContents == CONTENTS_SKY)
    
// do nothing (or remove a hook if it already shot)
    
return PLUGIN_HANDLED 
__________________
M249-M4A1 is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 12-09-2007 , 01:38   Re: Sky
Reply With Quote #5

That dosent explain to me how this works it says entorigin dosent exist and engfun is fake meta im not using fakemeta i dont know how....
Doc-Holiday is offline
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 12-09-2007 , 03:56   Re: Sky
Reply With Quote #6

You asked for the code first, rather than an explanation. Look up what var entOrigin is in the Hook plugin, and you will know.

Quote:
im not using fakemeta i dont know how....
Add the following line of code into your includes section of your script, and it will use FakeMeta:

PHP Code:
include <fakemeta
For the code, plain and simply:
1) iContents holds the contents of the target
2) if (iContents == CONTENTS_SKY) checks if iContents (your target) is the sky
3) return PLUGIN_HANDLED stops the rest of the code in that procedure from running, so this acts like a "do nothing"
__________________
M249-M4A1 is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 12-09-2007 , 14:33   Re: Sky
Reply With Quote #7

..... it still tells me that entorigin dosent exist

and im not that dumb i put fakemeta in using that code but i have no idea wat entorigin is.
Doc-Holiday is offline
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 12-09-2007 , 14:51   Re: Sky
Reply With Quote #8

Like I said earlier, entOrigin is a variable. It is user created. Go look up what entOrigin is inside the new hook plugin, and you will see what it is, and how it's used.
__________________
M249-M4A1 is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 12-09-2007 , 14:59   Re: Sky
Reply With Quote #9

Code:
get_user_origin ( index, origin[3], [ mode = 0 ] )

index is a player index from 1 to 32.

The origin is stored in the vector (3 member array) passed as the second parameter.
origin[0] = X coordinate
origin[1] = Y coordinate
origin[2] = Z coordinate

If mode is passed, the origin changes:
0 - current position (Default)
1 - Position from eyes (weapon aiming)
2 - End position from player position
3 - End position from eyes (hit point for weapon)
4 - Position from last bullet hit (only CS)
Code:
new iOrigin[3]; get_user_origin (id, iOrigin, 3); new iContents = engfunc(EngFunc_PointContents, iOrigin); if ( iContents == CONTENTS_SKY )     // do nothing (or remove a hook if it already shot)     return PLUGIN_HANDLED;
[ --<-@ ] Black Rose 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 11:04.


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