GTA Közösség - A magyar GTA fórum

Multi Theft Auto (MTA) => MTA: Szerverfejlesztés => Archívum => A témát indította: Michael - 2014. július 16. - 20:06:45

Cím: Carshop-System
Írta: Michael - 2014. július 16. - 20:06:45
Hello!A carshop-system bugos!Azt írja túl sok kocsid van de már beraktam egy csomó c_vehicle_globals-t meg s_vehicle_global-t
de mi a baj?
Cím: Carshop-System
Írta: Martin - 2014. július 16. - 20:47:51
Jó lesz, használd ezt.
c_vehicle_globals
 
 local factor = 1.5
function relateVelocity(speed)
return factor * speed
end
function getVehicleVelocity(vehicle)
speedx, speedy, speedz = getElementVelocity (vehicle)
return relateVelocity((speedx^2 + speedy^2 + speedz^2)^(0.5)*100)
end

 
s_vehicle_globals
 
 function getVehiclesOwnedByCharacter(thePlayer)
local dbid = tonumber(getElementData(thePlayer, \"dbid\"))
local carids = { }
local numcars = 0
local indexcars = 1
for key, value in ipairs(exports.pool:getPoolElementsByType(\"vehicle\")) do
local owner = tonumber(getElementData(value, \"owner\"))
if (owner) and (owner==dbid) then
   local id = getElementData(value, \"dbid\")
   carids[numcars+1] = id
   numcars = numcars + 1
end
end
return numcars, carids
end
function canPlayerBuyVehicle(thePlayer)
if (isElement(thePlayer)) then
if getElementData(thePlayer, \"loggedin\") == 1 then
   local maxvehicles = getElementData(thePlayer, \"maxvehicles\") or 0
   local novehicles, veharray = getVehiclesOwnedByCharacter(thePlayer)
   if (novehicles < maxvehicles) then
      return true
   end
   return false, \"Túl sok jármű\"
end
return false, \"Játékos nincs bejelentkezve\"
end
return false, \"Element not found\"
end
Cím: Carshop-System
Írta: Michael - 2014. július 17. - 19:20:42
Köszi
Cím: Carshop-System
Írta: Martin - 2014. július 17. - 19:29:20
Nincsmit. :)
Cím: Carshop-System
Írta: Toxic - 2014. augusztus 12. - 15:47:32
[mod]Megoldódott, zárom.[/mod]