Jump to content

Need help with my script - outputChatBox flood problem


MaRcell

Recommended Posts

 
I have a problem in my script the mission at the time of outputchatbox flooda chat of other mission / =
local MarkTrab = createMarker(1809.78833 ,-1433.85901 ,12.42969,"cylinder", 6, 255, 0, 0, 255)
local MarkChego = createMarker(2476.71704, -1055.81750 ,65.56454, "cylinder", 6, 255, 0, 0, 255)
local MyBlip  = createBlip (1809.78833 ,-1433.85901 ,13.42969,26)
cam = {}
blipxxx = {}

function TrabBus (source)
local account = getAccountName (getPlayerAccount(source))
local x,y,z = getElementPosition(source)
if (getElementData(source, "Trab", true)) then outputChatBox ("#FF0000Você já esta Em uma missao.", source, 255, 255, 255, true) return end
cam[source] = createVehicle (587,1798.34216 ,-1430.41675 ,13.42272)
setElementRotation(cam[source], 0,0,90)
warpPedIntoVehicle (source, cam[source])
aclGroupAddObject (aclGetGroup("Truck"), "user."..account)
blipxxx[source] = createBlip (2476.71704, -1055.81750 ,66.56454)
setElementData(source, "Trab", true)

outputChatBox(" ")
outputChatBox(" ")
outputChatBox("#ff00ff=========================MISSAO=============================", source, 255, 255, 255, true)
outputChatBox("#00FF9E--Leve o carro até a bandeira vermelha.", source, 255, 255, 255, true)
outputChatBox("#00FF9E--Voce ganhara 12.000 R$ pra fazer esta viagem.", source, 255, 255, 255, true)
outputChatBox("#00FF9E--para sair da missao digite /sairmissao.",source, 255, 255, 255, true)
outputChatBox("#FF0000--se sair do carro voce fracassara a missao :)",source, 255, 255, 255, true)
outputChatBox("#ff00ff============================MISSAO===========================",source, 255, 255, 255, true)
outputChatBox(" ")
outputChatBox(" ")
end
addEventHandler ("onMarkerHit", MarkTrab, TrabBus)

function rreem (source)
local accounat = getAccountName (getPlayerAccount(source))
aclGroupRemoveObject (aclGetGroup("Truck"), "user."..accounat)
outputChatBox ('#ffff00* Valter: #ffffffVoce desistiu da missao.',source,255,255,255,true)
setPedSkin (source,0)
destroyElement(cam[source])
setElementData(source, "Trab", false)
end
addCommandHandler("sairmissao",rreem)

function TrabBusChego (source)
if cam[source] and isElement(cam[source]) and getElementData (source, "Trab", true) then
destroyElement (blipxxx[source])
destroyElement (cam[source])
local accounat = getAccountName (getPlayerAccount(source))
aclGroupRemoveObject (aclGetGroup("Truck"), "user."..accounat)
setElementData(source, "Trab", false)
givePlayerMoney (source, 12000)
outputChatBox( '#ffffffMISSAO COMPLETA +12MIl.',source,255,255,255,true)
setPedSkin (source,0)
setElementData(source, "Trab", false)
end
end
addEventHandler ("onMarkerHit", MarkChego, TrabBusChego)

function NSPode (source)
if (cam[source]) and isElement(cam[source]) then
outputChatBox ('#FF5100* #ffffffVocê tem #FF510010 #ffffffsegundos parar voltar para o Carro.', source, 255, 255, 255, true)
T11 = setTimer (destroyElement, 10000,1, blipxxx[source])
T22 = setTimer (destroyElement, 10000,1, cam[source])
T33 = setTimer (setElementData, 10000,1, source, "Trab", false)
T44 = setTimer (function()
Trabalho = false
setPedSkin (source,0)
outputChatBox ('#FF5100* #ffffffVocê ficou muito tempo fora do veiculo e fracasso a missao!.', source, 255, 255, 255, true)
setElementData(source, "Trab", false)
end, 10000, 1)
   end
end
addEventHandler ("onVehicleExit", root, NSPode)

function SNPode (source)
if (cam[source]) and isElement(cam[source]) then
killTimer (T11)
killTimer (T22)
killTimer (T33)
killTimer (T44)
   end
end
addEventHandler ("onVehicleEnter", root, SNPode)

 

Edited by jhxp
Changed topic title
Link to comment

https://uploaddeimagens.com.br/imagens/mta-screen_2016-09-08_17-30-15-png 

 
flooda even when I leave the vehicle / = print 

 

outputChatBox ('#FF5100* #ffffffVocê tem #FF510010 #ffffffsegundos parar voltar para o Carro.', source, 255, 255, 255, true)
T11 = setTimer (destroyElement, 10000,1, blipxxx[source])
T22 = setTimer (destroyElement, 10000,1, cam[source])
T33 = setTimer (setElementData, 10000,1, source, "Trab", false)
T44 = setTimer (function()
Trabalho = false
setPedSkin (source,0)
outputChatBox ('#FF5100* #ffffffVocê ficou muito tempo fora do veiculo e fracasso a missao!.', source, 255, 255, 255, true)
setElementData(source, "Trab", false)
end, 10000, 1)
   end
end
addEventHandler ("onVehicleExit", root, NSPode)

function SNPode (source)
if (cam[source]) and isElement(cam[source]) then
killTimer (T11)
killTimer (T22)
killTimer (T33)
killTimer (T44)
   end
end
addEventHandler ("onVehicleEnter", root, SNPode)

 

Link to comment

outputChatBox ('#FF5100* #ffffffVocê tem #FF510010 #ffffffsegundos parar voltar para o Carro.', source, 255, 255, 255, true)
T11 = setTimer (destroyElement, 10000,1, blipxxx[source])
T22 = setTimer (destroyElement, 10000,1, cam[source])
T33 = setTimer (setElementData, 10000,1, source, "Trab", false)
T44 = setTimer (function()
		Trabalho = false
		if getElementData(source, "Trab") then
		setPedSkin (source,0)
		outputChatBox ('#FF5100* #ffffffVocê ficou muito tempo fora do veiculo e fracasso a missao!.', source, 255, 255, 255, true)
		setElementData(source, "Trab", false)
		end
		end, 10000, 1)
	end
end
addEventHandler ("onVehicleExit", root, NSPode)
function SNPode (source)
if (cam[source]) and isElement(cam[source]) then
killTimer (T11)
killTimer (T22)
killTimer (T33)
killTimer (T44)
   end
end
addEventHandler ("onVehicleEnter", root, SNPode)
 
 

Try this ^, not tested tho

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...