Jump to content
  • 0

Spawn Health PROBLEMA


Francisco96

Question

Deci am vrut sa bag spawn health /hm pe server si imi da eroare la compilare.

: error 030: compound statement not closed at the end of file (started at line 9)

if(strcmp(cmdtext, "/hm", true) == 0)
	{
	if(IsPlayerInRangeOfPoint(playerid, 15.0, 397.6663,2460.0630,16.5000))
	{
	if(IsPlayerInRangeOfPoint(playerid, 15.0, -475.4114,2205.9465,47.2935))
	{
	if(IsPlayerInRangeOfPoint(playerid, 15.0, 1116.8577,2494.9219,432.4359))
	{
	if(IsPlayerInRangeOfPoint(playerid, 15.0, -2678.9490,1349.1318,16.9978))
	{
		SetPlayerHealth(playerid, 100);
		SetPlayerArmour(playerid, 100);
		SendClientMessage(playerid,0xFE1209FF, "Spawn Healt Adaugata!");
	}
	else
	{
		SendClientMessage(playerid, 0xE60000FF, "ERROR: NU esti in zona de spawn!");
		}
	}
}

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

Ideea e sa si inchizi acoladele.

if(strcmp(cmdtext, "/hm", true) == 0)
{
	if(IsPlayerInRangeOfPoint(playerid, 15.0, 397.6663,2460.0630,16.5000))
	{
		if(IsPlayerInRangeOfPoint(playerid, 15.0, -475.4114,2205.9465,47.2935))
		{
			if(IsPlayerInRangeOfPoint(playerid, 15.0, 1116.8577,2494.9219,432.4359))
			{
				if(IsPlayerInRangeOfPoint(playerid, 15.0, -2678.9490,1349.1318,16.9978))
				{
					SetPlayerHealth(playerid, 100);
					SetPlayerArmour(playerid, 100);
					SendClientMessage(playerid,0xFE1209FF, "Spawn Healt Adaugata!");
				}
			}
		}
	}
	else
	{
		SendClientMessage(playerid, 0xE60000FF, "ERROR: NU esti in zona de spawn!");
	}
}

Si apropo, nu iti va functiona comanda.

Link to comment
Share on other sites

Daca folosesti asa:

if(IsPlayerInRangeOfPoint(playerid, 15.0, 397.6663,2460.0630,16.5000))
{
    if(IsPlayerInRangeOfPoint(playerid, 15.0, -475.4114,2205.9465,47.2935))
    {
e ca si cum ai folosi
if(IsPlayerInRangeOfPoint(playerid, 15.0, 397.6663,2460.0630,16.5000) && IsPlayerInRangeOfPoint(playerid, 15.0, -475.4114,2205.9465,47.2935))
Pe cand tu trebuie sa folosesti ||, adica asa:
        if(strcmp(cmdtext, "/hm", true) == 0)
	{
		new loc1 = IsPlayerInRangeOfPoint(playerid, 15.0, 397.6663,2460.0630,16.5000);
		new loc2 = IsPlayerInRangeOfPoint(playerid, 15.0, -475.4114,2205.9465,47.2935);
		new loc3 = IsPlayerInRangeOfPoint(playerid, 15.0, 1116.8577,2494.9219,432.4359);
		new loc4 = IsPlayerInRangeOfPoint(playerid, 15.0, -2678.9490,1349.1318,16.9978);
		if(loc1 || loc2 || loc3 || loc4)
		{
			SetPlayerHealth(playerid, 100);
			SetPlayerArmour(playerid, 100);
			SendClientMessage(playerid,0xFE1209FF, "Spawn Healt Adaugata!");
		}
		else
		{
			SendClientMessage(playerid, 0xE60000FF, "ERROR: NU esti in zona de spawn!");
		}
		return 1;
	}

Link to comment
Share on other sites

Aham multumesc mult.

EDIT: Lam trecut pe zcmd si imi da un warning

warning 217: loose indentation

COMMAND:hm(playerid, params[])
{
		new loc1 = IsPlayerInRangeOfPoint(playerid, 15.0, 397.6663,2460.0630,16.5000);
		new loc2 = IsPlayerInRangeOfPoint(playerid, 15.0, -475.4114,2205.9465,47.2935);
		new loc3 = IsPlayerInRangeOfPoint(playerid, 15.0, 1116.8577,2494.9219,432.4359);
		new loc4 = IsPlayerInRangeOfPoint(playerid, 15.0, -2678.9490,1349.1318,16.9978);
		if(loc1 || loc2 || loc3 || loc4)
		{
			SetPlayerHealth(playerid, 100);
			SetPlayerArmour(playerid, 100);
			SendClientMessage(playerid,0xFE1209FF, "Spawn Healt Adaugata!");
		}
		else
		{
			SendClientMessage(playerid, 0xE60000FF, "ERROR: NU esti in zona de spawn!");
	}
	return 1;
}

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.