• Changing printer ownership when pocketed
    19 replies, posted
I'm trying to make it where when you pocket a printer, it changes the owner of it to who ever put it in their pocket. I have the code laid out with no lua errors, but it's not working. I check if when pocketed it is a certain ent, but it always comes back as false, even though its the correct one. I made it change the owner if it was true or not, just for testing, but it is still not working, and is always coming back as false. [CODE] printers = {"sp_printer_high","sp_printer_low","sp_printer_medium","sp_printer_premium","sp_printer_rare","sp_printer_eco"} function ChangePrinterOwner(ply,ent,var1,var2) --print("message") if ent == "money_printer" then --(table.HasValue( printers, ent)) then ent:SetOwner(ply) print("has value") else ent:SetOwner(ply) print("doesnt have value") end end hook.Add("onPocketItemDropped","ChangePrinterOwner", ChangePrinterOwner ) [/CODE]
I highly suggest you ask the creator of stuffed printers.
First of all. Second argument on ChangePrinterOwner gives you class or just entity? If not use ent:GetClass() Then. Explore how your printers get owner. If not owner geting from your printers code then use FPP set owner. P.S Johny, get out here stalker.
[QUOTE=Netheous;50326592]I highly suggest you ask the creator of stuffed printers.[/QUOTE] I was testing it with regular printers also and that didn't work. Notice how the stuffed printers are commented out?
[QUOTE='Hat [RU];50326610']First of all. Second argument on ChangePrinterOwner gives you class or just entity? If not use ent:GetClass() Then. Explore how your printers get owner. If not owner geting from your printers code then use FPP set owner. P.S Johny, get out here stalker.[/QUOTE] You do know he probably isn't using the legitement version of the script right?
[QUOTE=danker pepers;50326687]I was testing it with regular printers also and that didn't work. Notice how the stuffed printers are commented out?[/QUOTE] Yes, but considering you bought the addon I'm quite sure author will help you out.
[QUOTE=Lunaversity;50326693]You do know he probably isn't using the legitement version of the script right?[/QUOTE] Maybe this printers is free?
[QUOTE='Hat [RU];50326712']Maybe this printers is free?[/QUOTE] They aren't.
-snip-
[QUOTE=Netheous;50326697]Yes, but considering you bought the addon I'm quite sure author will help you out.[/QUOTE] I really don't care about this working on stuffed printers though, I just want it to work in general. The only reason I am using stuffed printers for it is because it is the only printer addon I have purchased.
[QUOTE=Bings;50326805][B]*hint hint*[/B] Neth made Stuffed Printers (and sells them on SF) :3 [URL]https://scriptfodder.com/scripts/view/2/stuffed-printers-your-ultimate-solution-to-boring-printing[/URL][/QUOTE] Thanks for literally destroying what we were aiming for, now I have literally no chance of finding out who that is...
[QUOTE=Netheous;50326815]Thanks for literally destroying what we were aiming for, now I have literally no chance of finding out who that is...[/QUOTE] [url]http://steamcommunity.com/profiles/76561198081016036[/url] Your welcome. [B]Edit:[/B] I found his Steam ID in the third post down on this thread: [url]https://facepunch.com/showthread.php?t=1518378&p=50306203#post50306203[/url] Or a simple search of danker peppers on sf would of found him [url]https://scriptfodder.com/users?search=danker+pepers[/url]
[img]http://puu.sh/oT4xi/6e4abc5750.png[/img]
[QUOTE=Netheous;50326815]Thanks for literally destroying what we were aiming for, now I have literally no chance of finding out who that is...[/QUOTE] Would you rather have me make a support ticket through scriptfodder for help, rather than do it through here? [editline]15th May 2016[/editline] [QUOTE=Netheous;50326867][img]http://puu.sh/oT4xi/6e4abc5750.png[/img][/QUOTE] I have it bought on a different account, so I can link this thread to you in the support ticket if you want some proof of me owning it.
[QUOTE=danker pepers;50326875]Would you rather have me make a support ticket through scriptfodder for help, rather than do it through here? [editline]15th May 2016[/editline] I have it bought on a different account, so I can link this thread to you in the support ticket if you want some proof of me owning it.[/QUOTE] I was kinda pushing you into contacting me so I find out if you use a leak or not. The printers aren't meant to be pocketable - if you understood how pocket works you would quickly drop the idea. DarkRP pocket used to make stuff invisible and incollidable at the place you pocket it and then teleport it upon dropping it out of pocket and make it visible/collidable again. Now DarkRP pocket actually removes the entity and stores it's data inside pocket. Sadly, it stores only NetworkedVars setup via SetupDataTable, which I won't use because it's gay and updates all the time even when value doesn't change so it's really stupid resource-wise to use it for anything else than variables that constantly change (that's why SP will never work with pocketting). In addition, the fact that entity is actually removed from the world means that you can bypass entity limit with it. When you buy a printer, gamemode loops through printers on the map and checks the owner, then if amount of printers owned by you is higher or equal maximum, it obviously returns an error message saying you already have max printers - now imagine what would happen if that printer didn't exist on the map, but did exist in your pocket? [editline]15th May 2016[/editline] Ofcourse all of that could be fixed by migrating Stuffed Printers from net library to networked variables and adding a custom check to printers that checks for contents of a pocket.. but it's really not worth the effort.
[QUOTE=Netheous;50326907]I was kinda pushing you into contacting me so I find out if you use a leak or not. The printers aren't meant to be pocketable - if you understood how pocket works you would quickly drop the idea. DarkRP pocket used to make stuff invisible and incollidable at the place you pocket it and then teleport it upon dropping it out of pocket and make it visible/collidable again. Now DarkRP pocket actually removes the entity and stores it's data inside pocket. Sadly, it stores only NetworkedVars setup via SetupDataTable, which I won't use because it's gay and updates all the time even when value doesn't change so it's really stupid resource-wise to use it for anything else than variables that constantly change (that's why SP will never work with pocketting). In addition, the fact that entity is actually removed from the world means that you can bypass entity limit with it. When you buy a printer, gamemode loops through printers on the map and checks the owner, then if amount of printers owned by you is higher or equal maximum, it obviously returns an error message saying you already have max printers - now imagine what would happen if that printer didn't exist on the map, but did exist in your pocket? [editline]15th May 2016[/editline] Ofcourse all of that could be fixed by migrating Stuffed Printers from net library to networked variables and adding a custom check to printers that checks for contents of a pocket.. but it's really not worth the effort.[/QUOTE] So it's not really possible to change the owner of a printer when you put it in your pocket? Also do you want me to submit a support ticket to prove ownership?
[QUOTE=danker pepers;50326926]So it's not really possible to change the owner of a printer when you put it in your pocket? Also do you want me to submit a support ticket to prove ownership?[/QUOTE] It is possible, but why would you do that? If you change ownership - that'll also bypass maximum printer limit. One guy will keep buying printers, the other guy will keep taking ownership. Mind you, all of this is possible and easily do-able... but not without editting DarkRP core files and changing the way it checks for max entities et cetera.
[QUOTE=Netheous;50326934]It is possible, but why would you do that? If you change ownership - that'll also bypass maximum printer limit. One guy will keep buying printers, the other guy will keep taking ownership.[/QUOTE] The main purpose of what I was trying to do is make it so when you raid someone for printers, and they log off, you can keep them. I saw that this would be easily exploited, but I was going to try and find a way to patch that after I got the initial part working. I'm not sure how I would do it, but I would figure whether or not to keep the script down the line, depending on if I fixed the exploit or not. But seriously, I purchased the printers. I will submit a ticket if you say so, to prove I have bought them. I don't want to be known as someone who uses leaked scripts, because that's a shitty thing to do.
[QUOTE=danker pepers;50326973]The main purpose of what I was trying to do is make it so when you raid someone for printers, and they log off, you can keep them. I saw that this would be easily exploited, but I was going to try and find a way to patch that after I got the initial part working. I'm not sure how I would do it, but I would figure whether or not to keep the script down the line, depending on if I fixed the exploit or not. But seriously, I purchased the printers. I will submit a ticket if you say so, to prove I have bought them. I don't want to be known as someone who uses leaked scripts, because that's a shitty thing to do.[/QUOTE] Just set so unowned entities are removed after 30 minutes rather than 5 minutes, that'll make robbers atleast have a bit of use from it and it's not long enough to make "spawn, disconnect, repeat" worth it.
[QUOTE=Netheous;50326999]Just set so unowned entities are removed after 30 minutes rather than 5 minutes, that'll make robbers atleast have a bit of use from it and it's not long enough to make "spawn, disconnect, repeat" worth it.[/QUOTE] Well thanks for the help, I guess I'm gonna do that instead of going through the trouble of changing owner. Can you please answer my question if you want me to verify the ownership of the printers?
Sorry, you need to Log In to post a reply to this thread.