[Tool/Web/Other] Orel Reshka :)
#3

This isn't a tutorial! You explained nothing, and just gave us code. You cannot do that in this section - either change it to a tutorial form or request a thread move to an appropriate section(such as the filterscript / release section).

You also have some bad scripting habits going on, for example the switch.

pawn Code:
switch(rand)
                {
                    case 0:lucky[playerid] = 1,stringer = "Orel";
                    case 1:lucky[playerid] = 2,stringer = "Reshka";
                    case 2:lucky[playerid] = 2,stringer = "Reshka";
                    case 3:lucky[playerid] = 2,stringer = "Reshka";
                    case 4:lucky[playerid] = 2,stringer = "Reshka";
                    case 5:lucky[playerid] = 2,stringer = "Reshka";
                    case 6:lucky[playerid] = 1,stringer = "Orel";
                }
Now basically instead of using 2 lines you spread it over 7 - when the results are purely the same. A better code would be:

pawn Code:
switch(rand)
                {
                    case 0,6:lucky[playerid] = 1,stringer = "Orel";
                    case 1..5:lucky[playerid] = 2,stringer = "Reshka";
                                        default: return 0; // This shouldn't be called but just in case let's have it return 0.
                }
Reply


Messages In This Thread
Orel Reshka :) - by SnoopDy - 12.03.2015, 17:24
Re: Orel Reshka :) - by Misiur - 13.03.2015, 00:41
Re: Orel Reshka :) - by Abagail - 13.03.2015, 00:53
Re: Orel Reshka :) - by SnoopDy - 13.03.2015, 13:33
Re: Orel Reshka :) - by SnoopDy - 13.03.2015, 13:35
Re: Orel Reshka :) - by CalvinC - 13.03.2015, 13:39
Re: Orel Reshka :) - by newbienoob - 13.03.2015, 14:04
Re: Orel Reshka :) - by SnoopDy - 13.03.2015, 14:39

Forum Jump:


Users browsing this thread: 1 Guest(s)