0 Üye ve 1 Ziyaretçi konuyu incelemekte.
function updatePlayerBlips() if not g_PlayerData then return end local wnd = isWindowOpen(wndSpawnMap) and wndSpawnMap or wndSetPos local mapControl = getControl(wnd, 'map') for elem,player in pairs(g_PlayerData) do if not player.gui.mapBlip then player.gui.mapBlip = guiCreateStaticImage(0, 0, 9, 9, elem == g_Me and 'localplayerblip.png' or 'playerblip.png', false, mapControl) player.gui.mapLabelShadow = guiCreateLabel(0, 0, 100, 14, player.name, false, mapControl) local labelWidth = guiLabelGetTextExtent(player.gui.mapLabelShadow) guiSetSize(player.gui.mapLabelShadow, labelWidth, 14, false) guiSetFont(player.gui.mapLabelShadow, 'default-normal') guiLabelSetColor(player.gui.mapLabelShadow, 255, 255, 255) player.gui.mapLabel = guiCreateLabel(0, 0, labelWidth, 14, player.name, false, mapControl) guiSetFont(player.gui.mapLabel, 'default-normal') guiLabelSetColor(player.gui.mapLabel, 0, 0, 0) for i,name in ipairs({'mapBlip', 'mapLabelShadow'}) do addEventHandler('onClientGUIDoubleClick', player.gui[name], function() server.warpMe(elem) closeWindow(wnd) end, false ) end end local x, y = getElementPosition(elem) x = math.floor((x + 3000) * g_MapSide / 6000) - 4 y = math.floor((3000 - y) * g_MapSide / 6000) - 4 guiSetPosition(player.gui.mapBlip, x, y, false) guiSetPosition(player.gui.mapLabelShadow, x + 14, y - 4, false) guiSetPosition(player.gui.mapLabel, x + 13, y - 5, false) endend
function warpMe(targetPlayer) if isPedDead(source) then spawnMe() end local vehicle = getPedOccupiedVehicle(targetPlayer) local interior = getElementInterior(targetPlayer) if not vehicle then local x, y, z = getElementPosition(targetPlayer) clientCall(source, 'setPlayerPosition', x + 2, y, z) setElementInterior(source, interior) setCameraInterior(source, interior) else if getPedOccupiedVehicle(source) then outputChatBox('Get out of your vehicle first.', source) return end local numseats = getVehicleMaxPassengers(vehicle) for i=0,numseats do if not getVehicleOccupant(vehicle, i) then if isPedDead(source) then local x, y, z = getElementPosition(vehicle) spawnMe(x + 4, y, z + 1) end local dimLocal = getElementDimension(source) for k,v in ipairs(getElementsByType("player")) do local dimRoot = getElementDimension(v) if not dimLocal == dimRoot then outputChatBox('Bu oyuncu başka bir boyutta', source) return end end setElementInterior(source, interior) setCameraInterior(source, interior) warpPedIntoVehicle(source, vehicle, i) return end end outputChatBox('No free seats left in ' .. getPlayerName(targetPlayer) .. '\'s vehicle.', source, 255, 0, 0) endend
local dimLocal = getElementDimension(source) for k,v in ipairs(getElementsByType("player")) do local dimRoot = getElementDimension(v) if not dimLocal == dimRoot then outputChatBox('Bu oyuncu başka bir boyutta', source) return end end
function warpMe(targetPlayer) if getElementDimension(targetPlayer)==getElementDimension(source) then if isPedDead(source) then spawnMe() end local vehicle = getPedOccupiedVehicle(targetPlayer) local interior = getElementInterior(targetPlayer) if not vehicle then local x, y, z = getElementPosition(targetPlayer) clientCall(source, 'setPlayerPosition', x + 2, y, z) setElementInterior(source, interior) setCameraInterior(source, interior) else if getPedOccupiedVehicle(source) then outputChatBox('Get out of your vehicle first.', source) return end local numseats = getVehicleMaxPassengers(vehicle) for i=0,numseats do if not getVehicleOccupant(vehicle, i) then if isPedDead(source) then local x, y, z = getElementPosition(vehicle) spawnMe(x + 4, y, z + 1) end setElementInterior(source, interior) setCameraInterior(source, interior) warpPedIntoVehicle(source, vehicle, i) return end end end