Jump to content

0xCiBeR

MTA Team
  • Posts

    1,673
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by 0xCiBeR

  1. addCommandHandler("stopmods", function () engineRestoreModel(405) end) Or with a model setting: function restore (cmd,model) if model then engineRestoreModel(tonumber(model)) else outputChatBox("Please specify model ID",255,0,0) end end addCommandHandler("stopmods",restore) In the last case it would be, /stopmods [MODELID] Please note, that it would only restore the model for the client executing the command.
  2. El evento es onBotWasted. Usa esto: function boss ( ) Nemesis = exports [ "slothBot" ]:spawnBot ( -1935.5480957031, 665.44055175781, 47.0, 90, 312, 0, 0, Nemesis, 0,"chasing", true ) exports.extra_health:setElementExtraHealth ( Nemesis, 2500 ) outputChatBox ("NEMESIS A APARECIDO!!", getRootElement(), 255, 0, 0, true ) myBlip = (createBlipAttachedTo ( Nemesis, 23 )) setElementData ( Nemesis, "nemesis", true ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), boss ) function mon ( killer ) if killer and getElementType(killer) == 'player' then if getElementData(source,"nemesis") then givePlayerMoney( killer, math.random ( 300000, 500000 )) local nombre = getPlayerName(killer) destroyElement ( myBlip ) outputChatBox ("* "..nombre.." AH MATADO A NEMESIS!!", getRootElement(), 255, 0, 0, true ) setTimer(boss,60000,1) -- respawn end end end addEventHandler("onBotWasted",getRootElement(), mon )
  3. 0xCiBeR

    country ban ability

    local countries = { [ "CO" ] = true, [ "BR" ] = true, [ "CN" ] = true } function paises ( ) local pais = exports.admin:getPlayerCountry ( source ) or "N/A" if ( countries [ pais ] ) then kickPlayer ( source, "Country not Permited" ) end end addEventHandler ( "onPlayerJoin", getRootElement(), paises ) Just add the country in the table and it gets blocked.
  4. You have to use 'interpolateBetween' using that usful funtion as an example.
  5. 0xCiBeR

    ayuda peds

    function inicio() local elped = createPed(120, 5540.6654, 1020.55122, 1240.545) setTimer( function () giveWeapon(elped,31,200) end,1000,1) end addEventHandler ( "onResourceStart", resourceRoot, inicio )
  6. function content() local color = tocolor ( 0, 0, 0, 200 ) dxDrawAnimWindow ( "My Animated Window", 520, 600, color, "default-bold", "OutBounce") end addCommandHandler("open", function main() start = getTickCount() addEventHandler ( "onClientRender", getRootElement(), content ) end) function dxDrawAnimWindow(text,height,width,color,font,anim) local x,y = guiGetScreenSize() btwidth = width btheight = height/20 local now = getTickCount() local elapsedTime = now - start local endTime = start + 1500 local duration = endTime - start local progress = elapsedTime / duration local x1, y1, z1 = interpolateBetween ( 0, 0, 0, width, height, 255, progress, anim) local x2, y2, z2 = interpolateBetween ( 0, 0, 0, btwidth, btheight, btheight/11, progress, anim) posx = (x/2)-(x1/2) posy = (y/2)-(y1/2) dxDrawRectangle ( posx, posy-y2, x2, y2, color ) dxDrawRectangle ( posx, posy, x1, y1, tocolor ( 0, 0, 0, 200 ) ) dxDrawText ( text, 0, -(y1)-y2, x, y, tocolor ( 255, 255, 255, 255 ), z2,font,"center","center") end
  7. De nada. Topic cerrado a petición del Usuario.
  8. La verdad, no tengo idea porque es..Lo que podes hacer es no triggear el spawn del jugador hasta que no dejo de moverse la camara.
  9. That creates a rectangle dx window with a title of your choice. You're Welcome.
  10. Puede que sea producido por la cámara fuera de lugar. Proba esto en server-side: addEventHandler ( "onPlayerLogin", root, function ( ) triggerClientEvent ( source, "login:onPlayerClientLogin", source ) end ) addEvent ( "login:onClientRequestMove", true ) addEventHandler ( "login:onClientRequestMove", root, function ( ) if ( isGuestAccount ( getPlayerAccount ( source ) ) ) then triggerClientEvent ( source, "login:onClientGetMovementPermission", source ) end end ) addEvent("detenelo",true) addEventHandler("detenelo",root, function () fadeCamera(source,true) setCameraTarget(source) end )
  11. That's what i just gave him.
  12. You can use this Useful Function As a guide, or simply use it.
  13. rx,ry,rz son los valores que le estan dando number donde deberia haber un easing-type. Te puse el ejemplo de la wiki, asi contas cuantos valores tenes hasta el easing-type, en el cual se ubica en el 9 argumento, o sea que rx,ry,rz estan causando que de 0. No se si me explico Esto: function moveBack(index, x,y,z, raising) if status[index] == 1 then status[index] = 2 moveObject ( gateList[index], 2000, x,y,z, gateListMoveTorX[gateIndex],gateListMoveTorY[gateIndex],gateListMoveTorZ[gateIndex],rx,ry,rz ) setTimer ( resetTimer, 2000, 1, index ) end end Debería ser esto: function moveBack(index, x,y,z, raising) if status[index] == 1 then status[index] = 2 moveObject ( gateList[index], 2000, x,y,z, gateListMoveTorX[gateIndex],gateListMoveTorY[gateIndex],gateListMoveTorZ[gateIndex] ) setTimer ( resetTimer, 2000, 1, index ) end end
  14. Estas seguro que tu sistema hace que des spawn?.. Prueba esto en client-side: setTimer ( function ( ) triggerServerEvent ( "login:onClientRequestMove", localPlayer ) end, 200, 1 ) addEvent ( "login:onPlayerClientLogin", true ) addEventHandler ( "login:onPlayerClientLogin", root, function ( ) fadeCamera ( false ) setTimer ( function ( ) removeEventHandler ( "onClientPreRender", root, moveCamera ) triggerServerEvent("detenelo",localPlayer) fadeCamera ( true ) end, 1500, 1 ) end ) addEvent ( "login:onClientGetMovementPermission", true ) addEventHandler ( "login:onClientGetMovementPermission", root, function ( ) local x, y, z = getCameraMatrix ( ) setCameraMatrix ( x, y, z + 50 ) local move = true function moveCamera( ) local x, y, z, x2, y2, z2 = getCameraMatrix ( ) if ( move ) then setCameraMatrix ( x+0.5, y, z, x2+0.25, y2, z2 ) if ( x > 2000 ) then move = false end else setCameraMatrix ( x-0.5, y, z, x2-0.25, y2, z2 ) if ( x < -1000 ) then move = true end end end addEventHandler ( 'onClientPreRender', root, moveCamera ) end )
  15. Usa esto haber si te va: setTimer ( function ( ) triggerServerEvent ( "login:onClientRequestMove", localPlayer ) end, 200, 1 ) addEvent ( "login:onPlayerClientLogin", true ) addEventHandler ( "login:onPlayerClientLogin", root, function ( ) fadeCamera ( false ) setTimer ( function ( ) removeEventHandler ( "onClientPreRender", root, moveCamera ) fadeCamera ( true ) end, 1500, 1 ) end ) addEvent ( "login:onClientGetMovementPermission", true ) addEventHandler ( "login:onClientGetMovementPermission", root, function ( ) local x, y, z = getCameraMatrix ( ) setCameraMatrix ( x, y, z + 50 ) local move = true function moveCamera( ) local x, y, z, x2, y2, z2 = getCameraMatrix ( ) if ( move ) then setCameraMatrix ( x+0.5, y, z, x2+0.25, y2, z2 ) if ( x > 2000 ) then move = false end else setCameraMatrix ( x-0.5, y, z, x2-0.25, y2, z2 ) if ( x < -1000 ) then move = true end end end addEventHandler ( 'onClientPreRender', root, moveCamera ) setTimer( function () removeEventHandler("onClientPreRender",root,moveCamara) triggerServerEvent("detenelo",localPlayer) end,5000,1) end ) Server: addEventHandler ( "onPlayerLogin", root, function ( ) triggerClientEvent ( source, "login:onPlayerClientLogin", source ) end ) addEvent ( "login:onClientRequestMove", true ) addEventHandler ( "login:onClientRequestMove", root, function ( ) if ( isGuestAccount ( getPlayerAccount ( source ) ) ) then triggerClientEvent ( source, "login:onClientGetMovementPermission", source ) end end ) addEvent("detenelo",true) addEventHandler("detenelo",root, function () setCameraTarget(source) end )
  16. Yo tenia ese problema con ese resource. El problema esta, en que te rota la camara y todo, pero no la vuelve a su lugar cuando se loguea. Se puede solucionar usando algún tipo de spawn que te setee de nuevo la cámara a su lugar, al momento de dar spawn. EDIT: (Lo encontre aca https://www.mediafire.com/folder/h4kcbey50ld5z/scripts descompilado) Client setTimer ( function ( ) triggerServerEvent ( "login:onClientRequestMove", localPlayer ) end, 200, 1 ) addEvent ( "login:onPlayerClientLogin", true ) addEventHandler ( "login:onPlayerClientLogin", root, function ( ) fadeCamera ( false ) setTimer ( function ( ) removeEventHandler ( "onClientPreRender", root, moveCamera ) fadeCamera ( true ) end, 1500, 1 ) end ) addEvent ( "login:onClientGetMovementPermission", true ) addEventHandler ( "login:onClientGetMovementPermission", root, function ( ) local x, y, z = getCameraMatrix ( ) setCameraMatrix ( x, y, z + 50 ) local move = true function moveCamera( ) local x, y, z, x2, y2, z2 = getCameraMatrix ( ) if ( move ) then setCameraMatrix ( x+0.5, y, z, x2+0.25, y2, z2 ) if ( x > 2000 ) then move = false end else setCameraMatrix ( x-0.5, y, z, x2-0.25, y2, z2 ) if ( x < -1000 ) then move = true end end end addEventHandler ( 'onClientPreRender', root, moveCamera ) end ) Server: addEventHandler ( "onPlayerLogin", root, function ( ) triggerClientEvent ( source, "login:onPlayerClientLogin", source ) end ) addEvent ( "login:onClientRequestMove", true ) addEventHandler ( "login:onClientRequestMove", root, function ( ) if ( isGuestAccount ( getPlayerAccount ( source ) ) ) then triggerClientEvent ( source, "login:onClientGetMovementPermission", source ) end end )
  17. Lo que te esta indicando es que se topo con un error que significa que en ves de encontrase con un easing-type se encontro con un numero. Mira los argumentos de esa función: bool moveObject ( object theObject, int time, float targetx, float targety, float targetz, [ float moverx, float movery, float moverz, string strEasingType, float fEasingPeriod, float fEasingAmplitude, float fEasingOvershoot ] )
  18. La mejor manera es usar: interpolateBetween Recuerda que las funciones de dibujado dx,van acompañadas de 'onClientRender'
  19. 0xCiBeR

    Base

    Please do respect one another, everybody was new sometime and maybe wanted the things done for them and actually he did help you so it's a bit harsh to quote "help". @EufraT i do advise you to follow the tutorials on scripting before you try something complex and know that usually no one will do the scripts for you unless you pay them. This is a scripting-help forum where you can get help on some error or that type of problem, the users above helped you out with a code using tables as a base.
  20. 0xCiBeR

    ayuda peds

    createPed giveWeapon Ej: function inicio() local elped = createPed(120, 5540.6654, 1020.55122, 1240.545) giveWeapon(elped,31,200) end addEventHandler ( "onResourceStart", resourceRoot, inicio )
  21. Nice Job! Keep up the good work.
×
×
  • Create New...