Lecz d*py to nie urywa, po prostu w prethinku kopiuje położenie aktualne względem ekranu gracza i wyświetla ponownie sprite
Dla zainteresowanych daje stocki
//ent = objekt na którym mamy zawiesić sprite
//sprite = zmienna której przypisaliśmi engfunc_precachemodel w plugin_precache !
stock create_icon_origin(id, ent, sprite) // By sontung0 [czyli autora pierwszych CSO-NST]
{
if (!pev_valid(ent)) return;
new Float:fMyOrigin[3]
entity_get_vector(id, EV_VEC_origin, fMyOrigin)
new target = ent
new Float:fTargetOrigin[3]
entity_get_vector(target, EV_VEC_origin, fTargetOrigin)
fTargetOrigin[2] +=50.0
if (!is_in_viewcone(id, fTargetOrigin)) return;
new Float:fMiddle[3], Float:fHitPoint[3]
xs_vec_sub(fTargetOrigin, fMyOrigin, fMiddle)
trace_line(-1, fMyOrigin, fTargetOrigin, fHitPoint)
new Float:fWallOffset[3], Float:fDistanceToWall
fDistanceToWall = vector_distance(fMyOrigin, fHitPoint) - 10.0
normalize(fMiddle, fWallOffset, fDistanceToWall)
new Float:fSpriteOffset[3]
xs_vec_add(fWallOffset, fMyOrigin, fSpriteOffset)
new Float:fScale
fScale = 0.01 * fDistanceToWall
new scale = floatround(fScale)
scale = max(scale, 1)
scale = min(scale, 3) //liczba wartości zmiany skali ikonki kiedy się do niej przybliżamy lub oddalamy
scale = max(scale, 1)
te_sprite(id, fSpriteOffset, sprite, scale, 30) // to 30 to jasność ikonki skala 0 [ciemna]-255[jaskrawa]
}
stock te_sprite(id, Float:origin[3], sprite, scale, brightness) // By sontung0
{
message_begin(MSG_ONE, SVC_TEMPENTITY, _, id)
write_byte(TE_SPRITE)
write_coord(floatround(origin[0]))
write_coord(floatround(origin[1]))
write_coord(floatround(origin[2]))
write_short(sprite)
write_byte(scale)
write_byte(brightness)
message_end()
}
stock normalize(Float:fIn[3], Float:fOut[3], Float:fMul) // By sontung0
{
new Float:fLen = xs_vec_len(fIn)
xs_vec_copy(fIn, fOut)
fOut[0] /= fLen, fOut[1] /= fLen, fOut[2] /= fLen
fOut[0] *= fMul, fOut[1] *= fMul, fOut[2] *= fMul
}
Więc jako że zacząłem się bawić ACG to chciałbym wyświetlić tą ikonkę poprzez addtofullpack ( nie wiem jak ) lub poprzez odpowiednie natywy które oferuje mi Acfun które będę wywoływać w prethinku
// acg_drawspr// Tak wiem zdziwko małe co nie ?
// Function: Draw a sprite on screen
// Parma(s):
// - id: Target player ID
// - szSpr: Full path of the .spr file. Extension is not required.
// For example: myfolder/myspr means sprites\myfolder\myspr.spr [*] Precache is required!
// - red green blue: Saturation of Red/Green/Blue. 255 for general.
// - x y: X coord and Y coord. Range: 0.0~1.0.
// - center: Put the spr center on X coord and Y coord. [1= Yes, 0= No]
// - effects: Visual effects [FX_NONE= No effects, FX_FADE= Fade, FX_FLASH= Flash]
// - fadeintime fadeouttime: Duration of fade in/out. 0 means disabled. (unit: second)
// - fxtime: Duration of flashing. 0 means disabled. (unit: second)
// - holdtime: Hold time.(Holdtime<0 means you want to draw it all the time. Notice: On this occasion should the value of "channel" be in 0~31, and fadeout effect is NOT available)
// - (Q: Then how to stop drawing? A: Call acg_removedrawnimage)
// - mode: Mode of drawing: DRAW_NORMAL/DRAW_ADDITIVE/DRAW_HOLES
// - channel: Range: 0~31. This means you can draw 32 sprs at most at the same time. Any other value (-1, 33, 35, etc...) will make ACG to find an empty channel to draw spr.
native acg_drawspr(id, const szSpr[], red, green, blue, Float:x, Float:y, center,effects, Float:fadeintime, Float:fadeouttime, Float:fxtime, Float:holdtime, mode, channel=-1)
// acg_drawsprdefined
// Function: Draw a sprite which is already defined in hud.txt on screen
// Parma(s):
// - id: Target player ID
// - szSpr: Sprite name defined in hud.txt
// For example: myfolder/myspr means sprites\myfolder\myspr.spr [*] Precache is required!
// - red green blue: Saturation of Red/Green/Blue. 255 for general.
// - x y: X coord and Y coord. Range: 0.0~1.0.
// - center: Put the spr center on X coord and Y coord. [1= Yes, 0= No]
// - effects: Visual effects [FX_NONE= No effects, FX_FADE= Fade, FX_FLASH= Flash]
// - fadeintime fadeouttime: Duration of fade in/out. 0 means disabled. (unit: second)
// - fxtime: Duration of flashing. 0 means disabled. (unit: second)
// - holdtime: Hold time.(Holdtime<0 means you want to draw it all the time. Notice: On this occasion // should the value of "channel" be in 0~31, and fadeout effect is NOT available)
// - (Q: Then how to stop drawing? A: Call acg_removedrawnimage)
// - mode: Mode of drawing: DRAW_NORMAL/DRAW_ADDITIVE/DRAW_HOLES
// - channel: Range: 0~31. This means you can draw 32 sprs at most at the same time. Any other value (-1, 33, 35, etc...) will make ACG to find an empty channel to draw spr.
native acg_drawsprdefined(id, const szSpr[], red, green, blue, Float:x, Float:y, center,effects, Float:fadeintime, Float:fadeouttime, Float:fxtime, Float:holdtime, mode, channel=-1)
No i właśnie piszę tutaj w tej sprawie czy mógłby mi ktoś lekko pomóc to ogarnąć ?