Skip to content

Commit 97b77f6

Browse files
committed
Add missing logic to ApplyAnimation, fix typo in it, cast some more stuff in GetVehicleParamsEx and add two more dummy functions
1 parent 8ba27d4 commit 97b77f6

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

amx/server/syscalls.lua

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,12 @@ function AllowPlayerTeleport(amx, player, allow)
279279
end
280280

281281
function ApplyAnimation(amx, player, animlib, animname, fDelta, loop, lockx, locky, freeze, time, forcesync)
282-
setPedAnimation(actor, animlib, animname, time, loop, lockx or locky, false, freeze)
283-
setPedAnimationSpeed(actor, animname, fDelta)
282+
--time = Timer in ms. For a never-ending loop it should be 0.
283+
if time == 0 then
284+
loop = true
285+
end
286+
setPedAnimation(player, animlib, animname, time, loop, lockx or locky, false, freeze)
287+
setPedAnimationSpeed(player, animname, fDelta)
284288
end
285289

286290
function AttachObjectToPlayer(amx, object, player, offsetX, offsetY, offsetZ, rX, rY, rZ)
@@ -299,6 +303,15 @@ function BanEx(amx, player, reason)
299303
banPlayer(player, nil, reason)
300304
end
301305

306+
--Dummy for now
307+
function GetPlayerDrunkLevel(player)
308+
return 0
309+
end
310+
311+
function GetPlayerAnimationIndex(player)
312+
return 0
313+
end
314+
302315
function CallLocalFunction(amx, fnName, fmt, ...)
303316
local args = { ... }
304317
for i=1,math.min(#fmt, #args) do
@@ -2293,8 +2306,8 @@ function GetVehicleParamsEx(amx, vehicle, refEngine, refLights, refAlarm, refDoo
22932306
amx.memDAT[refLights] = getVehicleOverrideLights(vehicle) == 2 and 1 or 0
22942307
amx.memDAT[refAlarm] = g_Vehicles[vehicleID].alarm and 1 or 0
22952308
amx.memDAT[refDoors] = isVehicleLocked(vehicle) and 1 or 0
2296-
amx.memDAT[refBonnet] = getVehicleDoorOpenRatio(vehicle, 0) > 0
2297-
amx.memDAT[refBoot] = getVehicleDoorOpenRatio(vehicle, 1) > 0
2309+
amx.memDAT[refBonnet] = getVehicleDoorOpenRatio(vehicle, 0) > 0 and 1 or 0
2310+
amx.memDAT[refBoot] = getVehicleDoorOpenRatio(vehicle, 1) > 0 and 1 or 0
22982311
amx.memDAT[refObjective] = g_Vehicles[vehicleID].objective or 0
22992312

23002313
return 1

0 commit comments

Comments
 (0)