Search found 5 matches

by TommyTee
Wed Jan 18, 2017 4:43 am
Forum: Modding
Topic: How do I charge prisoners to use the phone? [AvailableMoney code help!)
Replies: 4
Views: 2149

Re: How do I charge prisoners to use the phone? [AvailableMoney code help!)

Can somebody PLEASE help??? local cost = 10.0 function GetObject(type,id,dist) objs = Object.GetNearbyObjects(type,dist or 1) for o,d in pairs(objs) do if o.Id.i == id then return o end end end function Create() this.User = this.Id.u; end function Update(dt) if tonumber(this.Slot0.i) > -1 then user ...
by TommyTee
Sun Jan 15, 2017 1:45 pm
Forum: General
Topic: Please let us charge prisoners for stuff
Replies: 1
Views: 573

Please let us charge prisoners for stuff

I've given myself such a migraine all night trying to figure out how to charge prisoners to use payphones and nothing is working I've trying a bajillion different scripts. we shouldn't have to be nasa scripting scientists to do something so simple :( Why can't we just put Cost = 5 or Cost = 10 under...
by TommyTee
Sun Jan 15, 2017 1:19 pm
Forum: Modding
Topic: How do I charge prisoners to use the phone? [AvailableMoney code help!)
Replies: 4
Views: 2149

Re: How do I charge prisoners to use the phone? [AvailableMoney code help!)

Tried this one and it still isn't working local costPerUse = 5.0; function GetObject(type,id,dist) objs = Object.GetNearbyObjects(type,dist or 2); for o,d in pairs(objs) do if o.Id.i == id then return o; end end end function Update(dt) if somePrisoner.AvailableMoney >= costPerUse then somePrisoner.A...
by TommyTee
Sun Jan 15, 2017 12:18 pm
Forum: Modding
Topic: How do I charge prisoners to use the phone? [AvailableMoney code help!)
Replies: 4
Views: 2149

Re: How do I charge prisoners to use the phone?

Okay so I checked out another thread and a coffee machine mod to see how it works. I created a .lua called Payphone.lua (as it's Payphone in materials.txt) and used this code: local cost = 5.0; function GetObject(type,id,dist) objs = Object.GetNearbyObjects(type,dist or 1) for o,d in pairs(objs) do ...
by TommyTee
Sun Jan 15, 2017 9:21 am
Forum: Modding
Topic: How do I charge prisoners to use the phone? [AvailableMoney code help!)
Replies: 4
Views: 2149

How do I charge prisoners to use the phone? [AvailableMoney code help!)

So I set the flag RequiresCash in needs.txt and only prisoners with cash are using the object BUT no cash is taken from them. How do have cash actually taken off the prisoner please once they use an object? For example I want prisoners to be charged for using the payphone So if prisoner A has $6 onc...

Go to advanced search