Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Could mean that the script has a syntax error.
  2. You want to start the engine when press J + Space? if so, use the following functions: bindKey getKeyState getPedOccupiedVehicle setVehicleEngineState
  3. Acabo de subir una actualizacion que permite ponerle vida extra a los vehiculos. https://community.multitheftauto.com/in ... ls&id=5195
  4. Because the server side is loading faster than the client side, so the event handler doesn't yet exist.
  5. Castillo

    [HELP] Cars

    You must use isVehicleBlown and isElementInWater. function allvehiclesaredoomed ( ) local vehicles = getElementsByType ( "vehicle" ) for _, v in ipairs ( vehicles ) do if ( isVehicleBlown ( v ) or isElementInWater ( v ) ) then destroyElement ( v ) end end end addCommandHandler ( "destroyall", allvehiclesaredoomed )
  6. Castillo

    Problem

    You're welcome.
  7. Castillo

    Problem

    What do you mean? I tested that code and worked perfectly.
  8. Castillo

    Problem

    That's because you changed what I gave you. The 'if' must be like this: if ( clip < 1 and validWeaponSlots [ weapSlot ] ) then Not: if ( clip < 1 and weapSlot == validWeaponSlots [ weapSlot ] ) then Full code: local validWeaponSlots = { [ 2 ] = true, [ 3 ] = true, [ 4 ] = true, [ 5 ] = true, [ 6 ] = true, [ 7 ] = true, [ 8 ] = true, } local screenW,screenH = guiGetScreenSize() local resW,resH = 1280,720 local sW,sH = (screenW/resW), (screenH/resH) addEventHandler ( "onClientRender", root, function ( ) if getControlState ( "aim_weapon" ) then local ammo = getPedTotalAmmo ( localPlayer ) local clip = getPedAmmoInClip ( localPlayer ) local weaponID = getPedWeapon ( localPlayer ) local weapName = getWeaponNameFromID ( weaponID ) local weapSlot = getPedWeaponSlot ( localPlayer ) local xBone,yBone,zBone = getPedBonePosition ( localPlayer, 8 ) local zBone = ( zBone - 0.5 ) local xSP, ySP = getScreenFromWorldPosition ( xBone, yBone, zBone ) if ( xSP and ySP ) then dxDrawText ( weapName .." ".. clip .." | ".. ammo, xSP+100,ySP, 290*sW, 250*sH, tocolor (255, 255, 255, 255), 1.25*sW,1.25*sH, "default-bold", "left", "top", false, false, false, true ) if ( clip < 1 and validWeaponSlots [ weapSlot ] ) then dxDrawText ( "Reloading...", xSP+100,ySP+20, 290*sW, 250*sH, tocolor (255, 255, 255, 255), 1.25*sW,1.25*sH,"default-bold", "left", "top", false, false, false, true ) end end end end )
  9. Castillo

    Problem

    If that's your full script, then you forgot to define "sW" and "sH". local validWeaponSlots = { [ 2 ] = true, [ 3 ] = true, [ 4 ] = true, [ 5 ] = true, [ 6 ] = true, [ 7 ] = true, [ 8 ] = true, } local sW, sH = guiGetScreenSize ( ) addEventHandler ( "onClientRender", root, function ( ) if getControlState ( "aim_weapon" ) then local ammo = getPedTotalAmmo ( localPlayer ) local clip = getPedAmmoInClip ( localPlayer ) local weaponID = getPedWeapon ( localPlayer ) local weapName = getWeaponNameFromID ( weaponID ) local weapSlot = getPedWeaponSlot ( localPlayer ) local xBone,yBone,zBone = getPedBonePosition ( localPlayer, 8 ) local zBone = ( zBone - 0.5 ) local xSP, ySP = getScreenFromWorldPosition ( xBone, yBone, zBone ) if ( xSP and ySP ) then dxDrawText ( weapName .." ".. clip .." | ".. ammo, xSP+100,ySP, 290*sW, 250*sH, tocolor (255, 255, 255, 255), 1.25*sW,1.25*sH, "default-bold", "left", "top", false, false, false, true ) if ( clip < 1 and validWeaponSlots [ weapSlot ] ) then dxDrawText ( "Reloading...", xSP+100,ySP+20, 290*sW, 250*sH, tocolor (255, 255, 255, 255), 1.25*sW,1.25*sH,"default-bold", "left", "top", false, false, false, true ) end end end end )
  10. Castillo

    Problem

    Post the full script.
  11. Castillo

    Problem

    Any errors in debugscript? try debugging the script to see what weapSlot is returning, what clip is returning, etc.
  12. Castillo

    Problem

    local validWeaponSlots = { [ 2 ] = true, [ 3 ] = true, [ 4 ] = true, [ 5 ] = true, [ 6 ] = true, [ 7 ] = true, [ 8 ] = true, } local clip = getPedAmmoInClip ( localPlayer ) local weapSlot = getPedWeaponSlot ( localPlayer ) if ( clip < 1 and validWeaponSlots [ weapSlot ] ) then dxDrawText("Reloading...", xSP+100,ySP+20, 290*sW, 250*sH, tocolor (255, 255, 255, 255), 1.25*sW,1.25*sH,"default-bold","left","top",false,false,false,true) end
  13. Castillo

    Problem

    Make a table with the valid weapon slots, then check if the weapon slot the player is using is in that table.
  14. The admin panel has a XML file with the messages, then the script reads which one it has to send depending on the action executed.
  15. Well, it's quite easy, the admin panel sends each action to the server side, which includes the admin who did the action, it doesn't output that message using that event.
  16. You can disable the player from using vehicles in the settings of the resource. Admin panel > Resources tab > freeroam > Settings.
  17. Si queres puedo agregarselo a mi recurso, lo unico que el daño fisico no se cancela, me refiero a los golpes, etcetera.
  18. We don't give support with leaked scripts. Topic locked.
  19. La unica manera de hacer esto es utilizando el evento onClientVehicleDamage, que se puede cancelar.
  20. You're using "freeroam"? If so, you can disable the player from using vehicles in the settings of the resource.
  21. Check in the server side if triggerClientEvent is being triggered.
  22. That's not what the wiki says: I also tried setting my interior to 20, then 255 and getElementInterior returns correctly.
  23. You must know the object model in order to delete it.
  24. You could host it on another PC and then use team viewer to control that PC from yours.
  25. Read this: https://wiki.multitheftauto.com/wiki/Resources
×
×
  • Create New...