Jakepankeke Posted March 6, 2015 Share Posted March 6, 2015 Me podrian ayudar con este script? addCommandHandler ( "eventmark", function ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then local x, y, z = getElementPosition ( thePlayer ) local eventmarker = createMarker ( x, y , z+1, "checkpoint", 5, 255, 255, 255, 150 ) blipinevent = createBlipAttachedTo( eventmarker, 53 ) end end ) addCommandHandler ( "noeventmark", function ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if isElement(eventmarker) then destroyElement(eventmarker) end if isElement(blipinevent) then destroyElement(blipinevent) end end end ) Lo que quiero es que los admines al momento de poner el comando les cree un checpoint con un blip para hacer evento de carrera no se como hacerlo para que salgan varios con un solo comando me podrian ayudar y al momento de destruirlos que se vayan todos los que creo y tambien al desconectarse el que hiso el evento se borre todo para evitar los bugs Les agradeceria muchisimo con esto Link to comment
Tomas Posted March 6, 2015 Share Posted March 6, 2015 (edited) Sin testear markers = {element = {}, blip = {} } addCommandHandler ( "eventmark", function ( thePlayer ) if isAdmin(thePlayer) then local x, y, z = getElementPosition ( thePlayer ) local markers.element[thePlayer] = createMarker ( x, y , z+1, "checkpoint", 5, 255, 255, 255, 150 ) local markers.blip[thePlayer] = createBlipAttachedTo(markers.element[thePlayer], 53 ) end end ) addCommandHandler ( "noeventmark", function ( thePlayer ) if isAdmin(thePlayer) then for index,value in ipairs(getElementsByType("marker")) do if markers.element[thePlayer] == value and then destroyElement(markers.element[thePlayer]) destroyElement(markers.blip[thePlayer]) end end end end ) function isAdmin(player) return isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( "Admin" ) ) end addEventHandler("onPlayerQuit",root, function() if isAdmin(source) then for index,value in ipairs(getElementsByType("marker")) do if markers.element[source] == value and then destroyElement(markers.element[source]) destroyElement(markers.blip[source]) end end end end ) Edited March 7, 2015 by Guest Link to comment
Castillo Posted March 7, 2015 Share Posted March 7, 2015 markers = {element = {} blip = {} } Te olvidaste de la coma. Link to comment
Tomas Posted March 7, 2015 Share Posted March 7, 2015 markers = {element = {} blip = {} } Te olvidaste de la coma. oh lel, ty Link to comment
Jakepankeke Posted March 7, 2015 Author Share Posted March 7, 2015 Bueno lo he probado y sale error asi : Loading script failed expected near ^blip^ Link to comment
Enargy, Posted March 7, 2015 Share Posted March 7, 2015 markers = {element = {}, blip = {} } Pon la coma ',' entre element y blip. Link to comment
Recommended Posts