Strike27208

Members
  • Content count

    85
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Strike27208

  • Rank
    Transformer
  • Birthday 18/12/97

Details

  • Gang
    Romania
  • Location
    Galati
  • Occupation
    Lua
  • Interests
    To be a big scripter.
  1. Thanks man , it's working , cheers
  2. Ok , thanks.
  3. Same Error. localPlayer:getOccupiedVehicleSeat(vehicle , 0 )
  4. attempt to index a global "localPlayer" a userdata value , hmmmm ?
  5. 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
  6. 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)
  7. 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
  8. 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
  9. Oh man thank you very much , it's working , thaaaaaaanks !!!!! Last code are working.
  10. I have the event attached. This is server part ?
  11. 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)
  12. 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.
  13. 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
  14. 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.
  15. Use this man toggleControl ( thePlayer, "aim_weapon", false ) -- disable their fire key toggleControl ( thePlayer, "fire", false ) -- disable their fire key --------------------------------------------------------------------- toggleControl ( thePlayer, "aim_weapon", true ) -- enable their fire key toggleControl ( thePlayer, "fire", true ) -- enable their fire key