Hello,
I'm scripting my police fraction at the moment. I wanted to make a /tie command so that the police can shakle the player on the back seat, so that he can't get out of the car. I've tried it with this code:
function fesseln(player)
outputChatBox("Gefangener im Auto gefesselt",player, 255, 255, 0)
local playerTeam = getPlayerTeam ( player )
if (playerTeam == Polizei or playerTeam == FBI or PlayerTeam == Army) then
if isPedInVehicle(player) == true then
vehicle = getPedOccupiedVehicle(player)
if ( policeVehicles[getElementModel ( vehicle )] ) then
gefangener = getVehicleOccupant(vehicle, 2)
setElementFrozen(gefangener, true)
end
end
end
end
addCommandHandler("tie", fesseln)
Thats where the police Vehicles are defined:
policeVehicles = { [598]=true, [596]=true, [597]=true, [599]=true }
But the player can exit the car!
Can someone help me to fix it?