• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] GetPlayerCameraAspectRatio
#1
Hello everyone.

I have read in the open.mp documentation about this function, and if I understand correctly it can only return three values:

Widescreen ON: Should be 1.7764707 but I get 1.000000.
Widescreen OFF: Should be 1.3333334 but I get 1.000000.
5:4 when the LETTERBOX mode is ON: 1.2470589. I don't know how to test this.

Is there something I'm not understanding or is the wiki wrong?

Here is the code:

PHP Code:
public OnPlayerConnect(playerid) {
? ? new 
Float:pAspectRatio;
? ? 
pAspectRatio GetPlayerCameraAspectRatio(playerid);

? ? new 
str[80];
? ? 
format(strsizeof(str), "Your aspect ratio is: %f"pAspectRatio);
? ? print(
str);

  Reply
#2
Try delaying it a bit, 1 server tick i.e.
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply
#3
(2021-03-24, 01:31 AM)Pinch Wrote: Try delaying it a bit, 1 server tick i.e.

I just tried putting the code inside a command and it works fine, giving me the results indicated in the wiki. I guess delaying the function invocation in OnPlayerConnect would also work.

Thanks!
  Reply


Forum Jump: