Raised This Month: $ Target: $400
 0% 

[amxx]write crosshair as a spr??


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 07-16-2014 , 16:02   Re: [amxx]write crosshair as a spr??
Reply With Quote #1

How this works is that you print a shitload of sprites on the users screen. CmdStart is called on every server frame, let's say 200 times per second. The sprite have a predefined set of frames to be shown, let's say 1.

https://wiki.alliedmods.net/Temp_Ent...:_TE_EXPLOSION

Reading that gives you really only one parameter to mess with, framerate. The highest possible value is 255, which means 25.5 FPS. So if that sprite is drawn and has one frame it will not disappear until ~.039 seconds later. CmdStart will be called with a delay of .005 seconds meaning about 8 times in the lifetime of that sprite, creating new sprites. These are the ones you see.

You can mess with the server FPS to be 25.5 to try to line it up, but I don't think you want that.
Another option is to not call it on every frame, just every 8th for example (if server has 200FPS). But this would cause the crosshair to drag behind instead.
You might be able to tweak it but it will never be perfect. You will either have flickering if you show too few sprites or duplicates if you show too many.

The rotation doesn't seem to be editable in this kind of message.

There might be another way to achieve what you want, I have no idea. I just thought I would explain a part of the problem.
__________________
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 13:01.


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