AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Explain how (https://forums.alliedmods.net/showthread.php?t=2133)

RPRaiden 05-27-2004 10:07

Explain how
 
Could someone please explain how to use these and show an example please?

native message_begin( dest, msg_type, origin[3]={0,0,0},player=0);
native message_end();
native write_byte( x );
native write_char( x );
native write_short( x );
native write_long( x );
native write_entity( x );
native write_angle( x );
native write_coord( x );
native write_string( x[] )

RPRaiden 05-27-2004 12:36

hmm maybe if you could just explain byte_short because I want to know how to make a sprite play longer than 1 second.

xeroblood 05-28-2004 00:11

loop the call... (ie: set_task( 1.0, "draw_sprite")... )

ThantiK 05-28-2004 04:55

Code:
blastcir(vec1[3]) {     // blast circles     message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1 )     write_byte( 21 )     write_coord(vec1[0])     write_coord(vec1[1])     write_coord(vec1[2] + 16)     write_coord(vec1[0])     write_coord(vec1[1])     write_coord(vec1[2] + 200)     write_short( white )     write_byte( 0 ) // startframe     write_byte( 0 ) // framerate     write_byte( 4 ) // life     write_byte( 16 ) // width     write_byte( 0 ) // noise     write_byte( 188 ) // r     write_byte( 220 ) // g     write_byte( 255 ) // b     write_byte( 255 ) //brightness     write_byte( 0 ) // speed     message_end() }

There is a function you can put into a plugin...do something like

Code:
new origin[3]          get_user_origin(player,origin)

To get your users origin, and pass it to the function....usually like...

Code:
blastcir(origin)

Also, heres a link to some stuff so you can tell what your doing...
http://0x00.org/random/Halflife/SDK/...engine/const.h

The first write_byte is the number of the effect...you'll see numbers beside some constants in the link I gave you...those match up.

RPRaiden 05-28-2004 09:01

This Really Helped!. Thanks I was missing the byte Life. I will keep that info as future Reference.

Also I considered looping it but I thought it would loop forever and I dont want that :S

RPRaiden 05-28-2004 10:13

Code:

        write_byte( 5 )
        write_coord(vec[0]+a1)
        write_coord(vec[1]+b1)
        write_coord(vec[2]+30)
        write_short( smoke )
        write_byte( 30 ) 
        write_byte( 10 ) 
      write_byte( 100 )
        message_end()

I added the last byte to set time 100 x 1.0s (10 Seconds) And I got a error when I use the command now

xeroblood 05-28-2004 11:30

As far as I know, a sprite can only last 1 second on screen, that's why I said loop it.. if you're worried about it looping forever, then set a global variable or something to tell it when to stop..

RPRaiden 05-28-2004 13:48

I will look into that. Cheers

ThantiK 05-28-2004 22:25

Yea, some of those properties start getting really finniky.

If they aren't right, etc then they start crashing the server, or all sorts of things.

I had one, where I had the values incorrect, and it actually kicked every player on the server without any kind of notice, any messages, any crashes or anything...it was like....play play play play play...WTF...I'm back @ cs startup screen? -- and it was literally that instant...and I dont know how. haha...


All times are GMT -4. The time now is 07:02.

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