Bully-Board
Bully Modding Section => Modding Questions/Help => Topic started by: Poters on September 01, 2021, 07:17:36 AM
-
hii guys, I'm making a mod where players can steal Ped's car, but here I have a problem, maybe this is a serious problem for me..
so can you see where is the error in this Script?, I am 100% sure there is nothing wrong with this Script but why is the code "if not PedIsInVehicle(NPC, VEH) then" not working?
but if I remove the word no, and it becomes "if PedIsInVehicle(NPC, VEH) then", it's safe, works fine..
can someone know where is the error in this Script?, I will be very happy if any of you can find where the error is, because I myself can't solve this mod despite using many ways.
function Car()
while true do
Wait(0)
local FIND = VehicleFindInAreaXYZ(0, 0, 0, 999999)
if type(FIND) == "table" then
for V, VEH in ipairs(FIND) do
if VehicleIsValid(VEH) then
if not VehicleIsModel(VEH, 272) and not VehicleIsModel(VEH, 273) and not VehicleIsModel(VEH, 274) and not VehicleIsModel(VEH, 275) and not VehicleIsModel(VEH, 276) and not VehicleIsModel(VEH, 277) and not VehicleIsModel(VEH, 278) and not VehicleIsModel(VEH, 279) and not VehicleIsModel(VEH, 280) and not VehicleIsModel(VEH, 281) and not VehicleIsModel(VEH, 282) and not VehicleIsModel(VEH, 283) and not VehicleIsModel(VEH, 284) and not VehicleIsModel(VEH, 289) then
for N, NPC in {PedFindInAreaXYZ(0, 0, 0, 999999)} do
if not PedIsInVehicle(NPC, VEH) then
VX, VY, VZ = VehicleGetPosXYZ(VEH)
X, Y, Z = PlayerGetPosXYZ()
if math.abs(VX - X) + math.abs(VY - Y) + math.abs(VZ - Z) <= 4.2 and not PlayerIsInAnyVehicle() and not PedHasWeapon(gPlayer, 437) and IsButtonBeingPressed(15,0) then
repeat
Wait(0)
PedWarpIntoCar(gPlayer, VEH)
until PedIsInVehicle(gPlayer, VEH)
end
end
end
end
end
end
end
end
end
-
Because this is an iterator, if Ped is not in a vehicle in the table, it will return another Vehicle ID, so it should be
if not PedIsInAnyVehicle(NPC)
-
Hii, mhdt..
I've tried this method before, but because I was still unsure so I tried to do it again, but after I tried it it was true, it still didn't work..
is there no other way to solve this?, because this is really a serious problem, I want you to try the scripts yourself, work or not. because I tried it in Bully AE game not SE
-
are you also unable to find the Solution?
-
You meaning you wanna Kick out the driver?
-
I want to make a mod, when Ped is in the car, the Player will not be able to enter the car, and if Ped is no longer in the car, we can already enter the car.
-
It seems that Untitled has the source code of this function
-
I want to do this mod , too
I think you can make a function that allows the player to pull the ped out of the car