09.01.2012, 19:17
Whenever i create the house, ill write in it immediately. Aswell as you buy/sell the house, it just changes the name etc.
Example file after creation:
Edit:
I actually noticed i didnt have INI_SetTag, added everywhere where it was needed, still not working
pawn Код:
stock CreateHouse( playerid, price, owned, Float:x, Float:y, Float:z, virtualworld, ownername[])
{
new id = HouseCount, INI:pFile = INI_Open(hPath(id)), Label[128];
HouseInfo[id][Price] = price;
HouseInfo[id][Owned] = owned;
HouseInfo[id][XPos] = x;
HouseInfo[id][YPos] = y;
HouseInfo[id][ZPos] = z;
HouseInfo[id][VirtualWorld] = virtualworld;
strset( HouseInfo[id][Owner], ownername );
HouseEnter[id] = CreateDynamicCP( x, y, z, 1.5, GetPlayerVirtualWorld( playerid ) );
HouseExit[id] = CreateDynamicCP( 443.9237, 509.4609, 1001.4195, 1.5, virtualworld );
INI_WriteInt( pFile, "Prijs", price );
INI_WriteInt( pFile, "Owned", 0 );
INI_WriteInt( pFile, "Virtualworld", GetPlayerVirtualWorld( playerid ) );
INI_WriteFloat( pFile, "Pickup_X", x );
INI_WriteFloat( pFile, "Pickup_Y", y );
INI_WriteFloat( pFile, "Pickup_Z", z );
INI_WriteString( pFile, "Eigenaar", "HeeftGeenEigenaar" );
INI_WriteBool( pFile, "Locked", true );
INI_Close( pFile );
switch( owned )
{
case 0: format( Label, sizeof Label, "Dit huis is nog te koop! \nHuis ID: %i \nEigenaar: N/A \nPrijs: $%i", id, price );
case 1: format( Label, sizeof Label, "Huis ID: %i \nEigenaar: %s \nPrijs: $%i", id, ownername, price );
}
HouseInfo[id][HouseLabel] = Create3DTextLabel( Label, COLOR_GREEN, x, y, z, 25.0, GetPlayerVirtualWorld( playerid ) );
HouseCount ++;
return 1;
}
Код:
Prijs = 100 Owned = 0 Virtualworld = 0 Pickup_X = 2259.464599 Pickup_Y = -86.412368 Pickup_Z = 26.499542 Eigenaar = HeeftGeenEigenaar Locked = true
I actually noticed i didnt have INI_SetTag, added everywhere where it was needed, still not working