
AlphaMark
Members-
Posts
60 -
Joined
-
Last visited
Everything posted by AlphaMark
-
Ah okay but now i got this error: Bad argument at #1 to 'unpack' (table expected got nil)
-
Maybe you can make an invisible marker at the same spot?
-
I want to make this in to an function because i want to be able to trigger it serverside
-
I though i got it to work, But when u enter the marker nothing happends
-
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
-
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
-
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
-
I already got it working, Still thanks!
-
Hitting the marker wont do anything.
-
So i would have this? function Route local markers = { {0, 0, 3}, {2, 0, 3}, {4, 0, 3} } And then?
-
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?
-
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)
-
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)
-
Still doesnt work. Btw why al those enters?
-
Its working but it doesnt show the "You cant commit a Jihad in a vehicle!"
-
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 )
-
Bad argument @ 'getPedOccupiedVehicle'
-
Yes but how do i check if he is in a vehicle
-
How can i cancel a function if the player is in a vehicle?
-
:lua:3: ')' expected near 'thePlayer'
-
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
-
I cant figure out how i should make it.