AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SLOVED] How to Hook .spr to origin (https://forums.alliedmods.net/showthread.php?t=249216)

Kuma77 10-02-2014 12:13

[SLOVED] How to Hook .spr to origin
 
I want some help about how i can hook .spr file ex (beam.spr) to some float origin ex (-2786 3299 912)

i want when function is ON then .spr make hook to tht place (-2786 3299 912) if function OFF .spr hidden !

sr , my bad eng !

HamletEagle 10-02-2014 13:32

Re: [HELP] How to Hook .spr to float origin
 
engfunc( EngFunc_WriteCoord, float ) ?

Kuma77 10-02-2014 14:34

Re: [HELP] How to Hook .spr to float origin
 
Quote:

Originally Posted by HamletEagle (Post 2206196)
engfunc( EngFunc_WriteCoord, float ) ?

idk ! , but what should i put after this code

PHP Code:

new g_hocked

engfunc
(EngFunc_MessageBegin,MSG_ALL,g_hocked,{0.00.00.0},0)
    
write_byte(1)
    
write_string(beam.spr)
    
write_byte(0)
        
message_end() 

plz correct

HamletEagle 10-03-2014 12:01

Re: [HELP] How to Hook .spr to float origin
 
Please, explain what message do you want to send. You can look into messages_const.inc and see. Do you want to create an explosion/ a beam or what ?

Kuma77 10-03-2014 21:34

Re: [HELP] How to Hook .spr to float origin
 
I am working on Capture The Flag for HL 1 , i want to add arrow spr when player has flag the arrow sprite shows you the way for your base ( arrow spr hooked automaticly to player base )

then when player capture or lose flag the arrow spr hidden

i hope you understand me ! .

aron9forever 10-04-2014 13:06

Re: [HELP] How to Hook .spr to float origin
 
Quote:

Originally Posted by Kuma77 (Post 2206754)
I am working on Capture The Flag for HL 1 , i want to add arrow spr when player has flag the arrow sprite shows you the way for your base ( arrow spr hooked automaticly to player base )

then when player capture or lose flag the arrow spr hidden

i hope you understand me ! .

I partly understand you
do you want an arrow like this

http://videogamecritic.com/images/xb...erground_2.jpg
that shows the general direction

or one like this

http://makeserver.ru/uploads/posts/2...03_skrin-3.jpg


The second one is very easy if you have the player's origin and the base origin

PHP Code:

message_beginMSG_BROADCASTSVC_TEMPENTITY );
        
write_byteTE_BEAMPOINTS );
        
engfuncEngFunc_WriteCoordv_Origin] ); //origins for start of beam(your case player)
        
engfuncEngFunc_WriteCoordv_Origin] );//origins for start of beam(your case player)
        
engfuncEngFunc_WriteCoordv_Origin] );//origins for start of beam(your case player)
        
engfuncEngFunc_WriteCoordv_Origin] + 300.0);//origins for end of beam(your case base)
        
engfuncEngFunc_WriteCoordv_Origin] );//origins for end of beam(your case base)
        
engfuncEngFunc_WriteCoordv_Origin] + 3000.0 );//origins for end of beam(your case base)
        
write_shortbeam ); //beam model
        
write_byte);
        
write_byte);
        
write_byte200 ); //life
        
write_byte100 ); //width
        
write_byte50 ); //spread
        
write_byte216 ); //red
        
write_byte); //green
        
write_byte); //blue
        
write_byte255 );
        
write_byte255 );
        
message_end( );

beam precache_model"sprites/laserbeam.spr" ); 


Kuma77 10-04-2014 14:25

Re: [HELP] How to Hook .spr to float origin
 
Thx aron9forever , yes i like second one .

Now i have an idea to do it , your code helpfull :)

Kuma77 10-04-2014 14:31

Re: [HELP] How to Hook .spr to float origin
 
Quote:

Originally Posted by aron9forever (Post 2207043)

The second one is very easy if you have the player's origin and the base origin

i have base origin but i have just spawn players origin , i'll try with this code

( sorry for double post )


All times are GMT -4. The time now is 17:33.

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