Jump to content

Strike27208

Members
  • Posts

    85
  • Joined

  • Last visited

About Strike27208

  • Birthday 18/12/1997

Details

  • Gang
    Romania
  • Location
    Galati
  • Occupation
    Lua
  • Interests
    To be a big scripter.

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Strike27208's Achievements

Transformer

Transformer (11/54)

0

Reputation

  1. Poftim vehicle table'ul meu , este la fel ca al tau doar ca tu sigur ai ratat sa faci ceva , eu am mai bagat si alte vehicule pe langa cele de baza , sper ca te-am ajutat . https://www.mediafire.com/file/mkqtqkbuo1y5lsc/vehicles.lua
  2. Same Error. localPlayer:getOccupiedVehicleSeat(vehicle , 0 )
  3. attempt to index a global "localPlayer" a userdata value , hmmmm ?
  4. I used this and didn't work : local driver = getVehicleOccupant(veh, 0) local p1 = getVehicleOccupant(veh, 1) local p2 = getVehicleOccupant(veh, 2) local p3 = getVehicleOccupant(veh, 3) if fuel <=5 then if p1 or p2 or p3 then return false end if driver then sound = playSound("sound/beep.mp3" , true) setSoundVolume(sound, 0.1) setSoundSpeed ( sound, 0.9 ) outputChatBox ( "#FF0000Alarm ! #FFFFFFLow fuel ! Press ' Z ' to stop the alarm.", 255, 255, 255, true ) bindKey ( "Z", "down", stopMySoundB ) addEventHandler ( "onClientVehicleExit", root, stopMySoundV ) killTimer(aMyTimer) end end end
  5. Hey , how i can to play sound for driver only ? this is my code , i tried to make but i failed and i need some help : function helicopter () if ( isPedInVehicle ( localPlayer ) == false ) then return false end local vehicle = getPedOccupiedVehicle(getLocalPlayer()) if vehicle then if ( policeVehicles[getElementModel ( vehicle )] ) then local maxfuel = tonumber(getElementData(vehicle, "maxfuel")) or 0; local fuels = math.floor(tonumber(getElementData(getElementData(vehicle, "parent"), "fuel"))) or 0; if fuels <=5 then sound = playSound("sound/beep.mp3" , true) setSoundVolume(sound, 0.1) setSoundSpeed ( sound, 0.9 ) outputChatBox ( "#FF0000Alarm ! #FFFFFFLow fuel ! Press ' Z ' to stop the alarm.", 255, 255, 255, true ) bindKey ( "Z", "down", stopMySoundB ) addEventHandler ( "onClientVehicleExit", root, stopMySoundV ) killTimer(aMyTimer) end end end end aMyTimer = setTimer( helicopter, 5000,0)
  6. Hey , i come back here because i find a new bug :)) , if i'm with other player in vehicle the alarm won't start , this is my code : local driver = getVehicleOccupant(veh, 0) local p1 = getVehicleOccupant(veh, 1) local p2 = getVehicleOccupant(veh, 2) local p3 = getVehicleOccupant(veh, 3) if fuel <=5 then if p1 or p2 or p3 then return false end if driver then sound = playSound("sound/beep.mp3" , true) setSoundVolume(sound, 0.1) setSoundSpeed ( sound, 0.9 ) outputChatBox ( "#FF0000Alarm ! #FFFFFFLow fuel ! Press ' Z ' to stop the alarm.", 255, 255, 255, true ) bindKey ( "Z", "down", stopMySoundB ) addEventHandler ( "onClientVehicleExit", root, stopMySoundV ) killTimer(aMyTimer) end end end
  7. I use to activate my function if driver then sound = playSound("sound/beep.mp3" , true) setSoundVolume(sound, 0.2) outputChatBox ( "#FF0000Alarm ! #FFFFFFLow fuel ! Press ' Z ' to stop the alarm.", 255, 255, 255, true ) bindKey ( "Z", "down", stopMySoundB ) addEventHandler ( "onClientVehicleExit", root, stopMySoundV ) killTimer(aMyTimer) end
  8. Oh man thank you very much , it's working , thaaaaaaanks !!!!! Last code are working.
  9. I have the event attached. This is server part ?
  10. Nope , i don't use local , still not working , but thanks for help man , i appreciate. No warrnings or erros in debugscript. I used this to play sound only for driver seat and it's working , when i tried to use for that function he give that warrning , can you tell me why ? local driver = getVehicleOccupant(veh, 0) local p1 = getVehicleOccupant(veh, 1) local p2 = getVehicleOccupant(veh, 2) local p3 = getVehicleOccupant(veh, 3) if fuel1 <= 6 then if p1 or p2 or p3 then return false end if driver then sound = playSound("sound/beep.mp3" , true) setSoundVolume(sound, 0.2)
  11. Hmm i tried but still not work function stopMySoundV() local veh = getPedOccupiedVehicle(getLocalPlayer()) if veh then local driver = getVehicleController(veh , getLocalPlayer()) if driver then local drivers = getVehicleOccupant(veh, 0) local p1 = getVehicleOccupant(veh, 1) local p2 = getVehicleOccupant(veh, 2) local p3 = getVehicleOccupant(veh, 3) if p1 or p2 or p3 then return false end if drivers then stopSound (sound) unbindKey ( "Z", "down", stopMySoundB ) removeEventHandler( "onClientVehicleExit", root, stopMySoundV ) if not isTimer ( aMyTimer ) then aMyTimer = setTimer( helicopter, 5000,0) end end end end end Tell me if i am wrong.
  12. Thanks man it's work , now i made a sistem like only driver to hear the sound , this work but when i want exit from vehicle the sound are not stopping and i get an warnging in debugscript like this : My code : function stopMySoundV() local veh = getPedOccupiedVehicle(getLocalPlayer()) local driver = getVehicleOccupant(veh, 0) local p1 = getVehicleOccupant(veh, 1) local p2 = getVehicleOccupant(veh, 2) local p3 = getVehicleOccupant(veh, 3) if p1 or p2 or p3 then return false end if driver then stopSound (sound) unbindKey ( "Z", "down", stopMySoundB ) removeEventHandler( "onClientVehicleExit", root, stopMySoundV ) if not isTimer ( Check ) then Check = setTimer( helicopter, 5000,0) end end end
  13. Hey i make this script when you have low fuel to start a sound alarm but i don't know how to make to check this when you are in helicopter : function helicopter () if ( isPedInVehicle ( localPlayer ) == false ) then return false end ---------------------------Parts----------------------- local veh = getPedOccupiedVehicle(getLocalPlayer()); local maxfuel = ---myStuff--; local fuel = ---myStuff----------; if (isElement(veh) and getElementModel(veh) == 487 or 497 or 417 or 563 ) then if fuel <= 5 then sound = playSound("sound/beep.mp3" , true) setSoundVolume(sound, 0.2) outputChatBox ( "#FF0000Alarm ! #FFFFFFLow fuel ! Press ' Z ' to stop the alarm.", 255, 255, 255, true ) bindKey ( "Z", "down", stopMySoundV ) addEventHandler ( "onClientVehicleExit", root, stopMySound ) killTimer(tm) end end end tm = setTimer (helicopter , 5000 , 0) addEventHandler ( "onClientResourceStart", root, helicopter ) function stopMySound() stopSound ( sound ) unbindKey ( "Z", "down", stopMySoundV ) end function stopMySoundV() stopSound ( sound ) removeEventHandler( "onClientVehicleExit", root, stopMySound ) end This all work , but when he kill the timer i can't use ' resetTimer ' because he killed it , so how to make to reset that timer when he leave the vehicle ? this work first time , but when i enter again in vehicle he wont verify again.
×
×
  • Create New...