First Issue
#1

Henlo Guis xD Ima Vish, lel kk
Hello Guys, while i was compiling a script i found some problems,
Код:
E:\Unique\gta sampsv\filterscripts\lms.pwn(36) : error 017: undefined symbol "gString"
E:\Unique\gta sampsv\filterscripts\lms.pwn(37) : error 017: undefined symbol "gString"
E:\Unique\gta sampsv\filterscripts\lms.pwn(43) : error 036: empty statement
E:\Unique\gta sampsv\filterscripts\lms.pwn(49) : warning 225: unreachable code
E:\Unique\gta sampsv\filterscripts\lms.pwn(49) : error 029: invalid expression, assumed zero
E:\Unique\gta sampsv\filterscripts\lms.pwn(49) : warning 215: expression has no effect
E:\Unique\gta sampsv\filterscripts\lms.pwn(49) : error 001: expected token: ";", but found "if"
E:\Unique\gta sampsv\filterscripts\lms.pwn(49) : error 036: empty statement
E:\Unique\gta sampsv\filterscripts\lms.pwn(49) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


7 Errors.
Lines
Код:
function CountTillLMSStarts()
{
	switch(LMSCount)
	{
	    case 0:
	    {
	        if(LMSPlayers <= 1)
	        {
				SendClientMessageToAll(0xB0C4DEFF, "[LMS] "ORANGE"The Last Man Standing minigame needs atleast 2 participants to start!");
				EndLMS();
				return 1;
			}
			else if(LMSPlayers >= 2) return BeginLMS();
		}
		case 1..4:
		{
		    foreach(Player, i)
			{
			    if(InLMS { i } == true)
			    {
		    		format(gString[], 20, "~r~%i", LMSCount);
		    		GameTextForPlayer(i, gString[], 1000, 5);
		    	}
		    }
		}
		case 5:
		{
		    if(LMSPlayers <= 1);
	        {
				SendClientMessageToAll(0xB0C4DEFF, "[LMS] "ORANGE"The Last Man Standing minigame needs atleast 2 participants to start!");
				EndLMS();
				return 1;
			}
			else if(LMSPlayers >= 2);
			{
		    	foreach(Player, i);
		    	{
		        	if(InLMS { i } == true);
		        	{
		            	format(gString[], 20, "~y~%i", LMSCount);
		            	GameTextForPlayer(i, gString,[100] 1000, 5);
		            	SetPlayerHealth(i, 100), SetPlayerArmour(i, 0);
		            	GivePlayerWeapon(i, LMSWeapons[0], 60), GivePlayerWeapon(i, LMSWeapons[1], 60);
		            	SetCameraBehindPlayer(i);
		        	}
		        }
		    }
		}
		case 6..30:
		{
		    foreach(Player, i);
		    {
		        if(InLMS { i } == true);
		        {
		            format(gString[], 20, "~g~%i", LMSCount);
		            GameTextForPlayer(i, gString[], 1000, 5);
		        }
		    }
		}
	}
	LMSCount--;
	return 1;
}
Line 36
Код:
		    		format(gString[], 20, "~r~%i", LMSCount);
Line 37
Код:
		    		GameTextForPlayer(i, gString[], 1000, 5);
Line 43
Код:
		    if(LMSPlayers <= 1);
line 49s
Код:
 			else if(LMSPlayers >= 2);
I am new to scripting only 2 months.... i cant make this thing somehow work i cant find the fix xD

EDIT: i use
Код:
#include <a_samp>
#include <sscanf2>
#include <foreach>
#include <zcmd>
Reply
#2

First error:
When you use arrays and pass them by reference, you do not need to put "[]". Only put the array name:
PHP код:
format(gString20"~r~%i"LMSCount);//Line 36
GameTextForPlayer(igString10005);//Line 37 
Second part:
You do not use ';' when you're using if, while, for or other control structure (do-while is an exception).

Check SAMP Wiki about Control Structures and you're going to get helped:
https://sampwiki.blast.hk/wiki/Control_Structures
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)