-
Sziasztok!
Hogy oldom azt meg hogy a PPC_Housingba a /park nál ne essen le a tuning??? :D
Én ezt használom:
http://sampforum.hu/index.php?topic=15471.msg176482#msg176482
Köszi elõre a helpet!
-
Ez egy bug benne én is kerestem a hibát de nem tudom énse :S
-
Ez egy bug benne én is kerestem a hibát de nem tudom énse :S
A bug az az ami ott van de mégsem üzemel úgy ahogy kéne.
Gondolom nincs lementve a jármû tuningja, így az nem fog ottmaradni.
A /park parancsot másold be mert nincs kedvem letölteni a PPC_Housing-t.Kösz.
-
A /park:
COMMAND:park(playerid, params[])
{
// Setup local variables
new Float:x, Float:y, Float:z, Float:rot, vid, HouseID, Msg[128];
new engine,lights,alarm,doors,bonnet,boot,objective;
// If a player hasn\'t logged in properly, he cannot use this command
if (INT_IsPlayerLoggedIn(playerid) == 0) return 0;
// Check if the player is inside a vehicle (he must be the driver)
if (GetPlayerVehicleSeat(playerid) == 0)
{
// Get the vehicle-id
vid = GetPlayerVehicleID(playerid);
// Get the HouseID to which this vehicle belongs
HouseID = AVehicleData[vid][belongsToHouse];
// Check if this vehicle belongs to a house (if not, the vehicle cannot be parked, as it\'s not a house-vehicle)
if (HouseID != 0)
{
// Check if the vehicle is in range of the house-entrance (you cannot park a vehicle further away from your house than 150m)
if (IsPlayerInRangeOfPoint(playerid, ParkRange, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]))
{
// Get the player\'s position and angle
GetVehiclePos(vid, x, y, z);
GetVehicleZAngle(vid, rot);
// Save those values for the vehicle
AVehicleData[vid][spawnX] = x;
AVehicleData[vid][spawnY] = y;
AVehicleData[vid][spawnZ] = z;
AVehicleData[vid][spawnRot] = rot;
// Loop through all carslots of this house to find the vehicle-id
for (new CarSlot; CarSlot < 10; CarSlot++)
{
// Check if this carslot holds the same vehicle-id
if (AHouseData[HouseID][VehicleIDs][CarSlot] == vid)
{
House_ReplaceVehicle(HouseID, CarSlot); // Re-create the vehicle at the same spot the player wants to park his vehicle
PutPlayerInVehicle(playerid, AHouseData[HouseID][VehicleIDs][CarSlot], 0);
// Turn on the engine and lights
GetVehicleParamsEx(AHouseData[HouseID][VehicleIDs][CarSlot], engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(AHouseData[HouseID][VehicleIDs][CarSlot], 1, 1, alarm, doors, bonnet, boot, objective);
break; // Stop the for-loop
}
}
// Let the player know he parked his vehicle
SendClientMessage(playerid, 0xFFFFFFFF, \"{00FF00}Leparkoltad a jármûved.\");
// Save the housefile
HouseFile_Save(HouseID);
}
else
{
format(Msg, 128, \"{FFFF00}%iméteren{FF0000} belül kell parkolj a házadhoz közel.\", ParkRange);
SendClientMessage(playerid, 0xFFFFFFFF, Msg);
}
}
else
SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Nem tudod leparkolni a jármûved, mert nem a te tulajdonodban van!\");
}
else
SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Csak jármûben tudod leparkolni a saját jármûvedet.\");
// Let the server know that this was a valid command
return 1;
}
-
new component;
for(new slot = 1; slot <= 13; slot++)
{
component = GetVehicleComponentInSlot(vid,slot);
//component változóba vagy/majd fájlba mentése
}
Nem vágom h itt mi a mentés vagy hogy van, de a fenn leírttal tudsz dolgozni. Az lekéri az összes tuningot. Lehetõleg a mentésnél mindig maradj a kapcsos zárójelen belül.
-
most írd má le 1 kódba vagy illeszd be pls a /park parancsba h mit akarsz :)
-
Ez egy bug benne én is kerestem a hibát de nem tudom énse :S
A bug az az ami ott van de mégsem üzemel úgy ahogy kéne.
Gondolom nincs lementve a jármû tuningja, így az nem fog ottmaradni.
A /park parancsot másold be mert nincs kedvem letölteni a PPC_Housing-t.Kösz.
-
A /park:
COMMAND:park(playerid, params[])
{
// Setup local variables
new Float:x, Float:y, Float:z, Float:rot, vid, HouseID, Msg[128];
new engine,lights,alarm,doors,bonnet,boot,objective;
// If a player hasn\'t logged in properly, he cannot use this command
if (INT_IsPlayerLoggedIn(playerid) == 0) return 0;
// Check if the player is inside a vehicle (he must be the driver)
if (GetPlayerVehicleSeat(playerid) == 0)
{
// Get the vehicle-id
vid = GetPlayerVehicleID(playerid);
// Get the HouseID to which this vehicle belongs
HouseID = AVehicleData[vid][belongsToHouse];
// Check if this vehicle belongs to a house (if not, the vehicle cannot be parked, as it\'s not a house-vehicle)
if (HouseID != 0)
{
// Check if the vehicle is in range of the house-entrance (you cannot park a vehicle further away from your house than 150m)
if (IsPlayerInRangeOfPoint(playerid, ParkRange, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]))
{
// Get the player\'s position and angle
GetVehiclePos(vid, x, y, z);
GetVehicleZAngle(vid, rot);
// Save those values for the vehicle
AVehicleData[vid][spawnX] = x;
AVehicleData[vid][spawnY] = y;
AVehicleData[vid][spawnZ] = z;
AVehicleData[vid][spawnRot] = rot;
// Loop through all carslots of this house to find the vehicle-id
for (new CarSlot; CarSlot < 10; CarSlot++)
{
// Check if this carslot holds the same vehicle-id
if (AHouseData[HouseID][VehicleIDs][CarSlot] == vid)
{
House_ReplaceVehicle(HouseID, CarSlot); // Re-create the vehicle at the same spot the player wants to park his vehicle
PutPlayerInVehicle(playerid, AHouseData[HouseID][VehicleIDs][CarSlot], 0);
// Turn on the engine and lights
GetVehicleParamsEx(AHouseData[HouseID][VehicleIDs][CarSlot], engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(AHouseData[HouseID][VehicleIDs][CarSlot], 1, 1, alarm, doors, bonnet, boot, objective);
break; // Stop the for-loop
}
}
// Let the player know he parked his vehicle
SendClientMessage(playerid, 0xFFFFFFFF, \"{00FF00}Leparkoltad a jármûved.\");
// Save the housefile
HouseFile_Save(HouseID);
}
else
{
format(Msg, 128, \"{FFFF00}%iméteren{FF0000} belül kell parkolj a házadhoz közel.\", ParkRange);
SendClientMessage(playerid, 0xFFFFFFFF, Msg);
}
}
else
SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Nem tudod leparkolni a jármûved, mert nem a te tulajdonodban van!\");
}
else
SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Csak jármûben tudod leparkolni a saját jármûvedet.\");
// Let the server know that this was a valid command
return 1;
}
-
new component;
for(new slot = 1; slot <= 13; slot++)
{
component = GetVehicleComponentInSlot(vid,slot);
//component változóba vagy/majd fájlba mentése
}
Nem vágom h itt mi a mentés vagy hogy van, de a fenn leírttal tudsz dolgozni. Az lekéri az összes tuningot. Lehetõleg a mentésnél mindig maradj a kapcsos zárójelen belül.
-
most írd má le 1 kódba vagy illeszd be pls a /park parancsba h mit akarsz :)