Bully-Board
Bully Modding Section => Modding Questions/Help => Modding Questions/Help Archives => Topic started by: Mick3Mouse on December 26, 2013, 05:48:21 PM
-
Deleteped = function()
local LockOnPed = PedGetTargetPed()
if IsButtonPressed(10,0) and IsButtonPressed(12,0) and LockOnPed > -1 and LockOnPed is not (PEDNAME) then
PedDelete(LockOnPed)
end
end
So if i lockon a my spawned ped, and press (12,0) he will not delete. But if i lock on normal ped. it will delete that ped.
-
Try this:
Deleteped = function()
local LockOnPed = PedGetTargetPed()
if IsButtonPressed(10,0) and IsButtonPressed(12,0) then
PedDelete(LockOnPed)
end
end
I eliminated some of your extra code for the button pressed line and this should pretty much do the trick. If it doesn't then you will need to add some extra code that checks for the targeted ped with the targeted ped defined using other code....maybe using math.random probably.
-
Try this:
Deleteped = function()
local LockOnPed = PedGetTargetPed()
if IsButtonPressed(10,0) and IsButtonPressed(12,0) then
PedDelete(LockOnPed)
end
end
I eliminated some of your extra code for the button pressed line and this should pretty much do the trick. If it doesn't then you will need to add some extra code that checks for the targeted ped with the targeted ped defined using other code....maybe using math.random probably.
My first code will work. But i need a code that checks if LockOnPed is not a spefific ped, So if lockon is Ped1 and i press (12,9) he will not be deleted
-
Try PedGetModel()
-
You could try something along thse lines:
Deleteped = function()
local LockOnPed = PedGetTargetPed()
if IsButtonPressed(10,0) and IsButtonPressed(12,0) and PedGetModel() -= nil then
PedDelete(LockOnPed)
end
end
This is just a example and not exactly full working code....just something real quick to maybe give you a couple ideas. :biggrin:
-
A more complicated way to use that code would be to use it this way which relies VERY heavily upon locals.....but this does more or less what you want.
local l_47_15 = l_0_21
l_0_39 = PedFindInAreaXYZ(l_47_8, l_47_9, l_47_10, 1.5)
l_47_11[1], l_47_12[2], l_47_13[3], l_47_14[4], l_47_15[5] =
l_47_11 = l_0_39
if l_47_11 then
l_47_11 = l_0_21
l_47_12 = nil
l_47_13 = nil
l_47_14 = nil
for l_47_14 = l_47_11, l_47_12, l_47_13 do
end
end
l_47_15 = PedIsValid
l_47_15 = l_47_15(l_47_14)
if l_47_15 then
l_47_15 = PedGetModel
local l_47_16 = true
for l_47_20 = l_0_27, nil, nil do
if l_47_20 == l_47_14 then
l_47_16 = false
else
end
end