SA-MP Forums

Go Back   SA-MP Forums > SA-MP > Client Support

Reply
 
Thread Tools Display Modes
Old 27/12/2018, 06:37 PM   #1
Fakinh
Little Clucker
 
Join Date: Oct 2017
Posts: 2
Reputation: 0
Default Help

I getting error..

stock GetJobFromFaction(faction)
{
switch(faction)
{
case 1: return 1;
case 1: return 85;
case 82: return 82;
case 82: return 1;
case 2: return 2;
case 2: return 45;
case 45: return 45;
case 45: return 2;
}
return 0;
}

//Having these errors.. But i need this

: error 040: duplicate "case" label (value 1)
: error 040: duplicate "case" label (value 82)
: error 040: duplicate "case" label (value 2)
: error 040: duplicate "case" label (value 45)
Fakinh is offline   Reply With Quote
Old 28/12/2018, 05:38 PM   #2
CantBeJohn
Big Clucker
 
CantBeJohn's Avatar
 
Join Date: Oct 2016
Posts: 112
Reputation: 15
Default Re: Help

For scripting help, you're suppose to post here: https://forum.sa-mp.com/forumdisplay.php?f=12

As for your issue however, it's literally what the error states. You have duplicate case labels.

For Example:
PHP Code:
switch (workingexample// This will work.
{
    case 
0: return print("This example will work!"); 
    case 
1: return print("This example will work!"); 
    case 
2: return print("This example will work!"); 
    case 
3: return print("This example will work!"); 
}

switch (
notworkingexample// This won't work.
{
    case 
0: return print("This example will not work!"); 
    case 
0: return print("This example will not work!");
    case 
1: return print("This example will not work!"); 
    case 
1: return print("This example will not work!"); 

__________________
Server IP: play.adh-rp.com
Alternate IP: 54.37.129.82:7777

CantBeJohn is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 03:54 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.