iFoReX Posted July 6, 2012 Posted July 6, 2012 que esta mal ? me dice bad argument 1 getElementType got boolean ----BKZBaseByElMota(Scripts)---- puerta = {} radar = {} radarC = {} marker = {} puerta[1] = createObject(980,-2589.69921875,1352.3994140625,8.8000001907349,0,0,224.74731445313) puerta[2] = createObject(980,-2811.8000488281,1490.6999511719,2.7000000476837,0,0,270) puerta[3] = createObject(971,-2803.7998046875,1378,3.4000000953674) radar[1] = createRadarArea(-2816.13550, 1390,40, -70, 0, 0, 0, 255) radarC[1] = createColCuboid ( -2816.13550, 1390, 1.1, 40, -70, 60 ) marker[1] = createMarker( -2803.85791, 1376.25159, 0, "cylinder", 3, 255,0,0,255) addCommandHandler("abrirbkz1",function(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "bkz" ) ) then local abrir = moveObject(puerta[1],5000,-2589.69921875,1352.3994140625,17) end end ) addCommandHandler("cerrarbkz1",function(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "bkz" ) ) then local cerrar = moveObject(puerta[1],5000,-2589.69921875,1352.3994140625,8.8000001907349) end end ) addCommandHandler("abrirbkz2",function(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "bkz" ) ) then local abrir = moveObject(puerta[2],5000,-2811.8000488281,1490.6999511719,9) end end ) addCommandHandler("cerrarbkz2",function(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "bkz" ) ) then local cerrar = moveObject(puerta[2],5000,-2811.8000488281,1490.6999511719,2.7000000476837) end end ) function enterZone(thePlayer, hitElement, matchingDimension) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "bkz" ) ) and getElementType(hitElement) == "Player" then outputChatBox("bienvenido a la base BKZ "..getPlayerName(hitElement),hitElement) elseif not isObjectInACLGroup ("user."..accName, aclGetGroup ( "bkz" ) ) and getElementType(hitElement) == "Player" then killPed(hitElement) end end addEventHandler( "onColShapeHit", radarC[1], enterZone ) function markerHit(thePlayer, hitElement, matchingDimension) if source == marker[1] then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "bkz" ) ) and getElementType(hitElement) == "Player" then moveObject(puerta[3],5000,-2812.19921875,1490.69921875,12) end end end addEventHandler( "onMarkerHit", root, markerHit ) function markerLeave(matchingDimension) if source == marker[1] then moveObject(puerta[3],5000,-2812.19921875,1490.69921875,6) end end addEventHandler( "onMarkerLeave", root, markerLeave )
Castillo Posted July 6, 2012 Posted July 6, 2012 Aun no entendes como usar los argumentos ... function markerHit(thePlayer, hitElement, matchingDimension) Para que pusiste thePlayer y hitElement?
iFoReX Posted July 6, 2012 Author Posted July 6, 2012 thePlayer para el isObjectinAclGroup y el hit element para comprobar que el que lo tope sea una persona
Castillo Posted July 6, 2012 Posted July 6, 2012 Mira, no quiero que te enojes, pero solo necesitas un ARGUMENTO, borra hitElement y remplazalo en el script con thePlayer.
iFoReX Posted July 6, 2012 Author Posted July 6, 2012 ahora aparece bad argument 1 getElementType got nil ----BKZBaseByElMota(Scripts)---- puerta = {} radar = {} radarC = {} marker = {} puerta[1] = createObject(980,-2589.69921875,1352.3994140625,8.8000001907349,0,0,224.74731445313) puerta[2] = createObject(980,-2811.8000488281,1490.6999511719,2.7000000476837,0,0,270) puerta[3] = createObject(971,-2803.7998046875,1378,3.4000000953674) radar[1] = createRadarArea(-2816.13550, 1390,40, -70, 0, 0, 0, 255) radarC[1] = createColCuboid ( -2816.13550, 1390, 1.1, 40, -70, 60 ) marker[1] = createMarker( -2803.85791, 1376.25159, 0, "cylinder", 3, 255,0,0,255) addCommandHandler("abrirbkz1",function(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "bkz" ) ) then local abrir = moveObject(puerta[1],5000,-2589.69921875,1352.3994140625,17) end end ) addCommandHandler("cerrarbkz1",function(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "bkz" ) ) then local cerrar = moveObject(puerta[1],5000,-2589.69921875,1352.3994140625,8.8000001907349) end end ) addCommandHandler("abrirbkz2",function(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "bkz" ) ) then local abrir = moveObject(puerta[2],5000,-2811.8000488281,1490.6999511719,9) end end ) addCommandHandler("cerrarbkz2",function(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "bkz" ) ) then local cerrar = moveObject(puerta[2],5000,-2811.8000488281,1490.6999511719,2.7000000476837) end end ) function enterZone(thePlayer, matchingDimension) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "bkz" ) ) and getElementType(thePlayer) == "Player" then outputChatBox("bienvenido a la base BKZ "..getPlayerName(thePlayer),thePlayer) elseif not isObjectInACLGroup ("user."..accName, aclGetGroup ( "bkz" ) ) and getElementType(thePlayer) == "Player" then killPed(thePlayer) end end addEventHandler( "onColShapeHit", radarC[1], enterZone ) function markerHit(thePlayer, matchingDimension) if source == marker[1] then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "bkz" ) ) and getElementType(hitElement) == "Player" then moveObject(puerta[3],5000,-2812.19921875,1490.69921875,12) end end end addEventHandler( "onMarkerHit", root, markerHit ) function markerLeave(matchingDimension) if source == marker[1] then moveObject(puerta[3],5000,-2812.19921875,1490.69921875,6) end end addEventHandler( "onMarkerLeave", root, markerLeave )
Castillo Posted July 6, 2012 Posted July 6, 2012 getElementType(hitElement) == "Player" then 1: No cambiaste hitElement. 2: Es "player", no "Player".
iFoReX Posted July 6, 2012 Author Posted July 6, 2012 funciona pero esto no funciona no me mata ni se escribe nada en el chat function enterZone(thePlayer, matchingDimension) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "bkz" ) ) and getElementType(thePlayer) == "player" then outputChatBox("bienvenido a la base BKZ "..getPlayerName(thePlayer),thePlayer) elseif not isObjectInACLGroup ("user."..accName, aclGetGroup ( "bkz" ) ) and getElementType(thePlayer) == "player" then killPed(thePlayer) end end addEventHandler( "onColShapeHit", radarC[1], enterZone )
Castillo Posted July 6, 2012 Posted July 6, 2012 function enterZone ( thePlayer, matchingDimension ) if ( getElementType ( thePlayer ) == "player" ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "bkz" ) ) then outputChatBox ( "bienvenido a la base BKZ ".. getPlayerName ( thePlayer ), thePlayer ) else killPed ( thePlayer ) end end end addEventHandler ( "onColShapeHit", radarC[1], enterZone )
iFoReX Posted July 6, 2012 Author Posted July 6, 2012 y como puedo hacer para que los codigos #00ff00 o #00bbff o esos no aparescan y el nombre aparesca con su respectivo color ?
Castillo Posted July 6, 2012 Posted July 6, 2012 function enterZone ( thePlayer, matchingDimension ) if ( getElementType ( thePlayer ) == "player" ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "bkz" ) ) then outputChatBox ( "bienvenido a la base BKZ ".. getPlayerName ( thePlayer ), thePlayer, 255, 255, 255, true ) else killPed ( thePlayer ) end end end addEventHandler ( "onColShapeHit", radarC[1], enterZone ) El 'true' al final de outputChatBox es para activar los codigos HEX.
Recommended Posts