Jump to content

HELP | AJUDA |


SetMarcos

Recommended Posts

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>

Link to comment
15 hours ago, Dealman said:

function vidacolete()
local marcos = getTeamName(getPlayerTeam( source ))
local armor = getPedArmor( source 

As far as I can tell, source is never defined. Try replacing source with client.

 
so I have to do all the script specifying the player? thank you bro! 
I am new in POO MTASA xD

 
16 hours ago, Woovie said:

Moved to scripting.

thank you bro!
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...