Jump to content

[ayuda]Con markers


Destroyer.-

Recommended Posts

Posted

La forma mas sencilla para ti, sería algo así:(adapta lo a tus necesidades)

  
inicial = createMarker ( 0, 0, 0,"cylinder", 1.0,0,255,0,150) 
function primergolpe(hitElement, matchingDimension) 
if inicial and getElementType(hitElement) == "player" then 
destroyElement(inicial) 
segundo = createMarker ( 1, 1, 1,"cylinder", 1.0,250,0,0,150) 
end 
end 
addEventHandler( "onMarkerHit", inicial, primergolpe ) 

DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp

 
Posted
  
inicial = createMarker ( 0, 0, 0,"cylinder", 1.0,0,255,0,150) 
function primergolpe(hitElement, matchingDimension) 
if inicial and getElementType(hitElement) == "player" then 
destroyElement(inicial) 
segundo = createMarker ( 1, 1, 1,"cylinder", 1.0,250,0,0,150) 
addEventHandler( "onMarkerHit", segundo, segundogolpe ) 
end 
end 
function segundogolpe(hitElement, matchingDimension) 
if segundo and getElementType(hitElement) == "player" then 
destroyElement(segundo) 
end 
end 
  
addEventHandler( "onMarkerHit", inicial, primergolpe ) 

DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp

 
Posted
  
inicial = createMarker ( 0, 0, 0,"cylinder", 1.0,0,255,0,150) 
function primergolpe(hitElement, matchingDimension) 
if inicial and getElementType(hitElement) == "player" then 
destroyElement(inicial) 
segundo = createMarker ( 1, 1, 1,"cylinder", 1.0,250,0,0,150) 
end 
end 
function segundogolpe(hitElement, matchingDimension) 
if segundo and getElementType(hitElement) == "player" then 
destroyElement(segundo) 
end 
end 
  
addEventHandler( "onMarkerHit", inicial, primergolpe ) 
addEventHandler( "onMarkerHit", segundo, segundogolpe ) 

Sigue sin destruirse el segundo y tira debug

Bad argument @addEventHandler [Expected Element at arguments 2, got nil ]

Posted

sorry , tengo que preguntar algo ¿ Esto lo ven todos los players ? Yo quiero que sea solo para 1 porque estyo haciendo tipo "una mision" y si uno inicia la mision , ¿ los otros ven tambien el marker? no se si me explico bien xD

Posted

Sí con ese script, todos lo verían. Si quieres que solo el jugador lo vea, usa esto y ponlo client-side en el meta:

  
  
inicial = createMarker ( 0, 0, 0,"cylinder", 1.0,0,255,0,150) 
function primergolpe(hitElement, matchingDimension) 
if inicial and getElementType(hitElement) == "player" then 
destroyElement(inicial) 
segundo = createMarker ( 1, 1, 1,"cylinder", 1.0,250,0,0,150) 
addEventHandler( "onClientMarkerHit", segundo, segundogolpe ) 
end 
end 
function segundogolpe(hitElement, matchingDimension) 
if segundo and getElementType(hitElement) == "player" then 
destroyElement(segundo) 
end 
end 
  
addEventHandler( "onClientMarkerHit", inicial, primergolpe ) 

DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp

 
Posted
Sí con ese script, todos lo verían. Si quieres que solo el jugador lo vea, usa esto y ponlo client-side en el meta:
  
  
inicial = createMarker ( 0, 0, 0,"cylinder", 1.0,0,255,0,150) 
function primergolpe(hitElement, matchingDimension) 
if inicial and getElementType(hitElement) == "player" then 
destroyElement(inicial) 
segundo = createMarker ( 1, 1, 1,"cylinder", 1.0,250,0,0,150) 
addEventHandler( "onClientMarkerHit", segundo, segundogolpe ) 
end 
end 
function segundogolpe(hitElement, matchingDimension) 
if segundo and getElementType(hitElement) == "player" then 
destroyElement(segundo) 
end 
end 
  
addEventHandler( "onClientMarkerHit", inicial, primergolpe ) 

a ok gracias, y si quiero que cuando pasa por el marker le de $40 ejemplo uso givePlayerMoney(40) o en el server con esta funcion

triggerServerEvent  

Posted

Exactamente! Aunque givePlayerMoney "server-side" tiene antes de la cantidad un argumento de jugador. Ej:

givePlayerMoney(source,40) 

Entonces te quedaría así:

Client-Side:

  
  
  
inicial = createMarker ( 0, 0, 0,"cylinder", 1.0,0,255,0,150) 
function primergolpe(hitElement, matchingDimension) 
if inicial and getElementType(hitElement) == "player" then 
destroyElement(inicial) 
triggerServerEvent("dinero",localPlayer) 
segundo = createMarker ( 1, 1, 1,"cylinder", 1.0,250,0,0,150) 
addEventHandler( "onClientMarkerHit", segundo, segundogolpe ) 
end 
end 
function segundogolpe(hitElement, matchingDimension) 
if segundo and getElementType(hitElement) == "player" then 
destroyElement(segundo) 
triggerServerEvent("dinero",localPlayer) 
end 
end 
  
addEventHandler( "onClientMarkerHit", inicial, primergolpe ) 

Server-Side:

  
addEvent("dinero",true) 
addEventHandler("dinero",root, 
function () 
givePlayerMoney(source,40) 
end) 

DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp

 
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...