![]() |
Problem sending variable
So, kind of going off of my last post about gui images and such, I am now needing to send one of the temp/this variables I have to another weapon's function to continue my process and system. I have this:
I used both temp and this variables attempting to get it to work, as well as this and thiso, because I don't really get what they are and was desperate. :) I tried posting code but incapsula kept stopping me for some reason. Basically i have tempvars creating the gui image, then using a catchevent to catch right mouse click, then setting the obj.var to a this.var, and using GuiControl.onSelect in a pop up that shows up when right clicking to switch the 2 selections and either drop the item or send to a shop. Dropping the item works fine and so does everything else, but sending to shop (which is a public function in a different weapon, the shop weapon) results in null. :( I'm thinking that the var has just been passed to much, or however you put it, but I don't really know, and if it has been, I don't know another way to make this work. |
Put the code on pastebin.graalcenter.org and post a link.
|
http://pastebin.graalcenter.org/read...d=329451868910
Note the last function, where it sends to -Player/Shop. Every other single thing works fine with how it is, and even to that last function, obj.wep has the correct value to send to -Player/Shop. It's just when it sends its 0. Also I forgot to change temp.sendtosell to this.clickedright, it doesn't work as this.clickedright. :/ |
Temporary variables don't transcend functions, you'll need to find some other way to store it. Probably store it as a variable of the weapon or the GUI object.
|
Looked through your code and made my changes, and what I think could fix your logic issues.
http://pastebin.graalcenter.org/read.php?id=53670813760 |
With that, everything still works, even drop, and temp.wep in player chat is correct, but its still 0 value when it pulls to -Player/Shop.
|
Quote:
|
PHP Code:
|
Try: temp.item and echo(temp.item);
Instead of just using item. |
nothing, no chat at all that time, no echo, and changed the text =temp.item as well and still comes up null.
|
Try changing the variable from temp.item to something else like temp.selling_item.
If you: echo(params); does anything show up? |
Changed, and still not working. Player chat is 0/null, no echo in rc or scripts (for player/shop), and the gui still shows 0/null for the text. tried with and without temp. in it as well.
|
If you change:
findweapon("-Player/Shop").bringInSell(temp.wep); to: findweapon("-Player/Shop").trigger("TestSellItem", temp.wep); and add: PHP Code:
|
Yep, but I tried referring it to the other function bringInSell in -Player/Shop from the trigger in player shop and it still didnt show up, echoes 0. :/
|
Quote:
PHP Code:
PHP Code:
PHP Code:
|
I should have known to do that. xD
|
| All times are GMT +2. The time now is 01:29 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.