Arsilex Posted August 8, 2012 Posted August 8, 2012 por que no me funciona esto addCommandHandler ( "liberar", function( player, commandName, otherPlayer ) if otherPlayer then local other, name = exports.players:getFromName( player, otherPlayer ) if other then if player ~= other then local x, y, z = getElementPosition( player ) if getDistanceBetweenPoints3D( x, y, z, getElementPosition( other ) ) < 5 then showCursor ( false, otherPlayer ) else outputChatBox( "Fallo4.", player, 255, 0, 0 ) end else outputChatBox( "Fallo3.", player, 255, 0, 0 ) end else outputChatBox( "Fallo2.", player, 255, 0, 0 ) end else outputChatBox( "Fallo1.", player, 255, 0, 0 ) end end)
Castillo Posted August 8, 2012 Posted August 8, 2012 addCommandHandler ( "liberar", function ( player, commandName, otherPlayer ) if ( otherPlayer ) then local other, name = exports.players:getFromName ( player, otherPlayer ) if ( other ) then if ( player ~= other ) then local x, y, z = getElementPosition ( player ) if ( getDistanceBetweenPoints3D ( x, y, z, getElementPosition ( other ) ) < 5 ) then showCursor ( otherPlayer, false ) else outputChatBox ( "Fallo4.", player, 255, 0, 0 ) end else outputChatBox ( "Fallo3.", player, 255, 0, 0 ) end else outputChatBox ( "Fallo2.", player, 255, 0, 0 ) end else outputChatBox ( "Fallo1.", player, 255, 0, 0 ) end end ) El unico problema era que pusiste alrevez los argumentos en showCursor. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Arsilex Posted August 8, 2012 Author Posted August 8, 2012 LOL pos valla fallazo tuve alli gracias castillo ^^
Castillo Posted August 8, 2012 Posted August 8, 2012 De nada. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Arsilex Posted August 8, 2012 Author Posted August 8, 2012 Tengo una pregunta de este script cuando pongo liberar ID no libera al personaje por que puede ser osea no le quita el raton
Castillo Posted August 8, 2012 Posted August 8, 2012 No entiendo. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Arsilex Posted August 8, 2012 Author Posted August 8, 2012 mira mi script client-side function stopMinigunDamage ( attacker, otherPlayer, weapon, bodypart ) if ( weapon == 3 ) then showCursor ( true, otherPlayer ) end end addEventHandler ( "onClientPlayerDamage", getRootElement(), stopMinigunDamage ) y el sv es ese pos mira pego a alguen y se le pone el curson y cuando yo ponga liberar [nombre]o[iD] pos que se le quite el cursor al player que este diciendo en el nombre como ago
Castillo Posted August 8, 2012 Posted August 8, 2012 Deberia funcionar. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Arsilex Posted August 8, 2012 Author Posted August 8, 2012 a mi me estan diciendo que no osea ese script el segundo que lo arreglaste lo puse bien poniendolo en server o es client?
Castillo Posted August 8, 2012 Posted August 8, 2012 Es server side. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted August 8, 2012 Posted August 8, 2012 El segundo argumento de "onClientPlayerDamage" es un arma, no un jugador y en showCursos es jugador,boolean tu tenes boolean,jugador bool showCursor ( player thePlayer, bool show, [ bool toggleControls = true ] ) Developer @ MYVAL
Castillo Posted August 8, 2012 Posted August 8, 2012 En el client side, el argumento de jugador no se usa. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Arsilex Posted August 8, 2012 Author Posted August 8, 2012 por si no te as dado cuenta si quito el segundo argumento al que le salra el cursor es ami no al que sufrio el ataque
Alexs Posted August 8, 2012 Posted August 8, 2012 Eso es mas simple: function stopMinigunDamage ( attacker, weapon, bodypart, loss ) if ( weapon == 3 ) then showCursor ( true ) end end addEventHandler ( "onClientPlayerDamage", getRootElement(), stopMinigunDamage ) Y no, tu eres attacker y el otro es 'source' Developer @ MYVAL
Arsilex Posted August 8, 2012 Author Posted August 8, 2012 con lo que as puesto alex me sale el cursor a mi al otro nada PD:y si pongo showCursor ( source, true ) me sale bad argument showcurson
Alexs Posted August 8, 2012 Posted August 8, 2012 con lo que as puesto alex me sale el cursor a mi al otro nada Tu kieres mostrarle el cursor a quien ataco? si es asi usa esto en server side: function stopMinigunDamage ( attacker, weapon, bodypart, loss ) if ( weapon == 3 ) then showCursor ( true, attacker ) end end addEventHandler ( "onPlayerDamage", getRootElement(), stopMinigunDamage ) Developer @ MYVAL
Alexs Posted August 8, 2012 Posted August 8, 2012 no funciona. Como lo testeaste tan rapido? bool showCursor ( player thePlayer, bool show, [ bool toggleControls = true ] ) function stopMinigunDamage ( attacker, weapon, bodypart, loss ) if ( weapon == 3 ) then showCursor ( attacker, true ) end end addEventHandler ( "onPlayerDamage", getRootElement(), stopMinigunDamage ) Developer @ MYVAL
Arsilex Posted August 8, 2012 Author Posted August 8, 2012 que no que nada me sale bad argument show cursor
Alexs Posted August 8, 2012 Posted August 8, 2012 que no que nada me sale bad argument show cursor 1 o 2? esta en sv? function stopMinigunDamage ( attacker, weapon, bodypart, loss ) if ( weapon == 3 ) then showCursor ( attacker, true ) end end addEventHandler ( "onPlayerDamage", getRootElement(), stopMinigunDamage ) Eso deberia estar bien attacker: A player element representing the player who was the attacker. If there was no attacker this returns false. Developer @ MYVAL
Castillo Posted August 8, 2012 Posted August 8, 2012 addEventHandler ( "onPlayerDamage", root, function ( _, weapon ) if ( weapon == 3 ) then showCursor ( source, true ) end end ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted August 8, 2012 Posted August 8, 2012 addEventHandler ( "onPlayerDamage", root, function ( _, weapon ) if ( weapon == 3 ) then showCursor ( source, true ) end end ) Espera, querias mostrar el cursor al atacado o al atacante?? Developer @ MYVAL
Arsilex Posted August 8, 2012 Author Posted August 8, 2012 castillo eso ya me funciona muxa gracias una ultima pregunta como ago que un player siga a otro player ?
Alexs Posted August 8, 2012 Posted August 8, 2012 castillo eso ya me funciona muxa gracias una ultima pregunta como ago que un player siga a otro player ? Eso ya es mucho mas complicado, especifica Developer @ MYVAL
Arsilex Posted August 8, 2012 Author Posted August 8, 2012 osea que cuando yo ponga esposar que el personaje me siga osea el other
Recommended Posts