Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Crysist

Pages: 1 ... 3 4 5 6 7 [8] 9 10 11 12 13 ... 77
106
Oh I already solved this, yet the function I made checks every denominator and sees if it gets a fraction 0.000001 from the number you enter.
Code: [Select]
function getratio(%ratio,%i)
{
 if(%i $="")
 {
  %i=1;
 }
 else if(%i<99999)
 {
  %raat = %ratio*%i;
  %rate = mCeil(%raat - 0.5);
  %diff = %raat - %rate;
  if(%diff <= 0.000001 && %diff >= -0.000001)
  {
   %raat = mCeil(%raat - 0.5);
   echo(%raat@":"@%i);
   return %raat@":"@%i;
  }
  else
  {
   getratio(%ratio,%i++);
  }
 }
 else
 {
   echo("Denominator is greater than 100000");
   echo(%ratio@":1");
   return %ratio@":1";
 }
}

107
When ever I try to execute an add-on I made (for megashot and giving more stats about screen resolution) always gives this in the console when it checks:
Code: [Select]
Client checking Add-On: Client_Winshot
Loading Add-On: Client_Winshot (CRC:-1582617125)
Add-Ons/Client_Winshot/client.cs (13): string always evaluates to 0.
Add-Ons/Client_Winshot/client.cs (13): string always evaluates to 0.
Executing Add-Ons/Client_Winshot/client.cs.
Add-Ons/Client_Winshot/client.cs (13): string always evaluates to 0.
Heres the code
Code: [Select]
function setmegashot(%num)
{
 if(%num<=8 && %num>=0.2)
 {
    $megashotScaleFactor = %num;
    %hres = getword($pref::Video::resolution,0);
    %vres = getword($pref::Video::resolution,1);
    %hr = mCeil(%hres - 0.5);
    %vr = mCeil(%vres - 0.5);
    echo("Megashot "@%num@" | "@%hr@" x "@%vr);
    %ratio = %hr/%vr;
    //%rat = getratio(%ratio);
    if(%rat=="")
    {
     %rat=%ratio;
    }
    echo("Aspect Ratio "@%rat);
 }
 else
 {
    echo("Invalid Value");
 }
}
function getratio(%ratio)
{
 for(%i=1;%i<45;%i++)
 {
  %raat = %ratio*%i;
  %rate = mCeil(%raat - 0.5);
  %diff = %raat - %rate;
  if(%diff <= 0.1)
  {
   return %rate@":"@%i;
  }
 }
}
function getres()
{
    %hr = getword(1,$pref::Video::resolution);
    %vr = getword(2,$pref::Video::resolution);
    echo(%hr@" x "@%vr);
    %rat = %hr/%vr;
    echo("Aspect Ratio "@%rat);
    return %hr@" "@%vr;
}
I commented out the part where it calls getratio(//%rat = getratio(%ratio);) because I though that was what was causing the problem. If anyone could tell me what I am doing wrong and also tell me how to make getratio work, I would really appreciate it.

What I'm trying to make getratio do is you give it a ratio over one (like 1.777... which is 16:9) for example and attempt to find 16:9. I don't know if there's a function to turn 1.33333:1 into 4:3, so I tried making one.

108
Games / Re: RuneScape - Fremennik Sagas & behind the scenes
« on: June 23, 2011, 12:15:06 PM »
Code: [Select]
<script type="text/javascript">
this.close();
open("http://www.runescape.com/game.ws?j=1","Runescape",
     "toolbar=no,menubar=no,width=766,height=572,resizable=yes");
</script>
Thanks, but what type of file do you put that in?

109
Games / Re: RuneScape - Fremennik Sagas & behind the scenes
« on: June 22, 2011, 11:22:58 PM »
How do you get your window like that?

110
Off Topic / Re: Breath holding
« on: June 22, 2011, 01:09:13 PM »
2 minutes 7 seconds

111
Charlie Romeo Yankee Sierra India Sierra Tango

112
Creativity / Re: The new and improved 3D model topic!
« on: June 17, 2011, 09:52:32 PM »
That's a pretty cool model, good job.
Predalien so far
Update.
Thanks, is the tail straight because you rigged it or is it supposed to be that way?

113
Off Topic / Re: Moving to Argentina in a week
« on: June 17, 2011, 06:31:02 PM »
Buy one of those voltage converter things?

114
Suggestions & Requests / Re: Triple Barrel Shotgun
« on: June 17, 2011, 06:25:30 PM »
Where's the 27 Barrel Shotgun?
Anybody made that, the 27 barrel shotgun.

115
Creativity / Re: The new and improved 3D model topic!
« on: June 17, 2011, 06:16:20 PM »
Yes it is. I added another picture of it.

116
Creativity / Re: The new and improved 3D model topic!
« on: June 17, 2011, 06:10:49 PM »
Woo, I finally made a new model.





118
Off Topic / Re: I'm considering enlisting in the military
« on: June 15, 2011, 06:54:13 PM »
be navy seal, though if you're a seal you have to be 100% badass and have to be able to do a million leg lifts while being pepper sprayed or something.

119
Drama / Re: TehZeno - They deserved it for being successful!
« on: June 14, 2011, 10:17:02 PM »
LET ME JUST GIVE YOU A stuffTY GRAPH
On the time axis some of the lines go back down, so you're saying time goes backwards.

120
Off Topic / Re: possible 90,000 dollars thanks to friend.
« on: June 11, 2011, 11:01:30 AM »
OP could be an eurocigarette trolling americunts.
But he said dollars. Also you have it backwards, commas for thousands and periods for cents. 1,000.24 is a thousand dollars and twenty four cents.

Pages: 1 ... 3 4 5 6 7 [8] 9 10 11 12 13 ... 77