AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Dynamic replace of crosshair sprite (https://forums.alliedmods.net/showthread.php?t=325066)

Vieni 06-07-2020 09:14

Dynamic replace of crosshair sprite
 
Hey guys,
As far as I know, it's possible to replace the default half-life type crosshairs with custom sprites, but this only works statically with premade files(like it is in "sprites/weapon_ak47.txt").

I want to create custom sprites, which could be shown on the clients monitor, and i know it's client sided, the question is, is it possible to override that "crosshair ..." line from a plugin and not with a premade file(i mean without a .txt, 'cause as that i should create it custom_sprite*weapon_file times)?

supertrio17 06-07-2020 09:17

Re: Dynamic replace of crosshair sprite
 
I know that there used to be a plugin that lets you execute commands on a player, so you could make them say anything or type anything in their console. But, I believe this is against the rules or something, or it's illegal, idk.

Vieni 06-07-2020 09:23

Re: Dynamic replace of crosshair sprite
 
Quote:

Originally Posted by supertrio17 (Post 2704422)
I know that there used to be a plugin that lets you execute commands on a player, so you could make them say anything or type anything in their console. But, I believe this is against the rules or something, or it's illegal, idk.

Nah, didn't mean something like that. I don't want to replace the default crosshair(the four lines), I wanna replace the "sub-"crosshair(visible in spectator) with a custom sprite(possible by sending a weaponlist message), but don't want to override the bullet/weapon/weapon_s sprites, only the crosshair one. I can even go with the override the whole stuff option, but it would be great if I didnt have to.

Edit: Anyways, thx for trying to help

DJEarthQuake 06-07-2020 10:20

Re: Dynamic replace of crosshair sprite
 
Use HUD for replacement spec X hair.
Animated examples to get ideas from.
Code:
///Hide HUD first if you like. #define HIDEHUD_CROSSHAIR   (1<<6) #define m_iHideHUD              361 set_pdata_int(id, m_iHideHUD, get_pdata_int(id, m_iHideHUD) | HIDEHUD_CROSSHAIR);

Vieni 06-07-2020 10:30

Re: Dynamic replace of crosshair sprite
 
Quote:

Originally Posted by DJEarthQuake (Post 2704437)
Use HUD for replacement spec X hair.
Animated examples to get ideas from.
Code:
///Hide HUD first if you like. #define HIDEHUD_CROSSHAIR   (1<<6) #define m_iHideHUD              361 set_pdata_int(id, m_iHideHUD, get_pdata_int(id, m_iHideHUD) | HIDEHUD_CROSSHAIR);

Want to use custom sprites, as this I could show achivement sprites and stuff for the players on screen.

DJEarthQuake 06-07-2020 10:52

Re: Dynamic replace of crosshair sprite
 
Gotcha. My bad overlooking key specification. What do you think about attaching your achievement sprites to all live players instead of 1 at time?
https://raw.githubusercontent.com/wi...ATTACHMENT.gif

Vieni 06-07-2020 10:59

Re: Dynamic replace of crosshair sprite
 
Quote:

Originally Posted by DJEarthQuake (Post 2704444)
Gotcha. My bad overlooking key specification. What do you think about attaching your achievement sprites to all live players instead of 1 at time?
https://raw.githubusercontent.com/wi...ATTACHMENT.gif

Wanna use precache generic, so it ain't what I'm looking for.
(generic has a bunch of free precache space)

But ain't a bad idea, gonna use it somehow, but not for this one.


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

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