3

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:

enter image description here

Screenshot Of The Expected Results:

enter image description here

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,

Jazz
  • 214
  • 2
  • 10

1 Answers1

0

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.

James Wilkinson
  • 185
  • 2
  • 12