AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   beam/sprite not showing (https://forums.alliedmods.net/showthread.php?t=309244)

JocAnis 07-18-2018 16:02

beam/sprite not showing
 
hi guys. im trying to create beam with an simple sprite. code is executed ingame but nothing is created...here is the code of it:

PHP Code:

new origin[3];
    
get_user_origin(idorigin3);
         
    
message_beginMSG_ALLSVC_TEMPENTITY, { 0.00.00.0 }, id );
    
write_byteTE_BEAMPOINTS );
    
write_coordorigin[0] ); //start-x
    
write_coordorigin[1] );// y
    
write_coordorigin[2] );// z
    
write_coordorigin[0]+100 );// end - x
    
write_coordorigin[1] ); //y 
    
write_coordorigin[2] ); //z
    
write_shortsprite )    // sprite index
    
write_byte(0)        // starting frame
    
write_byte(1)        // frame rate
    
write_byte(5)        // life
    
write_byte(10)        // line width
    
write_byte(0)        // noise
    
write_byte(255);        // red
    
write_byte(200);        // green
    
write_byte(0);        // blue
    
write_byte(200)
    
write_byte(0);    
    
message_end() 

is the problem with coordinates ? thanks in advance :)

Celena Luna 07-18-2018 16:12

Re: beam/sprite not showing
 
PHP Code:

message_beginMSG_ALLSVC_TEMPENTITY, { 0.00.00.0 }, id ); 

=>
PHP Code:

message_begin(MSG_ONE_UNRELIABLESVC_TEMPENTITY_id); 


JocAnis 07-18-2018 16:17

Re: beam/sprite not showing
 
thanks, now it is showing something...isnt get_user_origin getting player's origins not the coords where he aims ? cuz sprite is created on my crosshair pointing

Ghosted 07-18-2018 16:26

Re: beam/sprite not showing
 
Quote:

Originally Posted by Celena Luna (Post 2604625)
PHP Code:

message_beginMSG_ALLSVC_TEMPENTITY, { 0.00.00.0 }, id ); 

=>
PHP Code:

message_begin(MSG_ONE_UNRELIABLESVC_TEMPENTITY_id); 


Also remove id cause its MSG_ALL

Ghosted 07-18-2018 16:27

Re: beam/sprite not showing
 
Quote:

Originally Posted by JocAnis (Post 2604627)
thanks, now it is showing something...isnt get_user_origin getting player's origins not the coords where he aims ? cuz sprite is created on my crosshair pointing

get_user_origin's third parameter is which type of origin you want, 3rd is aiming, zero is just players origin


All times are GMT -4. The time now is 12:31.

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