PT_BR ==
opa, estou tentanto criar um sistema de colete e vida por comando [/colete] e não acontece nada na hora que eu executo o comando no team especifico...
Vejam meu server.lua e meu cliente.lua
Ajudem por favor <3
Muito obrigado desde já!!!
EN ==
oops, I'm trying to create a vest system and control for life [/colete] and nothing happens by the time I run the command in the specific team ...
See my server.lua and my cliente.lua
Please help <3
Thank you in advance !!!
Cliente.lua ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
esperar = true
function mcmarcos1 ()
if (esperar == true) then
mcmarcos2()
esperar = false
else
outputChatBox ("Só poderá usar /colete pós 2 min!",source,255,0,0,true)
end
end
addCommandHandler ("colete", mcmarcos1)
addCommandHandler ("COLETE",mcmarcos1)
addCommandHandler ("armor",mcmarcos1)
addCommandHandler ("ARMOR", mcmarcos1)
function mcmarcos2 ()
triggerServerEvent("vidacolete", getLocalPlayer())
setTimer(mcmarcos3,20000,1)
end
end
function mcmarcos3 ()
esperar = true
end
server.lua ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function vidacolete()
local marcos = getTeamName(getPlayerTeam( source ))
local armor = getPedArmor( source )
if (marcos == "**BOPE*") then
if (armor <= 10) then
setPedArmor(source, 10)
outputChatBox ("#0000ff● Você pegou #FFFFFF10% #0000ffde colete [/colete] [BOPE] ", source, 255, 255, 255, true)
end
elseif (marcos == "**Militar*") then
if (armor <= 30) then
setPedArmor(source, 30)
outputChatBox ("#0000ff● Você pegou #FFFFFF30% #0000ffde colete [/colete] [MILITAR] ", source, 255, 255, 255, true)
end
elseif (marcos == "**Marinha*") then
if (armor <= 50) then
setPedArmor(source, 50)
outputChatBox ("#0000ff● Você pegou #FFFFFF50% #0000ffde colete [/colete] [MARINHA] ", source, 255, 255, 255, true)
end
elseif (marcos == "**Aérea*") then
if (armor <= 70) then
setPedArmor(source, 70)
outputChatBox ("#0000ff● Você pegou #FFFFFF70% #0000ffde colete [/colete] [AÉREA] ", source, 255, 255, 255, true)
end
elseif (marcos == "*NVL~> PRO*") then
if (armor <= 100) then
setPedArmor(source, 100)
setPedStat(source, 24, 999)
setElementHealth(source, 200)
outputChatBox ("#0000ff● Você pegou #FFFFFF100% #0000ffde colete [/colete] [PRO] ", source, 255, 255, 255, true)
end
end
end
addEvent("vidacolete", true)
addEventHandler("vidacolete", getRootElement(), vidacolete)
meta.xml -----------------------------------------------------------------------------------------------
<meta>
<info author="Marcos" name="Colete e Vida" description="/colete e /vida para rank" version="1.0.0"/>
<script src="server.lua" type="server" />
<script src="client.lua" type="client" />
</meta>