[amxx]write crosshair as a spr??
1 Attachment(s)
hello there.
i modify a plugin that disable crosshair showing up, and add a few lines that can show a spr file (which has the crosshair) onto the screen, http://i.imgur.com/Lb6IhnH.png but it can be only seen in one direction, there are afterimages when the player moves. http://i.imgur.com/1rLyItY.png http://i.imgur.com/7wYhpON.png i want it to stay in the same location to replace the original crosshair, what should i do? please help. PHP Code:
|
Re: [amxx]write crosshair as a spr??
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. |
Re: [amxx]write crosshair as a spr??
what do we have here: https://forums.alliedmods.net/showthread.php?t=175632
You can also mess with the crosshair color by not doing the gray sprites. You have to be pretty creative with colors in order to get the white one |
Re: [amxx]write crosshair as a spr??
Quote:
Quote:
|
Re: [amxx]write crosshair as a spr??
It helps you because it (probably) gives you the option to directly change the HUD sprite to what you want. Your way just spams sprites on the user's screen like Black Rose said, This method actually changes the sprite directly in the game.
|
| All times are GMT -4. The time now is 13:01. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.