SA-MP Forums Archive
Return 1 - How comes its an ERROR -.- - 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: Return 1 - How comes its an ERROR -.- (/showthread.php?tid=270598)



Return 1 - How comes its an ERROR -.- - Ben7544 - 21.07.2011

I dont know what's wrong with it, but everything I do contains with it more bugs.

Does anyone, know how to fix this?
Here's the error :
PHP код:
(1675) : error 010invalid function or declaration 
Line 1675 itself :
Код:
	return 1;
The whole script connected to the bugged line :
Код:
stock InitHouses()
{
    new FileName[128];
    new labelString[96];
    	for(new h = 0; h < sizeof(Houses); h++)
        {
        format(FileName, sizeof(FileName), "Houses/House_%d.ini", h);
        if(fexist(FileName))
        {
            Houses[h][hInteriorID] = dini_Int(FileName, "InteriorID");
            Houses[h][hInteriorX] = dini_Float(FileName, "InteriorX");
            Houses[h][hInteriorY] = dini_Float(FileName, "InteriorY");
            Houses[h][hInteriorZ] = dini_Float(FileName, "InteriorZ");
            
            Houses[h][HousePrice] = dini_Int(FileName, "HousePrice");
            
            Houses[h][hExteriorID] = dini_Int(FileName, "ExteriorID");
            Houses[h][hExteriorX] = dini_Float(FileName, "ExteriorX");
            Houses[h][hExteriorY] = dini_Float(FileName, "ExteriorY");
            Houses[h][hExteriorZ] = dini_Float(FileName, "ExteriorZ");
  
            Houses[h][VaultMoney] = dini_Int(FileName, "VaultMoney");
            Houses[h][HouseCocaine] = dini_Int(FileName, "HouseCocaine");
            Houses[h][HousePot] = dini_Int(FileName, "HousePot");
            Houses[h][HouseMaterials] = dini_Int(FileName, "HouseMaterials");
            
            Houses[h][hOwner] = dini_Get(FileName, "Owner");
            
            Houses[h][LockStatus] = dini_Int(FileName, "LockStatus");
            
            Houses[h][WeaponSlot1] = dini_Int(FileName, "WeaponSlot1");
            Houses[h][WeaponSlot2] = dini_Int(FileName, "WeaponSlot2");
            Houses[h][WeaponSlot3] = dini_Int(FileName, "WeaponSlot3");
    		new NewHouseID = SpawnedHouses+1;
	        if(strcmp(Houses[h][hOwner], "Nobody", true) == 0)
			{
			format(labelString, sizeof(labelString), "House %d\n Price: %d",NewHouseID, h);
            CreateDynamic3DTextLabel(labelString, ADMIN_GREEN, Houses[NewHouseID][hExteriorX],Houses[NewHouseID][hExteriorY],Houses[NewHouseID][hExteriorZ],30.0,0,1);
			}
            else
            {
			format(labelString, sizeof(labelString), "House %d",NewHouseID);
			Create3DTextLabel(labelString,RED,Houses[NewHouseID][hExteriorX],Houses[NewHouseID][hExteriorY],Houses[NewHouseID][hExteriorZ],30.0,0,1);
			}
            printf("[system] House %d spawned.", h);
            SpawnedHouses++;
	   		}
 		}
	}
	return 1;
}



Re: Return 1 - How comes its an ERROR -.- - JaTochNietDan - 21.07.2011

You would appear to have too many closing brackets, use proper indentation and it will be more obvious in future! The bracket before return 1; is the last closing bracket required to finish that function.


Re: Return 1 - How comes its an ERROR -.- - Ben7544 - 21.07.2011

Ho! so redicolous.
Thank you very much =].