SA-MP Forums Archive
[Ajuda] error 001: expected token: ";", but found "if" - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] error 001: expected token: ";", but found "if" (/showthread.php?tid=644024)



error 001: expected token: ";", but found "if" - MasterMarques - 02.11.2017

Estou tentando criar um sistema para o portao abrir com a letra H mas da esse erro
Quote:

error 001: expected token: ";", but found "if"

Codigos:
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
        new params[128]
		if((newkeys == KEY_HORN) && (IsPlayerInAnyVehicle(playerid)))
		{
			if(PortaoBuzina[playerid] == 0)
			{
				new id,file[150];
				PortaoBuzina[playerid] = 1;
				format(file, sizeof(file), P_GATES, id);
				if(DOF2_FileExists(file))
				{
					if(!IsPlayerInRangeOfPoint(playerid, 50.0, DOF2_GetInt(file, "fCordX"), DOF2_GetInt(file, "fCordY"), DOF2_GetInt(file, "fCordZ")))
					{
                        if(CallRemoteFunction("GetPlayerAdminLevel", "u", playerid) || GateInfo[strval(params)][SDono] != 3)
						{
                            MoveDynamicObject(DOF2_GetInt(file, "Id2"), DOF2_GetFloat(file, "aPosX"), DOF2_GetFloat(file, "aPosY"), DOF2_GetFloat(file, "aPosZ"), DOF2_GetInt(file, "Speed"));
						}
					}
				}
			}
			else if(PortaoBuzina[playerid] == 1)
			{
				new id,file[150];
				PortaoBuzina[playerid] = 0;
				format(file, sizeof(file), P_GATES, id);
				if(DOF2_FileExists(file))
				{
					if(!IsPlayerInRangeOfPoint(playerid, 50.0, DOF2_GetInt(file, "fCordX"), DOF2_GetInt(file, "fCordY"), DOF2_GetInt(file, "fCordZ")))
					{
						if(CallRemoteFunction("GetPlayerAdminLevel", "u", playerid) || GateInfo[strval(params)][SDono] != 3)
						{
                            MoveDynamicObject(DOF2_GetInt(file, "Id2"), DOF2_GetFloat(file, "fPosX"), DOF2_GetFloat(file, "fPosY"), DOF2_GetFloat(file, "fPosZ"), DOF2_GetInt(file, "Speed"));
						}
					}
				}
			}
		}
		return 1;


}



Re: error 001: expected token: ";", but found "if" - MasterMarques - 02.11.2017

Quote:

if(PortaoBuzina[playerid] == 0)

Linha do Erro


Re: error 001: expected token: ";", but found "if" - DelK - 02.11.2017

@Edit nгo precisa Rodrigo resolveu para vocк.


Re: error 001: expected token: ";", but found "if" - RodrigoMSR - 02.11.2017

PHP код:
new params[128
Substitua por:
PHP код:
new params[128];