AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Solved Multiple definition in case (https://forums.alliedmods.net/showthread.php?t=298162)

_GamerX 06-03-2017 12:57

Multiple definition in case
 
PHP Code:

switch(skill)
    {
        case 
.. 69fun_rank[client] = 1;
        case 
70 .. 74fun_rank[client] = 2;
        case 
75 .. 79fun_rank[client] = 3;
        case 
80 .. 84fun_rank[client] = 4;
        case 
85 .. 89fun_rank[client] = 5;
        case 
90 .. 94fun_rank[client] = 6;
        case 
95 .. 99fun_rank[client] = 7;
        case 
100 .. 104fun_rank[client] = 8;
        case 
105 .. 109fun_rank[client] = 9;
        case 
110 .. 114fun_rank[client] = 10;
        case 
115 .. 119fun_rank[client] = 11;
        case 
120 .. 124fun_rank[client] = 12;
        case 
125 .. 129fun_rank[client] = 13;
        case 
130 .. 134fun_rank[client] = 14;
        case 
135 .. 139fun_rank[client] = 15;
        case 
140 .. 144fun_rank[client] = 16;
        case 
145 .. 149fun_rank[client] = 17;
        case 
150 .. 1000fun_rank[client] = 18;
    }


E.g. this i ussing in AMXX but "great" SourceMod give me error
(1020) : error 001: expected token: ":", but found ".."
(1020) : warning 215: expression has no effect
(1020) : error 001: expected token: ";", but found ":"


How to this in SM?

hleV 06-03-2017 13:58

Re: Multiple definition in case
 
Number ranges for switch were removed from SM. Use if else.

Mitchell 06-03-2017 14:04

Re: Multiple definition in case
 
Or use math to determine their rank..?


All times are GMT -4. The time now is 01:11.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.