SA-MP Forums Archive
Doubleside function on object. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Doubleside function on object. (/showthread.php?tid=265786)



Doubleside function on object. - 0ne - 02.07.2011

Is there a possibility to get a streamer or something for objects to make them doublesided(like the function on MTA) so it cannot be one side 255alpha and other 0 alpha


Re: Doubleside function on object. - steki. - 02.07.2011

No, I'm sorry.


AW: Doubleside function on object. - Nero_3D - 02.07.2011

Quote:
Originally Posted by 0ne
Посмотреть сообщение
Is there a possibility to get a streamer or something for objects to make them doublesided(like the function on MTA) so it cannot be one side 255alpha and other 0 alpha
I am sure you meant can be ..., didnt you ?

Its possible to calculate the angle between two positions with atan (player and object)

With that information you can determine the side of the object the player could see

Than it just matters what you set in the parameter DrawDistance for the objects

Use something low, maybe -1 (if that works) to make it invisible

The object still needs to be loaded so you cant move throught it

Maybe we can calculate the correct DrawDistance for the given alpha (0 - 255)

Lets say if we set the current distance from the object to the player as DrawDistance it should be fully visible (255 alpha)

Than we can say that DrawDistance = alpha * distance_Player_Object / 255

We just need an extra check so the DrawDistance is never 0.0 (that would activate the default DrawDistance)

Its just a theory but it could work