SA-MP Forums Archive
Case error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Case error (/showthread.php?tid=622381)



Case error - MrTostada - 21.11.2016

I use the "case" wrong?
Код:
	if (strcmp("/zonaww", cmdtext, true, 10) == 0)
	{
	BloqueoDeComandos[playerid] = 1;
	SetPlayerVirtualWorld(playerid, 2);
	SetPlayerInterior(playerid, 1);
	}
    case 1:
    {
	SetPlayerPos(playerid, 1412.639892,-1.787510,1000.924377);
	return 1;
	}
    case 2:
	{
	SetPlayerPos(playerid, 1360.1567,4.4784,1000.9219);
	return 1;
	}
    case 3:
	{
	SetPlayerPos(playerid, 1360.0837,5.7613,1008.1563);
	return 1;
	}
    case 4:
	{
	SetPlayerPos(playerid, 1392.2203,-34.4082,1007.8815);
	return 1;
	}
    case 5:
	{
	SetPlayerPos(playerid, 1417.7954,-47.1087,1007.8936);
	return 1;
	}
    case 6:
	{
	SetPlayerPos(playerid, 1416.8197,5.9778,1007.8885);
	return 1;
	}
	GivePlayerWeapon(playerid, 24, 999999);
	GivePlayerWeapon(playerid, 27, 999999);
	GivePlayerWeapon(playerid, 29, 999999);
	GivePlayerWeapon(playerid, 31, 999999);
	GivePlayerWeapon(playerid, 34, 999999);
	return 1;
	}
Error:
Код:
\gamemodes\NL_v2.7.pwn(363) : error 014: invalid statement; not in switch
\gamemodes\NL_v2.7.pwn(363) : warning 215: expression has no effect
\gamemodes\NL_v2.7.pwn(363) : error 001: expected token: ";", but found ":"
\gamemodes\NL_v2.7.pwn(363) : error 029: invalid expression, assumed zero
\gamemodes\NL_v2.7.pwn(363) : fatal error 107: too many error messages on one line



Re: Case error - GoldenLion - 21.11.2016

First of all don't use strcmp and OnPlayerCommandText to make commands because it's slow, use a command processor instead, also have a look here: how to use switches: https://sampwiki.blast.hk/wiki/Control_Structures#switch. That's some mess you wrote up there lol.


Respuesta: Case error - MrTostada - 21.11.2016

I do not like to use processors, I do a lot of things I prefer to have everything in 1 single thing, and secondly, I don't speak English :v


Re: Case error - Vince - 21.11.2016

If you're going to dismiss everything we suggest because you want to do it "your way" then don't expect to have your problems solved.


Respuesta: Case error - MrTostada - 21.11.2016

I ask that you help me, not that I recommend using other command processors -.-