Hallo Leute
ich habe ein Script gefunden das einen mit Raketen beschiest wenn man in einen Bereich kommt..
Meine Frage ist jetzt wie man es machen kann das die Raketen erst starten wenn man in einen Marker gegangen ist und auch wieder aufhören wenn man erneut in den Marker gegangen ist...
Ist dies möglich?
Script:
Client:
g_loc_pla = getLocalPlayer ()
g_loc_root = getRootElement ()
addEvent ( "destroyTrepassor", true )
addEventHandler ( "destroyTrepassor", g_loc_root,
function ()
posX = 250.92265319824
posY = -1963.8995361328
posZ = 65
local isInResArea = getElementData ( g_loc_pla, "inRestrictedArea" )
rotZ = getPedRotation ( g_loc_pla )
if isInResArea == "true" then
timer1 = setTimer ( createProjectile, 2000, 0, g_loc_pla, 20, posX, posY, posZ, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 )
end
end
)
addEvent ( "destroyTimers", true )
addEventHandler ( "destroyTimers", g_loc_root,
function ()
local isInResArea = getElementData ( g_loc_pla, "inRestrictedArea" )
if isInResArea == "false" then
killTimer ( timer1 )
end
end
)
Alles anzeigen
Server:
g_base_col = createColCuboid ( 130.09884643555, -2079.8127441406, 0.5, 250, 280, 120 )
g_root = getRootElement ()
function hit ( pla )
if getElementType ( pla ) == "player" then
if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(pla)), aclGetGroup ( "Admin" ) ) then
outputChatBox ( "Welcome, "..getPlayerName(pla).."!", pla, 0, 150, 0 )
else
setElementData ( pla, "inRestrictedArea", "true" )
triggerClientEvent ( pla, "destroyTrepassor", g_root, pla )
outputChatBox ( "***Admin Area***", pla, 255, 0, 0 )
outputChatBox ( "* "..getPlayerName(pla).." has entered Admin Area!", g_root, 255, 0, 0 )
end
end
end
addEventHandler ( "onColShapeHit", g_base_col, hit )
function leave ( pla )
if getElementType ( pla ) == "player" then
if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(pla)), aclGetGroup ( "Admin" ) ) then
outputChatBox ( "Good Bye!", pla, 0, 100, 0 )
else
setElementData ( pla, "inRestrictedArea", "false" )
triggerClientEvent ( pla, "destroyTimers", g_root, pla )
outputDebugString ( "*"..getPlayerName(pla).." has left col shape" )
outputChatBox ( "* "..getPlayerName(pla).." has left Admin Area!", g_root, 255, 0, 0 )
end
end
end
addEventHandler ( "onColShapeLeave", g_base_col, leave )
Alles anzeigen