ville Posted February 21, 2015 Posted February 21, 2015 Hi guys im new scripting but no im trying to make /wantedoff. It does change your wanted level to 0, it costs 1k. but i want to make it 1k for only player called Ville. i tested it and it worked for every player.. so can anyone help me addCommandHandler("wantedoff", function(pSource) if getAccountName(getPlayerAccount(player)) == "Ville" then elseif getPlayerMoney(pSource) < 1000 then outputChatBox("* Police: You don't have enough money!", pSource, 255, 0, 0) return end outputChatBox("* Police: You are clear now.", pSource, 0,255,0) takePlayerMoney(pSource, 1000) setPlayerWantedLevel(pSource, 0) end ) Check out my mta server :3, Freeroam, drifting, CnR, missions and much things to do
Tekken Posted February 21, 2015 Posted February 21, 2015 try now: addCommandHandler("wantedoff", function() if getAccountName(getPlayerAccount(source)) == "Ville" then local money = getPlayerMoney(source) if (money >= 1000) then outputChatBox("* Police: You are clear now.", source, 0,255,0) takePlayerMoney(source, 1000) setPlayerWantedLevel(source, 0) elseif (money < 1000) then outputChatBox("* Police: You don't have enough money!", source, 255, 0, 0) return end end end ) Resources I made: attachToBones - A newer bone_attach. Simple Level system - Just a simple level system. Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!
ville Posted February 21, 2015 Author Posted February 21, 2015 try now: addCommandHandler("wantedoff", function() if getAccountName(getPlayerAccount(source)) == "Ville" then local money = getPlayerMoney(source) if (money >= 1000) then outputChatBox("* Police: You are clear now.", source, 0,255,0) takePlayerMoney(source, 1000) setPlayerWantedLevel(source, 0) elseif (money < 1000) then outputChatBox("* Police: You don't have enough money!", source, 255, 0, 0) return end end end ) Now it doesnt work at all.. I get on debugscript: attempt to compare nil with number Check out my mta server :3, Freeroam, drifting, CnR, missions and much things to do
Tekken Posted February 21, 2015 Posted February 21, 2015 Wath about this ? function takeWantedLvl(player) if getAccountName(getPlayerAccount(player)) == "Ville" then local money = getPlayerMoney(player) if (money >= 1000) then outputChatBox("* Police: You are clear now.", player, 0,255,0) takePlayerMoney(player, 1000) setPlayerWantedLevel(player, 0) elseif (money < 1000) then outputChatBox("* Police: You don't have enough money!", player, 255, 0, 0) end end end addCommandHandler("wantedoff", takeWantedLvl) Resources I made: attachToBones - A newer bone_attach. Simple Level system - Just a simple level system. Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!
ville Posted February 21, 2015 Author Posted February 21, 2015 Wath about this ? function takeWantedLvl(player) if getAccountName(getPlayerAccount(player)) == "Ville" then local money = getPlayerMoney(player) if (money >= 1000) then outputChatBox("* Police: You are clear now.", player, 0,255,0) takePlayerMoney(player, 1000) setPlayerWantedLevel(player, 0) elseif (money < 1000) then outputChatBox("* Police: You don't have enough money!", player, 255, 0, 0) end end end addCommandHandler("wantedoff", takeWantedLvl) Now its working! Thanks Check out my mta server :3, Freeroam, drifting, CnR, missions and much things to do
Tekken Posted February 21, 2015 Posted February 21, 2015 np Resources I made: attachToBones - A newer bone_attach. Simple Level system - Just a simple level system. Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!
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