Post: How To Toggle Something More than Once C#?
02-15-2014, 05:59 PM #1
Notorious
Caprisuns Is Back
(adsbygoogle = window.adsbygoogle || []).push({}); Hey I really need to know how to toggle something more than just twice like on and off. I have tried coding a switch but it seems to ignore the other cases and just print the first case? im not sure why so if anyone can help it will be appreciated.

Here is the code i was using maybe i didnt put it right:

if (scroll == 0)
{
int caseSwitch = 0;
switch (caseSwitch)
{
case 0:
RPC.iPrintln(client, "FOV 60");
break;
case 1:
RPC.iPrintln(client, "FOV 70");
break
}
}
(adsbygoogle = window.adsbygoogle || []).push({});
02-17-2014, 01:13 PM #2
RatchetBooty
Former Staff
Try using bool, it loops through a code as many times until the bool turns false. :yes:
02-24-2014, 04:29 AM #3
Script
Banned
Originally posted by Prime
Hey I really need to know how to toggle something more than just twice like on and off. I have tried coding a switch but it seems to ignore the other cases and just print the first case? im not sure why so if anyone can help it will be appreciated.

Here is the code i was using maybe i didnt put it right:

if (scroll == 0)
{
int caseSwitch = 0;
switch (caseSwitch)
{
case 0:
RPC.iPrintln(client, "FOV 60");
break;
case 1:
RPC.iPrintln(client, "FOV 70");
break
}
}


Just add another case such as:

    
if (scroll == 0)
{
int caseSwitch = 0;
switch (caseSwitch)
{
case 0:
RPC.iPrintln(client, "FOV 60");
break;
case 1:
RPC.iPrintln(client, "FOV 70");
break;
case 2:
RPC.iPrintln(client, "FOV 80");
break;
}
}
03-02-2014, 06:25 AM #4
Pichu
RIP PICHU.
    
int scroll = 0, caseSwitch = 0;
public void method()
{
if (scroll.Equals(0))
switch(caseSwitch)
{
case 0: RPC.iPrintln(client, "FOV 60"); break;
case 1: RPC.iPrintln(client, "FOV 70"); break;
case 2: RPC.iPrintln(client, "FOV 80"); break;
default: ; break;
}
}
03-12-2014, 02:17 AM #5
l3g3ndary
Gym leader
Originally posted by Pichu View Post
    
int scroll = 0, caseSwitch = 0;
public void method()
{
if (scroll.Equals(0))
switch(caseSwitch)
{
case 0: RPC.iPrintln(client, "FOV 60"); break;
case 1: RPC.iPrintln(client, "FOV 70"); break;
case 2: RPC.iPrintln(client, "FOV 80"); break;
default: ; break;
}
}


Nice. OP in case you didn't know when you put break it tells the program to stop reading once the case is met. So if it does equal to 0 then it will do that and stop (break). But if you change the FOV a few times then break at the end it will do all the FOVs within that until you break.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo