Author Topic: Sorry wrong section, locked.  (Read 597 times)

Okay so I've been stuck on this piece of code for a very long time and I can't figure out what's wrong. This is supposed to switch two people's inventories based on how many inventory slots they both have (must have the same amount) and it's been derping.
Code: [Select]
//%client and %user are two clients

%client.player.naToolCount = 0;
while(%client.player.naToolCount < %client.player.getDataBlock().maxtools)
{
%client.player.BDtool = %client.player.tool[%client.player.naToolCount];
%user.player.BDtool = %user.player.tool[client.player.naToolCount];
%client.player.tool[%client.player.naToolCount] = %user.player.BDtool;
%user.player.tool[%client.player.naToolCount] = %client.player.BDtool;
messageClient(%client, 'MsgItemPickup', '', %client.player.naToolCount, %client.player.tool[%client.player.naToolCount]);
messageClient(%user, 'MsgItemPickup', '', %client.player.naToolCount, %user.player.tool[%client.player.naToolCount]);
%client.player.naToolCount++;
}

%client.player.BDtool = "";
%user.player.BDtool = "";
%client.player.naToolCount = "";
The problem is that, after it executes, the fields storing the ID of the item on %user's player are completely gone (according to dump();) and the %client still has his but can't see them (he's not being messaged about them properly). Can anybody shed some light on this for me?
« Last Edit: June 05, 2012, 07:44:00 PM by The Russian »

wrong section, goes in coding help.

you'll get more help over there.

wrong section, goes in coding help.

you'll get more help over there.
Whoops, I just realized that, locking.