Estevam2d Posted August 31, 2014 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 )
Anubhav Posted August 31, 2014 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 ) See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Estevam2d Posted September 1, 2014 Author Posted September 1, 2014 Is not going to this team not getting salary over time
Anubhav Posted September 1, 2014 Posted September 1, 2014 Any error in /debugscript 3? See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Estevam2d Posted September 1, 2014 Author 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) ?
Anubhav Posted September 1, 2014 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) See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
DNL291 Posted September 1, 2014 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. Please do not PM me with scripting related question nor support, use the forums instead.
Estevam2d Posted September 1, 2014 Author Posted September 1, 2014 It did not work already done everything, I just want to put salary for a given team.
Anubhav Posted September 1, 2014 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) See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
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