hInfo[h][Locked] = 1; INI_WriteInt(file, "Locked", 1);
if(hInfo[houseid][Locked] == 1)
{
SendClientMessage(playerid,COLOR_RED,"This house is locked!");
}
if(hInfo[houseid][Locked] == 0)
{
new _int = hInfo[houseid][HouseInterior];
SetPVarInt(playerid, "IsInHouse", 1), IsInHouse{playerid} = 1;
SetPlayerPosEx(playerid, hIntInfo[_int][IntSpawnX], hIntInfo[_int][IntSpawnY], hIntInfo[_int][IntSpawnZ], hIntInfo[_int][IntInterior], (houseid + 1000));
SetPlayerFacingAngle(playerid, hIntInfo[_int][IntSpawnAngle]);
}
if(hInfo[houseid][Locked] == 0)
{
SendClientMessage(playerid,COLOR_RED,"This house is locked!");
}
if(hInfo[houseid][Locked] == 1)
{
new _int = hInfo[houseid][HouseInterior];
SetPVarInt(playerid, "IsInHouse", 1), IsInHouse{playerid} = 1;
SetPlayerPosEx(playerid, hIntInfo[_int][IntSpawnX], hIntInfo[_int][IntSpawnY], hIntInfo[_int][IntSpawnZ], hIntInfo[_int][IntInterior], (houseid + 1000));
SetPlayerFacingAngle(playerid, hIntInfo[_int][IntSpawnAngle]);
}

if(hInfo[houseid][Locked] == 1)
{
SendClientMessage(playerid,COLOR_RED,"This house is locked!");
}
if(hInfo[houseid][Locked] == 0)
{
new _int = hInfo[houseid][HouseInterior];
SetPVarInt(playerid, "IsInHouse", 1), IsInHouse{playerid} = 1;
SetPlayerPosEx(playerid, hIntInfo[_int][IntSpawnX], hIntInfo[_int][IntSpawnY], hIntInfo[_int][IntSpawnZ], hIntInfo[_int][IntInterior], (houseid + 1000));
SetPlayerFacingAngle(playerid, hIntInfo[_int][IntSpawnAngle]);
}
if(hInfo[houseid][Locked] == 1)
return SendClientMessage(playerid,COLOR_RED,"This house is locked!");
else
{
new _int = hInfo[houseid][HouseInterior];
SetPVarInt(playerid, "IsInHouse", 1), IsInHouse{playerid} = 1;
SetPlayerPosEx(playerid, hIntInfo[_int][IntSpawnX], hIntInfo[_int][IntSpawnY], hIntInfo[_int][IntSpawnZ], hIntInfo[_int][IntInterior], (houseid + 1000));
SetPlayerFacingAngle(playerid, hIntInfo[_int][IntSpawnAngle]);
return 1;
}
if(hInfo[houseid][Locked] == 1) return SendClientMessage(playerid,COLOR_RED,"This house is locked!");
new _int = hInfo[houseid][HouseInterior];
SetPVarInt(playerid, "IsInHouse", 1), IsInHouse{playerid} = 1;
SetPlayerPosEx(playerid, hIntInfo[_int][IntSpawnX], hIntInfo[_int][IntSpawnY], hIntInfo[_int][IntSpawnZ], hIntInfo[_int][IntInterior], (houseid + 1000));
SetPlayerFacingAngle(playerid, hIntInfo[_int][IntSpawnAngle]);
|
pawn Код:
|
if(hInfo[houseid][Locked] == 0) return SendClientMessage(playerid,COLOR_RED,"This house is locked!");
enum Data
{
HousePassword,
HouseOwner[MAX_PLAYER_NAME],
HouseName[MAX_HOUSE_NAME],
HouseLocation[MAX_ZONE_NAME],
Float:SpawnOutAngle,
SpawnInterior,
SpawnWorld,
Float:CPOutX,
Float:CPOutY,
Float:CPOutZ,
Float:SpawnOutX,
Float:SpawnOutY,
Float:SpawnOutZ,
HouseValue,
HouseStorage,
HouseInterior,
HouseCar,
HouseCarModel,
HouseCarWorld,
HouseCarInterior,
Float:HouseCarPosX,
Float:HouseCarPosY,
Float:HouseCarPosZ,
Float:HouseCarAngle,
QuitInHouse,
Locked,
Weapon[14],
Ammo[14],
ForSale,
ForSalePrice,
HousePrivacy,
HouseAlarm,
HouseCamera,
HouseDog,
UpgradedLock
}
//createhouse
fcreate(HouseFile(h));
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Angle);
new world = GetPlayerVirtualWorld(playerid), interior = GetPlayerInterior(playerid);
hInfo[h][CPOutX] = X, hInfo[h][CPOutY] = Y, hInfo[h][CPOutZ] = Z;
format(hInfo[h][HouseName], MAX_HOUSE_NAME, "%s", DEFAULT_HOUSE_NAME);
format(hInfo[h][HouseOwner], MAX_PLAYER_NAME, "%s", INVALID_HOWNER_NAME);
format(hInfo[h][HouseLocation], MAX_ZONE_NAME, "%s", GetHouseLocation(h));
hInfo[h][HousePassword] = udb_hash("INVALID_HOUSE_PASSWORD");
hInfo[h][HouseValue] = cost, hInfo[h][HouseStorage] = 0,hInfo[h][Locked] = 1;
new INI:file = INI_Open(HouseFile(h));
INI_WriteFloat(file, "CPOutX", X);
INI_WriteFloat(file, "CPOutY", Y);
INI_WriteFloat(file, "CPOutZ", Z);
INI_WriteString(file, "HouseName", DEFAULT_HOUSE_NAME);
INI_WriteString(file, "HouseOwner", INVALID_HOWNER_NAME);
INI_WriteString(file, "HouseLocation", hInfo[h][HouseLocation]);
INI_WriteInt(file, "HousePassword", hInfo[h][HousePassword]);
INI_WriteString(file, "HouseCreator", pNick(playerid));
INI_WriteInt(file, "HouseValue", cost);
INI_WriteInt(file, "HouseStorage", 0);//this variable works great.
INI_WriteInt(file, "Locked", 1);
//enterhouse command
stock SetPlayerHouseInterior(playerid, houseid)
{
if(hInfo[houseid][Locked] == 1) return SendClientMessage(playerid,COLOR_RED,"This house is locked!");//change this to 0 and its working .Wtf.
new _int = hInfo[houseid][HouseInterior];
SetPVarInt(playerid, "IsInHouse", 1), IsInHouse{playerid} = 1;
SetPlayerPosEx(playerid, hIntInfo[_int][IntSpawnX], hIntInfo[_int][IntSpawnY], hIntInfo[_int][IntSpawnZ], hIntInfo[_int][IntInterior], (houseid + 1000));
SetPlayerFacingAngle(playerid, hIntInfo[_int][IntSpawnAngle]);
return 1;
}
//Scriptfiles house file:
CPOutX = -1978.378295
CPOutY = 1120.322387
CPOutZ = 53.012535
HouseName = House For Sale!
HouseOwner = INVALID_PLAYER_ID
HouseLocation = Downtown San Fierro
HousePassword = 1289815741
HouseCreator = [E.N.D.]Admigo
HouseValue = 100000
HouseStorage = 0
Locked = 1
SpawnOutX = -1980.870727
SpawnOutY = 1120.128295
SpawnOutZ = 53.012535
SpawnOutAngle = 454.453063
SpawnWorld = 0
SpawnInterior = 0
HouseInterior = 0
|
WTF... You've posted only the thing that saves the Variables in the Files... But there isn't the Load Function
![]() |