Szerző Téma: MTA Dayz SafeZone  (Megtekintve 1026 alkalommal)

MTA Dayz SafeZone
« Dátum: 2016. március 15. - 11:00:13 »
0 Show voters
Üdv olyan kérdésem lenne,hogy tudnám megoldani azt,hogy ha belép valaki safezoneba akkor csak neki írja ki és csak rá hasson az adot script?És zombik ne spawnoljanak oda?
 
local screenW, screenH = guiGetScreenSize()
    function zoneText()
      dxDrawRectangle(695, 561, 91, 20, tocolor(247, 255, 245, 62), false)
        dxDrawText(\"Safe Zone\", 718, 562, 777, 579, tocolor(0, 0, 0, 255), 1.30, \"default-bold\", \"right\", \"top\", true, true, false, true, false)
        dxDrawText(\"Safe Zone\", screenW * 0.896, screenH * 0.935, screenW * 0.970, screenH * 0.963, tocolor(53, 255, 0, 255), 1.30, \"default-bold\", \"right\", \"top\", true, true, false, true, false)
    end
zoneLS = createColRectangle(1150.05579, -1390.17407,100,100)
zoneLV = createColRectangle(1577.66418, 1723.38440,65,150)
zoneSF = createColRectangle(-2740.70898, 578.36127,144,120)
zoneColorLS = createRadarArea (1150.05579, -1390.17407,100,100,255,255,255)
zoneColorLV = createRadarArea (1577.66418, 1723.38440,65,150,255,255,255)
zoneColorSF = createRadarArea (-2740.70898, 578.36127,144,120,255,255,255)
function PlayerD()
cancelEvent ()
end
function hit(element)
if source == zoneLS or source == zoneLV or source == zoneSF then
if (getElementType (element) == \"vehicle\") then
triggerServerEvent (\"del\",localPlayer,element)
elseif (getElementType (element) == \"player\") then
outputChatBox (\"you are now in Safe Zone \",255,0,0,true)
addEventHandler(\"onClientRender\", root,zoneText)
addEventHandler (\"onClientPlayerDamage\",getRootElement(),PlayerD)
toggleControl (\"next_weapon\",false)
toggleControl (\"previous_weapon\",false)
toggleControl (\"fire\",false)
setPlayerWeaponSlot (element,0)
end
end
end
function Leave()
if source == zoneLS or source == zoneLV or source == zoneSF then
outputChatBox (\"I\'ve left the safe zone \",255,0,0,true)
removeEventHandler(\"onClientRender\", root,zoneText)
removeEventHandler (\"onClientPlayerDamage\",getRootElement(),PlayerD)
toggleControl (\"next_weapon\",true)
toggleControl (\"previous_weapon\",true)
toggleControl (\"fire\",true)
end
end
addEventHandler (\"onClientColShapeLeave\",root,Leave)
addEventHandler (\"onClientColShapeHit\",root,hit)
« Utoljára szerkesztve: 2016. március 17. - 20:58:20 írta ǝuıןʎʞs »

MTA Dayz SafeZone
« Válasz #1 Dátum: 2016. március 17. - 19:26:17 »
0 Show voters
Csak neki írja ki? Használj localPlayer-t.   :D
Pl:.
function teszt( localPlayer )
 outputChatbox(\"test\", localPlayer, 0, 255, 255, true)
end

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal