SA-MP Forums Archive
Random command - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Random command (/showthread.php?tid=197533)



Random command - Libra_PL - 09.12.2010

So, I made a command:

Код:
dcmd_war(playerid,params[]) {
	#pragma unused params
	{
	if(InWar[playerid] != 1) return SendClientMessage(playerid, red, "ERROR: You are currently in a DM zone! Type /exit to leave it!");
	if(Dead[playerid] != 1) return SendClientMessage(playerid, red, "ERROR: You must spawn before teleporting to DM zone!");
 	else
		new tmp3; tmp3=random(7); //1139 line
    	switch(tmp3)
    	{
    	    case 0: { SendClientMessage(playerid,green,"1"); }
    	    case 1: { SendClientMessage(playerid,green,"2"); }
    	    case 2: { SendClientMessage(playerid,green,"3"); }
    	    case 3: { SendClientMessage(playerid,green,"4"); }
    	    case 4: { SendClientMessage(playerid,green,"5"); }
    	    case 5: { SendClientMessage(playerid,green,"6"); }
    	    case 6: { SendClientMessage(playerid,green,"7"); }
		}
		return 1;
	}
	return 0;
}
And the problem is:

...(1139) : warning 217: loose indentation
...(1139) : error 017: undefined symbol "tmp5"
...(1139) : warning 215: expression has no effect
...(1139) : error 017: undefined symbol "tmp5"
...(1139) : fatal error 107: too many error messages on one line

Anyone can help me and fix it?