NodZen Posted March 18, 2013 Share Posted March 18, 2013 Eso iba a decir, mejor utiliza esa. Este sería el código. local Marker = createMarker ( 1294.7626953125, -1379.625, 13.486034584045, "corona",1.5,90,253,70,163) function comprar (thePlayer) funcion = setElementHealth ( thePlayer, getElementHealth(thePlayer) + 20 ) outputChatBox ("Presiona Z para comprar Armor!", getRootElement(), 8, 224, 13 ) end addEventHandler ( "onMarkerHit", Marker, comprar ) function armor( player, 20 ) end addEventHandler ( "onMarkerHit", Marker, armor ) bindKey("z","down","comprar") Prueba este. function armor( player, 20 ) end addEventHandler ( "onMarkerHit", Marker, armor ) bindKey("z","down","comprar") Que onda con eso?. Ademas El mensaje del chat , se lo mostraria a todos los players. Link to comment
AlvareZ_ Posted March 18, 2013 Share Posted March 18, 2013 Seria algo como te lo dije yo. Link to comment
JesusAliso Posted March 19, 2013 Author Share Posted March 19, 2013 Alvarez no aparece, el marker y tira errores NodZen me sale un error en la funcion (player, 20) donde esta el 20 Link to comment
JesusAliso Posted March 19, 2013 Author Share Posted March 19, 2013 y el de Alvarez tira este error """lua:14: '>' expected near '' """ Link to comment
NodZen Posted March 19, 2013 Share Posted March 19, 2013 Okei probá con algo así, talvez te sirva function check (thePlayer) if ( isElementWithinMarker( thePlayer, Marker ) ) then --Acá le das la vida end end bindKey("F1, "down", check) Link to comment
EstrategiaGTA Posted March 19, 2013 Share Posted March 19, 2013 Okei probá con algo así, talvez te sirva function check (thePlayer) if ( isElementWithinMarker( thePlayer, Marker ) ) then --Acá le das la vida end end bindKey("F1, "down", check) Tu código está mal. function check (thePlayer) if ( isElementWithinMarker( thePlayer, Marker ) ) then --Acá le das la vida-- end end bindKey("z", "down", check) Te faltaba una comilla en Bindkey. Link to comment
AlvareZ_ Posted March 19, 2013 Share Posted March 19, 2013 En resume. Si no te anda agregale un end creo e.é function check (thePlayer) if ( isElementWithinMarker( thePlayer, Marker ) ) then outputChatBox ("Preciona Z para comprar el armor!", thePlayer, 8, 224, 13 ) local money = getPlayerMoney(thePlayer) if (money > 1000) then setPlayerArmor ( thePlayer, 20 ) else outputChatBox ("No tienes Dinero para comprar Armor!", thePlayer, 8, 224, 13 ) end end bindKey("z", "down", check) Link to comment
NodZen Posted March 19, 2013 Share Posted March 19, 2013 Hacé lo que te dijo Alvarez o lo que te dije Yo. Gracias @EstrategiaGTA , No me habia dado cuenta ( eso me pasa por escribir rapido.) Link to comment
EstrategiaGTA Posted March 19, 2013 Share Posted March 19, 2013 Hacé lo que te dijo Alvarez o lo que te dije Yo. Gracias @EstrategiaGTA , No me habia dado cuenta ( eso me pasa por escribir rapido.) Me suele pasar a mi también. Link to comment
JesusAliso Posted March 19, 2013 Author Share Posted March 19, 2013 Marker = createMarker ( 1294.7626953125, -1379.625, 13.486034584045, "corona",1.5,90,253,70,163) function check (thePlayer) if ( isElementWithinMarker( thePlayer, Marker ) ) then outputChatBox ("Preciona Z para comprar el armor!", thePlayer, 8, 224, 13 ) local money = getPlayerMoney(thePlayer) if (money > 1000) then setPlayerArmor ( thePlayer, 10 ) else outputChatBox ("No tienes Dinero para comprar Armor!", thePlayer, 8, 224, 13 ) end end bindKey("z", "down", check) end Hay esta lo pobre como dijo AlvareZ y le tube que agregar "end" y nada no tira errror entro al marker tampoco dice el outPutChatBox... Link to comment
NodZen Posted March 19, 2013 Share Posted March 19, 2013 Para que agregas otro end abajo del bind? Link to comment
AlvareZ_ Posted March 19, 2013 Share Posted March 19, 2013 lol no es debajo del bindKey ponlo arriba end end end Link to comment
JesusAliso Posted March 19, 2013 Author Share Posted March 19, 2013 ok ya lo acomode pero le paso como 10 veces al Marker y no hace nadita Link to comment
JesusAliso Posted March 19, 2013 Author Share Posted March 19, 2013 Marker = createMarker ( 1294.7626953125, -1379.625, 13.486034584045, "corona",1.5,90,253,70,163) function check (thePlayer) if ( isElementWithinMarker( thePlayer, Marker ) ) then outputChatBox ("Preciona Z para comprar el armor!", thePlayer, 8, 224, 13 ) local money = getPlayerMoney(thePlayer) if (money > 1000) then setPedArmor ( thePlayer, 10 ) else outputChatBox ("No tienes Dinero para comprar Armor!", thePlayer, 8, 224, 13 ) end end end bindKey("z", "down", check) Link to comment
AlvareZ_ Posted March 19, 2013 Share Posted March 19, 2013 a ver esto. Marker = createMarker ( 1294.7626953125, -1379.625, 13.486034584045, "corona",1.5,90,253,70,163) function check (thePlayer, source) if ( isElementWithinMarker( thePlayer, Marker ) ) then outputChatBox ("Preciona Z para comprar el armor!", source, 8, 224, 13 ) local money = getPlayerMoney(thePlayer) if (money > 1000) then setPedArmor ( thePlayer, 10 ) else outputChatBox ("No tienes Dinero para comprar Armor!", source, 8, 224, 13 ) end end end bindKey("z", "down", check) Link to comment
NodZen Posted March 19, 2013 Share Posted March 19, 2013 El problema es que setPedArmor es server-side y tu script es client. Talvez tengas que triggearlo. Link to comment
JesusAliso Posted March 19, 2013 Author Share Posted March 19, 2013 nada sigo pasando por el marker y nada Link to comment
NodZen Posted March 19, 2013 Share Posted March 19, 2013 nada sigo pasando por el marker y nada setPedArmor es server side y tu script es client. Link to comment
JesusAliso Posted March 19, 2013 Author Share Posted March 19, 2013 Que tengo que hacer Link to comment
Sasu Posted March 19, 2013 Share Posted March 19, 2013 Y todas esas funciones se pueden usar en server side. Ademas esta para server side xq usas thePlayer y en client no estaria definido. Prueba poniendolo en server. Link to comment
JesusAliso Posted March 19, 2013 Author Share Posted March 19, 2013 Cuando lo pongo Server-Side, me tira error en la linea 14,bad argument @ bindKey... y el outputchatbox me dice nada tampoco Link to comment
NodZen Posted March 19, 2013 Share Posted March 19, 2013 Probá con este bind bindKey(thePlayer, "z", "down", check) Link to comment
JesusAliso Posted March 19, 2013 Author Share Posted March 19, 2013 (edited) No lo cambie y aun sigue diciendo :Lua:14: Bad argument @ bindKey Bueno intente cambiarlo y lo puse arriva del ultimo "end" el bindKey y no tiro error Pero cuando entro al Marker no dice el outputchatbox... Marker = createMarker ( 1294.7626953125, -1379.625, 13.486034584045, "corona",1.5,90,253,70,163) function check (thePlayer, source) if ( isElementWithinMarker( thePlayer, Marker ) ) then outputChatBox ("Preciona Z para comprar el armor!", source, 8, 224, 13 ) local money = getPlayerMoney(thePlayer) if (money > 1000) then setPedArmor ( thePlayer, 10 ) else outputChatBox ("No tienes Dinero para comprar Armor!", source, 8, 224, 13 ) end end bindKey(thePlayer, "z", "down", check) end Edited March 19, 2013 by Guest Link to comment
Recommended Posts