Jump to content

AlphaMark

Members
  • Posts

    60
  • Joined

  • Last visited

Everything posted by AlphaMark

  1. AlphaMark

    route

    Ah okay but now i got this error: Bad argument at #1 to 'unpack' (table expected got nil)
  2. Maybe you can make an invisible marker at the same spot?
  3. AlphaMark

    route

    I want to make this in to an function because i want to be able to trigger it serverside
  4. AlphaMark

    route

    I though i got it to work, But when u enter the marker nothing happends
  5. AlphaMark

    Error

    function SweepRoute() local currentIndex = 1 local route = { { 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 2 }, { 0, 0, 3 }, { 0, 0, 4 }, } marker = createMarker ( unpack ( route [ currentIndex ] ) ) addEventHandler ( "onMarkerHit", root, function ( ) if ( source == marker ) then currentIndex = ( currentIndex + 1 ) destroyElement ( marker ) marker = nil marker = createMarker ( unpack ( route [ currentIndex ] ) ) end end ) end
  6. AlphaMark

    Error

    function SweepRoute() local currentIndex = 1 local route = { { 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 2 }, { 0, 0, 3 }, { 0, 0, 4 }, } marker = createMarker ( unpack ( route [ currentIndex ] ) ) addEventHandler ( "onMarkerHit", root, function ( ) if ( source == marker ) then currentIndex = ( currentIndex + 1 ) destroyElement ( marker ) marker = nil marker = createMarker ( unpack ( route [ currentIndex ] ) ) end end ) end
  7. AlphaMark

    Error

    Why wont this work, The error is: Bad argument @ 'triggerClientEvent' [Expected element at argument 2, got nill] function SweepEnter(theVehicle, seat, jacked) local id = getElementModel ( theVehicle ) if id == 574 then outputChatBox("You are now sweeping!", thePlayer, 255, 0, 0) triggerClientEvent("SweepRoute", thePlayer) end end
  8. AlphaMark

    route

    I already got it working, Still thanks!
  9. AlphaMark

    route

    Hitting the marker wont do anything.
  10. AlphaMark

    route

    Could you make an example?
  11. AlphaMark

    route

    So i would have this? function Route local markers = { {0, 0, 3}, {2, 0, 3}, {4, 0, 3} } And then?
  12. AlphaMark

    route

    How do i make an route that will make you drive to certain markers after each other and that u get money for each marker?
  13. Why wont the cooldown work? function createExplosionForPlayer(client, command) local cooldown = 300 local commandname = "jihad" local note_info = "You need to wait 5 minutes before you can do this again." local note_active = "Cooldown is still active, please wait." local timer = getElementData(client, "jihad.cooldown") if not timer then if (isPedInVehicle(client)) then outputChatBox("You can't commit a Jihad in a vehicle!", client) return end setTimer(createJihadForPlayer, 2500, 1, client, x, y, z) triggerClientEvent("playTheSound", root, client) setPedAnimation(client, "BOMBER", "BOM_Plant") end end addCommandHandler("jihad", createExplosionForPlayer) function createJihadForPlayer(client, x, y, z) if (isPedInVehicle(client)) then outputChatBox("You can't commit a Jihad in a vehicle!", client) return end local x, y, z = getElementPosition(client) createExplosion(x, y, z, 2) createExplosion(x, y, z, 3) createExplosion(x, y, z, 10) outputChatBox(getPlayerName(client) .. " committed a Jihad!", root) end addCommandHandler("c2", createJihadForPlayer)
  14. Hello guys. I was expanding an old script but now its not working. function startJihad ( thePlayer, command ) local theVehicle = getPedOccupiedVehicle ( thePlayer) if (theVehicle == true) then createExplosionForPlayer() if (theVehicle == false) then outputChatBox ("You cant commit a Jihad in a vehicle!",thePlayer,255,0,0) end end end function createExplosionForPlayer ( thePlayer, command ) timer = setTimer ( createJihadForPlayer, 2500, 1, thePlayer, x, y, z ) local triggeredClientEvent = triggerClientEvent ( "playTheSound", getRootElement(), thePlayer ) setPedAnimation ( thePlayer, "BOMBER","BOM_Plant" ) end function createJihadForPlayer ( thePlayer, x, y, z ) local theVehicle = getPedOccupiedVehicle ( thePlayer ) local x, y, z = getElementPosition ( thePlayer ) local createdExplosion = createExplosion ( x, y, z, 2 ) local createdExplosion = createExplosion ( x, y, z, 3 ) local createdExplosion = createExplosion ( x, y, z, 10 ) if ( createdExplosion == true ) then outputChatBox ( getPlayerName ( thePlayer ) .." comitted a Jihad!" ) end end addCommandHandler ("jihad", startJihad)
  15. Still doesnt work. Btw why al those enters?
  16. Its working but it doesnt show the "You cant commit a Jihad in a vehicle!"
  17. I have this atm. (Im not an good scripter) function checkforVehicle ( thePlayer ) local theVehicle = getPedOccupiedVehicle ( thePlayer ) if theVehicle then function createExplosionForPlayer ( thePlayer, command ) timer = setTimer ( createJihadForPlayer, 2500, 1, thePlayer, x, y, z ) triggerClientEvent ( "playTheSound", getRootElement(), thePlayer ) setPedAnimation ( thePlayer, "BOMBER","BOM_Plant" ) function createJihadForPlayer ( thePlayer, x, y, z ) local x, y, z = getElementPosition ( thePlayer ) local createdExplosion = createExplosion ( x, y, z, 2 ) local createdExplosion = createExplosion ( x, y, z, 3 ) local createdExplosion = createExplosion ( x, y, z, 10 ) if ( createdExplosion == true ) then outputChatBox ( getPlayerName ( thePlayer ) .." comitted a Jihad!" ) else outputChatBox ("You cant commit a Jihad in a vehicle!") end end end addCommandHandler ( "Jihad", createExplosionForPlayer ) addCommandHandler ( "jihad", createExplosionForPlayer )
  18. Bad argument @ 'getPedOccupiedVehicle'
  19. Yes but how do i check if he is in a vehicle
  20. How can i cancel a function if the player is in a vehicle?
  21. Thanks! Its working now
  22. :lua:3: ')' expected near 'thePlayer'
  23. It gets triggered by this script: function createExplosionForPlayer(thePlayer,command) timer = setTimer (createJihadForPlayer, 2500, 1, thePlayer, x, y, z) triggerClientEvent("playTheSound", getRootElement()) end addCommandHandler("Jihad", createExplosionForPlayer) addCommandHandler("jihad", createExplosionForPlayer) function createJihadForPlayer(thePlayer, x, y, z) local x,y,z = getElementPosition(thePlayer) local createdExplosion = createExplosion(x,y,z,2) local createdExplosion = createExplosion(x,y,z,9) local createdExplosion = createExplosion(x,y,z,10) if (createdExplosion == true) then outputChatBox(getPlayerName(thePlayer).." comitted a Jihad!") end end
  24. I cant figure out how i should make it.
×
×
  • Create New...