3ehud Posted September 11, 2017 Share Posted September 11, 2017 (edited) So i made a script that was meant to set my wanted amount of fuel (0 to 100). It doesnt work and i need help from you guys. Here's the script: function command(player,cmd,amount) local vehicle = getPedOccupiedVehicle(player) local fuel = getElementData(vehicle,"fuel") local account = getPlayerAccount(player) local name = getAccountName(account) if isObjectInACLGroup("user."..name,aclGetGroup("Właściciel")) then if vehicle and tonumber(amount) and (tonumber(fuel) + tonumber(amount)) <= 100 then setElementData(vehicle,"fuel",tonumber(amount) + tonumber(fuel)) outputChatBox("Pojazd został zatrzymany.",player) end end addCommandHandler("tech",command) Edited September 11, 2017 by 3ehud Link to comment
Mr.Loki Posted September 11, 2017 Share Posted September 11, 2017 What error do you get in the debug when using the command? Link to comment
3ehud Posted September 11, 2017 Author Share Posted September 11, 2017 I edited the code a bit. function command(player,cmd,amount) end local vehicle = getPedOccupiedVehicle(player) local fuel = getElementData(vehicle,"fuel") local account = getPlayerAccount(player) local name = getAccountName(account) if isObjectInACLGroup("user."..name,aclGetGroup("Właściciel")) then end if vehicle and tonumber(amount) and (tonumber(fuel) + tonumber(amount)) <= 100 then setElementData(vehicle,"fuel",tonumber(amount) + tonumber(fuel)) outputChatBox("Pojazd został zatrzymany.",player) end addCommandHandler("tech",command) And here are the errors/warnings. https://drive.google.com/open?id=0B9I7LHGBgukAVmxkTmVyUm9OT3c Btw would you mind helping me with an EMP (Electro-magnetic Pulse) system for Police that could turn off the engine for about 3 minutes? Link to comment
3ehud Posted September 12, 2017 Author Share Posted September 12, 2017 End of the topic, people heleped me on another forum. 1 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