Author Topic: Item not picking up.  (Read 761 times)

Code: [Select]
function Armor::onCollision(%this, %obj, %col, %thing, %other){
if(%col.dataBlock $= "Castuffem"){
%ColWorth = %Col.getShapeName();
%obj.client.cash = %obj.client.cash+%ColWorth;
%col.delete();
CenterPrint(%obj.client,"<just:left> < " @ $Currency @ %obj.client.cash @ " >",2);
} else if(%col.onSale){
if(%col.seller !$= %obj.client){
commandtoclient(%obj.client,'centerprint',"\c6This item is on sale for \c0" @ %col.getShapeName() @ ". \n If you'd like to buy it please type /buy.",4,4,5000);
%obj.client.buyItem = %col;
return;
}
}
Parent::onCollision(%this, %obj, %col, %thing, %others);
}

function servercmdSell(%client, %amount){
if(isObject(%client.wrenchBrick.item)){
%item = %client.wrenchBrick.item;
%item.setShapeName(($CurrencyFront ? ($Currency @ %amount) : (%amount @ $currency)));
%item.price = %amount;
%item.seller = %client;
%item.onSale = 1;
}
}

function serverCmdBuy(%client){
if(isObject(%client.buyItem)){
%item = %client.buyItem;
%a = %item.getDatablock();
if(%client.cash >= %item.price){
if(%client.player.tool[0] $= "0"){ %slot = 0; } else if(%client.player.tool[1] $= "0"){ %slot = 1; } else if(%client.player.tool[2] $= "0"){ %slot = 2; } else if(%client.player.tool[3] $= "0"){ %slot = 3; } else if(%client.player.tool[4] $= "0"){ %slot = 4; }
if(%slot $= ""){ messageclient(%client,"","\c6You have no room for this."); return; }
%client.cash = %client.cash-%item.price;
%client.player.tool[%slot] = nametoID(%a);
messageClient(%client, 'MsgItemPickup', '', %slot, nametoID(%a));
if(isObject(%item.seller.player)){
%item.seller.cash = %item.seller.cash+%item.price;
}
}
}
}




caice creamem appear's to be filtered.

cash Item