SA-MP Forums Archive
Switch problem - 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: Switch problem (/showthread.php?tid=622384)



Switch problem - MrTostada - 21.11.2016

Код:
	if (strcmp("/zonaww", cmdtext, true, 10) == 0)
	{
	BloqueoDeComandos[playerid] = 1;
	SetPlayerVirtualWorld(playerid, 2);
	SetPlayerInterior(playerid, 1);
	switch (telesww)
	{
    case 0: {SetPlayerPos(playerid, 1412.639892,-1.787510,1000.924377); }
    case 1: {SetPlayerPos(playerid, 1360.1567,4.4784,1000.9219); }
    case 2: {SetPlayerPos(playerid, 1360.0837,5.7613,1008.1563); }
    case 3: {SetPlayerPos(playerid, 1392.2203,-34.4082,1007.8815); }
    case 4: {SetPlayerPos(playerid, 1417.7954,-47.1087,1007.8936); }
    case 5: {SetPlayerPos(playerid, 1416.8197,5.9778,1007.8885); }
    }
	GivePlayerWeapon(playerid, 24, 999999);
	GivePlayerWeapon(playerid, 27, 999999);
	GivePlayerWeapon(playerid, 29, 999999);
	GivePlayerWeapon(playerid, 31, 999999);
	GivePlayerWeapon(playerid, 34, 999999);
	return 1;
	}
Error:
Код:
: error 017: undefined symbol "telesww"



Re: Switch problem - AMouldyLemon - 21.11.2016

Where is "telesww" declared?


Respuesta: Switch problem - MrTostada - 21.11.2016

I not declared nothing


Re: Respuesta: Switch problem - roar - 21.11.2016

Quote:
Originally Posted by MrTostada
Посмотреть сообщение
I not declared nothing
The problem is you haven't declared what is "telesww". You need to declare it first. And then, say when player executes a command, give them the value of the telesww, and after that you can do switch-cases.


Respuesta: Switch problem - MrTostada - 21.11.2016

https://sampforum.blast.hk/showthread.php?tid=622393