Hallo,
ich benutze das GarHouseSystem, aber habe dazu eine Frage.
Man spawnt in seinem Haus nur, wenn man es dort auch verlassen hat, das möchte ich aussschalten, so dass man immer in seinem Haus spawnt, egal ob man nun im Haus ist oder nicht, ich poste mal die Codes, denn da blick ich leider nicht durch
}
forward HouseSpawning(playerid);
public HouseSpawning(playerid)
{
new file[HOUSEFILE_LENGTH];
Loop(h, MAX_HOUSES)
{
if(!strcmp(GetHouseOwner(h), pNick(playerid), CASE_SENSETIVE))
{
format(file, sizeof(file), FILEPATH, h);
if(dini_Int(file, "QuitInHouse") == 1)
{
SetPVarInt(playerid, "IsInHouse", 1);
SetPVarInt(playerid, "LastHouseCP", h);
SetPlayerHouseInterior(playerid, h);
#if defined GH_HOUSECARS
LoadHouseCar(h);
#endif
SendClientMessage(playerid, COLOUR_INFO, I_HMENU);
dini_IntSet(file, "QuitInHouse", 0);
#if defined GH_DEBUGGING
printf(DEBUG_OP_SPAWN, pNick(playerid), playerid);
#endif
}
}
}
SetPVarInt(playerid, "FirstSpawn", 1);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new file[HOUSEFILE_LENGTH];
format(file, sizeof(file), FILEPATH, GetPVarInt(playerid, "LastHouseCP"));
if(!strcmp(GetHouseOwner(GetPVarInt(playerid, "LastHouseCP")), pNick(playerid), CASE_SENSETIVE) && GetPVarInt(playerid, "IsInHouse") == 1 && dini_Exists(file))
{
dini_IntSet(file, "QuitInHouse", 1);
#if defined GH_HOUSECARS
SaveHouseCar(GetPVarInt(playerid, "LastHouseCP"));
UnloadHouseCar(GetPVarInt(playerid, "LastHouseCP"));
#endif
#if defined GH_DEBUGGING
printf(DEBUG_OP_DISCONNECT, pNick(playerid), playerid);
#endif
}
return 1;
}
public OnFilterScriptExit()
{
new file[HOUSEFILE_LENGTH], tmp;
Loop(i, MAX_PLAYERS)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
tmp = GetPVarInt(i, "LastHouseCP");
format(file, sizeof(file), FILEPATH, tmp);
if(!strcmp(GetHouseOwner(tmp), pNick(i), CASE_SENSETIVE) && GetPVarInt(i, "IsInHouse") == 1 && dini_Exists(file))
{
dini_IntSet(file, "QuitInHouse", 1);
#if defined GH_HOUSECARS
SaveHouseCar(tmp);
#endif
}
}
}
UnloadHouses(); // Unload houses (also unloads the house cars)
print("\n>> GarHouse v1.3 By [03]Garsino Unloaded <<\n");
return 1;
}
Ich hoffe da kann mir jemand helfen, ich wäre euch sehr dankbar