-
Posts
732 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Bean666
-
whenever i remove one end in the bottom 1 disappears, but my problem is the unexpected symbol. and still i want those 4 eof errors removed. im not sure about what im doing to fix it.
-
hey , when i add if ( getTeamName(getPlayerTeam(player)) == "Blahblah")then whenever i add it here: setTimer(function() if ( getTeamName(getPlayerTeam(player)) == "Blahblah")then setElementAlpha(marker, 70); outputChatBox("#00ff00[system]: #ff0000Stay in the marker, do not leave the marker or the progress wont continue!", player, 255, 255, 255, true); isMarerHidden = false; end, 10000, 1); end, 5000, 1); end end); it gets an error in script editor, the error i get is this 4 errors: unexpected symbol near ',' '' expected near 'end' '' expected near 'end' '' expected near 'end' any one can help? thanks.
-
calm down , i wasn't serious hhhh, ok. both codes work. no prob.
-
SOLVED no need , both codes work. even anubhav's
-
so what do i have to do? it still continues the timer.
-
it still continues the timer btw... here is the main part of the script, anything wrong? everythings fine but the prob is if player leaves , timer still continues addEventHandler("onMarkerHit", marker, function(player) if isPedInVehicle(player) then return; end if (isMarerHidden == true) then return; end if (getPlayerTeam(player) and getTeamName(getPlayerTeam(player)) == "Resistances") then outputChatBox("Stay in the marker, do not leave the marker or you will not get the money.", player, 255, 0, 0); if (isTimer( timing )) then return end timing = setTimer(function() for _,v in ipairs(getElementsByType("player")) do if isElementWithinColShape(v, theShape) then givePlayerMoney(v, 5000); outputChatBox("Robbery Success, Robbery will be available again in 5 minutes.", v, 0, 255, 0); end end setElementAlpha(marker, 0); isMarerHidden = true; setTimer(function() setElementAlpha(marker, 70); isMarerHidden = false; end, 60000, 1); end, 5000, 1); end end);
-
i need help. even the player dies, leaves the marker, quit, timer still continues any help? there are no errors function onDie( ) if isTimer( timing ) and getElementsWithinColShape( theShape ) == 0 then cancelTimer( timing ) end end addEventHandler( "onPlayerWasted", root, onDie ) addEventHandler( "onPlayerQuit", root, onDie ) addEventHandler( "onMarkerLeave", root, onDie )
-
oh.
-
will this work? local timeTable = {}; local marker = createMarker(-2405, -597.53125, 131.9, "cylinder", 7.0, 0, 180, 0, 100); local isMarerHidden = false; addEventHandler("onMarkerHit", marker, function(player) if isPedInVehicle(player) then return; end if (isMarerHidden == true) then return; end if (getPlayerTeam(player) and getTeamName(getPlayerTeam(player)) == "Resistances") then outputChatBox("Wait 30 seconds in the marker, don't leave it! or the mission will fail!", player, 255, 0, 0); outputChatBox("Military Broadcast: Attention Soldiers! The military vault is under attack!", getRootElement(), 0, 200, 0); timeTable[player] = setTimer(function() isElementWithinMarker(player, marker) givePlayerMoney(player, 5000); setElementAlpha(marker, 0); isMarerHidden = true; setTimer(function() setElementAlpha(marker, 100); isMarerHidden = false; end, 60000, 1); end, 5000, 1); end end); function checkTimer(element) if isTimer(timeTable[element]) then killTimer(timeTable[element]); timeTable[element] = nil; isElementWithinMarker(player, marker) end end addEventHandler("onPlayerWasted", getRootElement(), function() checkTimer(source); end); addEventHandler("onPlayerQuit", getRootElement(), function() checkTimer(source); end); addEventHandler("onMarkerLeave", marker, function(player) checkTimer(player); end);
-
Btw nvm that i have a new one: a player goes into the marker first and completes the mission first, he gets the money, marker disappears. players that were late in the marker didnt get the money when the marker disappears. i want a timer that if the first player goes in, it will be in progress. and even other players are late, if the timer times up, marker disappears. they all get the reward. i want all players that were within the marker will get the reward at the same time. help me please. local timeTable = {}; local marker = createMarker(-2405, -597.53125, 131.9, "cylinder", 7.0, 0, 180, 0, 70); local isMarerHidden = false; addEventHandler("onMarkerHit", marker, function(player) if isPedInVehicle(player) then return; end if (isMarerHidden == true) then return; end if (getPlayerTeam(player) and getTeamName(getPlayerTeam(player)) == "Resistances") then outputChatBox("Stay in the marker! do not leave it or you will not get the money", player, 255, 0, 0); timeTable[player] = setTimer(function() outputChatBox("Robbery Success! Robbery will be available again in 5 minutes", player, 0, 255, 0); givePlayerMoney(player, 30000); setElementAlpha(marker, 0); isMarerHidden = true; for _,v in ipairs(getElementsByType("player")) do if isTimer(timeTable[v]) then killTimer(timeTable[v]); end end setTimer(function() setElementAlpha(marker, 70); isMarerHidden = false; end, 300000, 1); end, 180000, 1); end end); function checkTimer(element) if isTimer(timeTable[element]) then killTimer(timeTable[element]); timeTable[element] = nil; end end addEventHandler("onPlayerWasted", getRootElement(), function() checkTimer(source); end); addEventHandler("onPlayerQuit", getRootElement(), function() checkTimer(source); end); addEventHandler("onMarkerLeave", marker, function(player) checkTimer(player); end);
-
a player goes into the marker first and completes the mission first, he gets the money, marker disappears. players that were late in the marker didnt get the money when the marker disappears. i want a timer that if the first player goes in, it will be in progress. and even other players are late, if the timer times up, marker disappears. they all get the reward. i want all players that were within the marker will get the reward at the same time. help me please. local timeTable = {}; local marker = createMarker(-2405, -597.53125, 131.9, "cylinder", 7.0, 0, 180, 0, 70); local isMarerHidden = false; addEventHandler("onMarkerHit", marker, function(player) if isPedInVehicle(player) then return; end if (isMarerHidden == true) then return; end if (getPlayerTeam(player) and getTeamName(getPlayerTeam(player)) == "Resistances") then outputChatBox("Stay in the marker! do not leave it or you will not get the money", player, 255, 0, 0); timeTable[player] = setTimer(function() outputChatBox("Robbery Success! Robbery will be available again in 5 minutes", player, 0, 255, 0); givePlayerMoney(player, 30000); setElementAlpha(marker, 0); isMarerHidden = true; for _,v in ipairs(getElementsByType("player")) do if isTimer(timeTable[v]) then killTimer(timeTable[v]); end end setTimer(function() setElementAlpha(marker, 70); isMarerHidden = false; end, 300000, 1); end, 180000, 1); end end); function checkTimer(element) if isTimer(timeTable[element]) then killTimer(timeTable[element]); timeTable[element] = nil; end end addEventHandler("onPlayerWasted", getRootElement(), function() checkTimer(source); end); addEventHandler("onPlayerQuit", getRootElement(), function() checkTimer(source); end); addEventHandler("onMarkerLeave", marker, function(player) checkTimer(player); end);
-
how do i kill all the timers after first player gets the money?
-
no its fixed now. but what i mean is if im done with the marker. i get the money. marker disappears. but when another player is still in progress and still dont have the money. will the marker disappear for him too?
-
last question: if a player completes the mission the marker will disappear right? will it disappear for other players that haven't completed the mission yet?
-
Yes it is possible to work with car as well, but will need some changes if i'm not mistaken. i ment, if i enter the marker with a vehicle, the function works. i dont want it working with a vehicle i only want the function working if the player is on foot. and btw still not working even marker recreated.
-
yep i tested when the marker was recreated. it didnt work. the money doesn't give it to me the message dont pop up, btw i ment, if im in a vehicle i enter the marker, function works. i want it disabled. i only want the function working with people on foot.
-
EDIT: Btw if the marker is recreated, when i come back the function doesnt work anymore, it doesnt give me money now. btw is it also possible its not working if you're in a vehicle?"srry for asking too much >.<"
-
now for the last one. is it possible that there'll be a cooldown? like if you finished the robbery. the marker will disappear for a minute and then it will comeback? thanks.
-
yep ik. realized before u comment haha
-
it worked. but now is it possible if the player dies it kills the timer?