countPlayersInRange
Function : تـجلب عدد الاعبين الذين قريبين من مكان محدد
* [ Function Syntax ] .,
int countPlayersInRange(float x, float y, float z, float range)
* [ Code ] .,
function countPlayersInRange(x, y, z, range)
if tonumber(x..y..z..range) then
local add = 0
for _, v in ipairs(getElementsByType("player")) do
local px, py, pz = getElementPosition( v )
if getDistanceBetweenPoints3D(px, py, pz, tonumber(x), tonumber(y), tonumber(z)) <= tonumber(range) then
add = add + 1
end
end
return add
else
return false
end
end
ُExample [ مـثال ] .
addCommandHandler('EH10',
function (player)
local number = countPlayersInRange(x, y, z, range)
outputChatBox("Number : " .. number .. " .", player, 255, 0, 0, true)
end
)
{ ( صـفـحة الويكي [
https://wiki.multitheftauto.com/wiki/Co ... ersInRange ] ) } .,