Estevam2d Posted August 31, 2014 Share Posted August 31, 2014 I start the script nothing happens, I do not know what the error is. Help-me, sorry bad english. addEventHandler("onResourceStart", resourceRoot, function() setTimer(function(source) if getPlayerTeam(source) == getTeamFromName("Policia Militar Oficial") then givePlayerMoney ( source, 1 ) outputChatBox ( "#00B3FFSalario recebido foi de #00FF2A$#F6FF001 (teste)", source, 10, 118, 240, true) end end, 1000, 0, source ) end ) Link to comment
Anubhav Posted August 31, 2014 Share Posted August 31, 2014 addEventHandler("onResourceStart", resourceRoot, function() setTimer(function() for k,source in ipairs(getElementsByType("player")) do if getTeamName(getPlayerTeam(source)) == getTeamFromName("Policia Militar Oficial") then givePlayerMoney ( source, 1 ) outputChatBox ( "#00B3FFSalario recebido foi de #00FF2A$#F6FF001 (teste)", source, 10, 118, 240, true) end end end, 1000, 0) end ) Link to comment
Estevam2d Posted September 1, 2014 Author Share Posted September 1, 2014 Is not going to this team not getting salary over time Link to comment
Anubhav Posted September 1, 2014 Share Posted September 1, 2014 Any error in /debugscript 3? Link to comment
Estevam2d Posted September 1, 2014 Author Share Posted September 1, 2014 I'm doing a new method. New: function desapar(player) if getPlayerTeam(player) == getTeamFromName("Policia Militar Oficial") then outputChatBox ( "#00B3FFSalario recebido foi de #00FF2A$#F6FF009000 (teste)", player, 10, 118, 240, true) end end addEventHandler("onResourceStart",getRootElement(),desapar) how to script with start onResourceStart ? With this: addEventHandler("onResourceStart", resourceRoot, onCurrentResourceStart) ? Link to comment
Anubhav Posted September 1, 2014 Share Posted September 1, 2014 function desapar(player) if getPlayerTeam(player) == getTeamFromName("Policia Militar Oficial") then outputChatBox ( "#00B3FFSalario recebido foi de #00FF2A$#F6FF009000 (teste)", player, 10, 118, 240, true) end end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),desapar) Link to comment
DNL291 Posted September 1, 2014 Share Posted September 1, 2014 function desapar(player) if getPlayerTeam(player) == getTeamFromName("Policia Militar Oficial") then outputChatBox ( "#00B3FFSalario recebido foi de #00FF2A$#F6FF009000 (teste)", player, 10, 118, 240, true) end end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),desapar) onResourceStart has no 'player' parameter. Actually, the first parameter is the started resource. Link to comment
Estevam2d Posted September 1, 2014 Author Share Posted September 1, 2014 It did not work already done everything, I just want to put salary for a given team. Link to comment
Anubhav Posted September 1, 2014 Share Posted September 1, 2014 Ty for reminding @ DNL function desapar() for k,player in ipairs(getElementsByType("player")) do if getPlayerTeam(player) == getTeamFromName("Policia Militar Oficial") then outputChatBox ( "#00B3FFSalario recebido foi de #00FF2A$#F6FF009000 (teste)", player, 10, 118, 240, true) end end end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),desapar) 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