Szerző Téma: Lehal a kliens rész  (Megtekintve 680 alkalommal)

Lehal a kliens rész
« Dátum: 2016. december 31. - 18:39:39 »
0 Show voters
Helló. Ettől a scripttől, a kliens úgy lehal, hogy csak IC chat megy, se ooc, se admin parancsok stb (ha megy nagyon belassul) de reconenct megoldja, gondolom hogy ez kliens oldali lehet. Mi lehet a hiba?
 
 
 
 
 
 
 

function playerAnimationToServer (localPlayer, animName, animtoName, itemID)
setPedAnimation(localPlayer, animName, animtoName, -1, true, false, false, false)
if itemID then
   exports[\'mta_item\']:RemovePlayerDutyItems(localPlayer, itemID)
end
end
addEvent(\"playerAnimationToServer\", true)
addEventHandler(\"playerAnimationToServer\", getRootElement(), playerAnimationToServer)
function removeComponentFromVehicle (player, element,commandName)
triggerClientEvent(getRootElement(), \"player->removeComponentFromVehicleG\", getRootElement(), element, commandName)
end
addEvent(\"player->removeComponentFromVehicle\", true)
addEventHandler(\"player->removeComponentFromVehicle\", getRootElement(), removeComponentFromVehicle)
function updateComponentVehicle (player, element,commandName)
triggerClientEvent(getRootElement(), \"player->updateComponentVehicleG\", getRootElement(), element, commandName)
end
addEvent(\"player->updateComponentVehicle\", true)
addEventHandler(\"player->updateComponentVehicle\", getRootElement(), updateComponentVehicle)
function repairEngine (player, element)
setElementHealth(element, 1000)
end
addEvent(\"player->repairEngine\", true)
addEventHandler(\"player->repairEngine\", getRootElement(), repairEngine)
local object1 = {}
local object = {}
local objectCol = {}
addEventHandler(\"onResourceStart\", getResourceRootElement(getThisResource()), function()
for index, value in ipairs (objectTable) do
   object1[index] = createObject(value[1], value[2], value[3], value[4], 0, 0, 90)
   setElementData(object1[index], \"mechanic:Object\", index)
end   
for index, value in ipairs (objectTable2) do
   object[index] = createObject(value[1], value[2], value[3], value[4]+1.0, 0, 0, 90)
   
   objectCol[index] = createColCuboid(value[2]-1.5, value[3]-1, value[4]-0.5, 3, 2, 3)
   setElementData(objectCol[index], \"mechanic:liftID\", index)
   
   setElementData(object[index], \"mechanic:Object\", index)
   setElementData(object[index], \"moving\", false)
end
end)
function moveObjectFunction(player, object, x, y, z)
local liftID = tonumber(object:getData(\"mechanic:Object\") or 0)
moveObject ( object1[liftID], 10000, x, y, z)
if isTimer(klikkTimerRun) then return end
   setElementData(object, \"moving\", true)
   setElementData(player, \"current\", true)
klikkTimerRun = setTimer(function()
   setElementData(object, \"moving\", false)
   setElementData(player, \"current\", false)
end,10000,1)
end
addEvent(\"moveObjectFunction\", true)
addEventHandler(\"moveObjectFunction\", root, moveObjectFunction)
function attachFunction (vehicle, liftID)
attachElements ( vehicle, object1[liftID], 0, 0, 0.12 , 0, 0, 90)
end
addEvent(\"attachFunction\", true)
addEventHandler(\"attachFunction\", root, attachFunction)
function detachFunction (liftID)
setTimer(function()
   detachElements(liftID)
end, 10000-10, 1)
end
addEvent(\"detachFunction\", true)
addEventHandler(\"detachFunction\", root, detachFunction)
function repairWheel(playerSource, element , fixComponentName)
local fLeftWheel, rLeftWheel, fRightWheel, rRightWheel = getVehicleWheelStates(element)
if (tostring(fixComponentName) == \"wheel_lf_dummy\") then
   fLeftWheel = 0
elseif (tostring(fixComponentName) == \"wheel_lb_dummy\") then
   rLeftWheel = 0
elseif (tostring(fixComponentName) == \"wheel_rf_dummy\") then
   fRightWheel = 0
elseif (tostring(fixComponentName) == \"wheel_rb_dummy\") then
   rRightWheel = 0
end
setVehicleWheelStates(element, fLeftWheel, rLeftWheel, fRightWheel, rRightWheel)
end
addEvent(\"player->repairWheel\", true)
addEventHandler(\"player->repairWheel\", getRootElement(), repairWheel)
function repairPanel(playerSource, element , fixComponentID)
if element and fixComponentID then
   setVehiclePanelState(element, fixComponentID, 0)
end
end
addEvent(\"player->repairPanel\", true)
addEventHandler(\"player->repairPanel\", getRootElement(), repairPanel)
function repairDoors(playerSource, element , fixComponentID)
if element and fixComponentID then
   setVehicleDoorState(element, fixComponentID, 0)
   setVehiclePanelState(element, fixComponentID, 0)
end
end
addEvent(\"player->repairDoors\", true)
addEventHandler(\"player->repairDoors\", getRootElement(), repairDoors)

 
 

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal