Sziasztok! Nos lenne megint egy problémám kezdtem írni egy házrendszert de sajnos nem tölti be a házakat pedig létrehozza és a betöltésnél pedig nem jó restart útán eltünik
. Itt a betöltés:
stock LoadHouses()//Creating the stock function
{
new file[60],houseowner[24];//creating the \"file\" var. And also creating the \"houseowner\" var so we can store it, when we are reading the house owner ini line.
for(new i = 0; i < MAX_HOUSES;i++)//Looping threw every house
{
format(file,sizeof(file),\"ladmin/haz/%i.ini\",i);//Opening the house file with the current selected number with \"i\".
if(!INI_Exist(file)) continue;//Checking if the ini house file exist, if not to stop there.
INI_Open(file);//Opening the house ini
HInfo[Price] = INI_ReadInt(\"Price\");//Reading the price.
HInfo[Owned] = INI_ReadInt(\"Owned\");//Reading if it\'s owned.
HInfo[XPos] = INI_ReadInt(\"XPos\");//Reading the X float position.
HInfo[YPos] = INI_ReadInt(\"YPos\");//Reading the Y float position.
HInfo[ZPos] = INI_ReadInt(\"ZPos\");//Reading the Z float position.
HInfo[VirtualWorld] = INI_ReadInt(\"VirtualWorld\");//Reading the virtual world.
INI_ReadString(houseowner,\"Owner\");//Reading the house owner.
format(HInfo[Owner],24,\"%s\",houseowner);//Formating the \"Owner\" house id value to the red one.
HouseEnter = CreateDynamicCP(HInfo[XPos],HInfo[YPos],HInfo[ZPos],1.5,HInfo[VirtualWorld]);//Creating the checkpoint and storing it in the HouseEnter value.
HouseExit = CreateDynamicCP(443.9237,509.4609,1001.4195,1.5,HInfo[VirtualWorld]);//Creating the house exit checkpoint and storing it in the HouseExit value.
new labelstring[100];//Creating the labelstring var.
switch(HInfo[Owned])//Using the \"switch\" method to check if the house is owned
{
case 0:{format(labelstring,sizeof(labelstring),\"Ház Eladó \\nÁra: %i\",HInfo[Price]);}//If it isnt...
case 1:{format(labelstring,sizeof(labelstring),\"Ára: %i \\nTulaj: %s\",HInfo[Price],HInfo[Owner]);}//If it is...
}
HInfo[HouseLabel] = Create3DTextLabel(labelstring,0xFF0000FF,HInfo[XPos],HInfo[YPos],HInfo[ZPos],25.0,HInfo[VirtualWorld]);//Creating the label with the formatted string.
HouseCount++;//+ counting the HouseCount var.
INI_Close();//Closing the SII file.
}
return 1;
}
Dupla hozzászólás automatikusan összefûzve. ( 2012. szeptember 30. - 09:08:57 )
Senki?