ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!
Home
Upgrade
Credits
Help
Search
Awards
Achievements
 1638

Spot light mod [SRB 3.0]

by XBLxPhantom - 04-18-2019 - 04:55 PM
#1
I noticed a bit ago in a video on SRB 3.0 they have a mod that draws a spot light from your player in the direction you're facing. It's pretty damn cool But also simple af so i thought i'd re-make and post here for others who may not have figured out how to do it OR didn't know about it. Picture -https://cdn.discordapp.com/attachments/519624715904745474/568435788283510784/image0.jpg



Code:
void GET_CAMERA_DIRECTION(float *dirX, float *dirY, float *dirZ) {
    float tX, tZ, num;
    Vector3 rot = CAM::GET_GAMEPLAY_CAM_ROT(0);
    tZ = rot.z * 0.0174532924f;
    tX = rot.x * 0.0174532924f;
    num = abs(cos(tX));
    *dirX = (-sin(tZ)) * num;
    *dirY = (cos(tZ)) * num;
    *dirZ = sin(tX);
}

if (Draw_Spotlight) {
        float x, y, z;
        GET_CAMERA_DIRECTION(&x, &y, &z);
        Vector3 Cords = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), 1);
        GRAPHICS::DRAW_SPOT_LIGHT(Cords.x, Cords.y, Cords.z + 0.5f, x, y, z, Light_R, Light_G, Light_B, Light_Distance, Light_Brightness, Light_Roundness, Light_Radius, Light_FallOff);
    }
int Light_R = 0, Light_G = 130, Light_B = 0;
float Light_Distance = 0, Light_Brightness = 0, Light_Roundness = 0, Light_Radius = 0, Light_FallOff = 0;
Reply
#2
(04-18-2019 - 04:55 PM)XBLxPhantom Wrote: I noticed a bit ago in a video on SRB 3.0 they have a mod that draws a spot light from your player in the direction you're facing. It's pretty damn cool But also simple af so i thought i'd re-make and post here for others who may not have figured out how to do it OR didn't know about it.  Picture -https://cdn.discordapp.com/attachments/519624715904745474/568435788283510784/image0.jpg



Code:
void GET_CAMERA_DIRECTION(float *dirX, float *dirY, float *dirZ) {
    float tX, tZ, num;
    Vector3 rot = CAM::GET_GAMEPLAY_CAM_ROT(0);
    tZ = rot.z * 0.0174532924f;
    tX = rot.x * 0.0174532924f;
    num = abs(cos(tX));
    *dirX = (-sin(tZ)) * num;
    *dirY = (cos(tZ)) * num;
    *dirZ = sin(tX);
}

if (Draw_Spotlight) {
        float x, y, z;
        GET_CAMERA_DIRECTION(&x, &y, &z);
        Vector3 Cords = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), 1);
        GRAPHICS::DRAW_SPOT_LIGHT(Cords.x, Cords.y, Cords.z + 0.5f, x, y, z, Light_R, Light_G, Light_B, Light_Distance, Light_Brightness, Light_Roundness, Light_Radius, Light_FallOff);
    }
int Light_R = 0, Light_G = 130, Light_B = 0;
float Light_Distance = 0, Light_Brightness = 0, Light_Roundness = 0, Light_Radius = 0, Light_FallOff = 0;
Quote:nice
Reply
#3
o que isso faz?
Reply
#4
any photo plz? :v
Reply
#5
(04-18-2019 - 06:24 PM)BModzMasterTM Wrote: any photo plz? :v

Read his post lol the pic link is in the description lol
2021 Best Be Better Then 2020
Reply
#6
that is pretty cool lol
Reply
#7
That's cool. Thanks for share XBLxPhantom.
[Image: a8keeuutawx01.gif]
Reply
#8
thx for it bro i added it to my menu ;)

[Image: 57989051_2941345205890714_89432870704748...e=5D346CD4]
Reply
#9
(04-19-2019 - 02:45 AM)BModzMasterTM Wrote: thx for it bro i added it to my menu ;)

[Image: 57989051_2941345205890714_89432870704748...e=5D346CD4]
awesome  Rockon

(04-18-2019 - 05:55 PM)hackkink Wrote: o que isso faz?

Mostrar um holofote Como um carro. Mas do seu jogador.
Reply
#10
(04-19-2019 - 03:00 PM)XBLxPhantom Wrote:


Mostrar um holofote Como um carro. Mas do seu jogador.  //entendi :)
Reply

Users browsing: 1 Guest(s)