SetMarcos Posted September 25, 2016 Share Posted September 25, 2016 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
Dealman Posted September 25, 2016 Share Posted September 25, 2016 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. 1 Link to comment
SetMarcos Posted September 26, 2016 Author Share Posted September 26, 2016 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. function vidacolete( Plr ) local marcos = getTeamName(getPlayerTeam( Plr )) local armor = getPedArmor( Plr ) 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
enzopaul4 Posted September 26, 2016 Share Posted September 26, 2016 meta is good , but i think it is on the server Link to comment
SetMarcos Posted September 26, 2016 Author Share Posted September 26, 2016 2 hours ago, enzopaul4 said: meta is good , but i think it is on the server Link to comment
Dealman Posted September 26, 2016 Share Posted September 26, 2016 10 hours ago, MarcosMix99 said: I have to do all the script specifying the player? thank you bro! Well yeah, you can't really expect the game to magically know what it is you're trying to do So did you fix it? client is a pre-defined variable so you should be able to use this since you're using a custom event. Link to comment
SetMarcos Posted September 26, 2016 Author Share Posted September 26, 2016 3 minutes ago, Dealman said: Well yeah, you can't really expect the game to magically know what it is you're trying to do So did you fix it? client is a pre-defined variable so you should be able to use this since you're using a custom event. nice Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now