简体   繁体   中英

How to fix dark skin issue on SAMP class selection in pawn?

I'm working on a SAMP server using pawn language, but I've started facing an issue since I started work on SAMP player skin selection class. The issue is when a player request's a class all skins becomes darker.

My Code:

public OnPlayerRequestClass(playerid, classid) {
    SetPlayerPos(playerid, 154.1271, -1951.8545, 51.3438);
    SetPlayerCameraPos(playerid, 148.6122, -1951.0000, 52.7962);
    SetPlayerCameraLookAt(playerid, 154.1271, -1951.8545, 51.3438);
    SetPlayerFacingAngle(playerid, -279.1916);
    return 1;
}

Screenshot Of The Issue:

在此处输入图像描述

Screenshot Of The Expected Results:

在此处输入图像描述

As you can see in the first screenshot the player skin is darker then normal.

What I have tried:

I have tried rearranging the code, like calling SetPlayerCameraPos() before SetPlayerPos() . I have also tried using a timer to add a delay before setting player pos and camera pos. I have also tried using TogglePlayerSpectating method to make sure every things gets loaded with player's camera. But still same result.

If you know any solution for this problem please share.

Thank You,

This is a lighting effect that's caused by the weather Id of your environment - not the camera position.

You have two options:

Try changing the world time - using SetWorldTime() or SetPlayerTime or change the weather using SetWeather() or SetPlayerWeather(). I'd suggest trying weather id 10.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM