Error in this script
#1

This is my script here see case 11 i wanna continue on a next line.

Код:
CMD:ocmds(playerid, params[])
{
	new string[256];
	if (GetPVarInt(playerid, "playerorg") == 0) return SendClientMessage2(playerid, COLOR_RED, "Error: You aren't in an organization!");
	format(string, 10, "ORG%d", GetPVarInt(playerid, "playerorg"));
	SendPlayerFormattedText(playerid, COLOR_LBLUE, "%s commands:", dini_Get(AddDirFile(dir_orgfiles, string), "name"), "");
	switch (orgcata[GetPVarInt(playerid, "playerorg")-1])
	{
		case 2: SendClientMessage2(playerid, COLOR_WHITE, "/oskin, /oc, /selldrugs, /shipdrugs, /collectdrugs, /robbank, /zones, /open, /close, /resign.");

		case 3: SendClientMessage2(playerid, COLOR_WHITE, "/oskin, /oc, /heal, /open, /close, /resign.");

		case 4: SendClientMessage2(playerid, COLOR_WHITE, "/oskin, /oc, /ad, /open, /close, /resign.");

		case 5: SendClientMessage2(playerid, COLOR_WHITE, "/oskin, /oc, /ad, /open, /close, /resign.");

		case 6: SendClientMessage2(playerid, COLOR_WHITE, "/oskin, /oc, /confirmhit, /ad, /open, /close, /resign, /trace, /taser.");

		case 7: SendClientMessage2(playerid, COLOR_WHITE, "/oskin, /oc, /open, /close, /resign.");

		case 11: SendClientMessage2(playerid, COLOR_WHITE, "/oskin, /oc, /gc, /jail, /unjail, /fine, /want, /cuff, /uncuff, /loc, /pu, /addpoints, /frisk, /takeitem");
                case 11: SendClientMessage2(playerid, COLOR_WHITE, "/open, /close, /resign, /911reply, /taser");

		case 12: SendClientMessage2(playerid, COLOR_WHITE, "/oskin, /oc, /gc, /jail, /unjail, /want, /cuff, /uncuff, /loc, /pu, /open, /close, /resign, /taser.");

		case 13: SendClientMessage2(playerid, COLOR_WHITE, "/oskin, /oc, /gc, /jail, /unjail, /want, /cuff, /uncuff, /loc, /pu, /open, /close, /resign, /taser.");
	}
	return 1;
}
I get this error

Код:
C:\Users\Immortal99\Desktop\Phoenix Gaming\gamemodes\ImmortalRoleplay.pwn(23988) : error 040: duplicate "case" label (value 11)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Help Me
Reply
#2

Has it occured to you that you can just use braces?
PHP код:
case 11
{
    
// stuff

Reply
#3

I dont know, i got this script from a friend and im trying to put /open, /close, /resign, /911reply, /taser on a new line because that whole case 11 is to long
Reply
#4

As Vince said; using braces makes this a lot easier to follow and add more functions to

pawn Код:
case 11:
{
    SendClientMessage2(playerid, COLOR_WHITE, "/oskin, /oc, /gc, /jail, /unjail, /fine, /want, /cuff, /uncuff, /loc, /pu, /addpoints, /frisk, /takeitem");
    SendClientMessage2(playerid, COLOR_WHITE, "/open, /close, /resign, /911reply, /taser");
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)