I've got a problem with a script, It's in the code gallery, I do not take ownership of it. I want to make it so that I can replace the image it comes with, with an image of my own. But there isn't anything here that says like "IMG=" or anything of that sort. So I was wondering if someone could help me figure this out.
PHP Code:
function onActionServerSide()
{
if (params[0] == "playerweaps") {
for (i = 0; i < player.weapons.size(); i ++) temp.imgs.add(findWeaponNPC(player.weapons[i]).image);
triggerClient("gui", name, "openinv", player.weapons, temp.imgs);
}
}
//#CLIENTSIDE
function onCreated()
{
enablefeatures(allfeatures - 4);
this.gName = "Inventory_";
(this.gName @ "Window0").destroy();
setTimer(.05);
}
function onTimeOut()
{
this.plWeapon = player.weapon.name;
showText(200, 6, 100, "System", "b", "Selected Weapon:" SPC this.plWeapon SPC "[" @ selectedweapon @ "]");
changeImgVis(200, 4);
setTimer(.05);
}
function onKeyPressed(keynr, keyname)
{
if (keyname == "q") {
if ((this.gName @ "Window0").visible == false) triggerServer("gui", name, "playerweaps");
else (this.gName @ "Window0").destroy();
}
}
function onActionClientSide("",weaps,imgs)
{
if (params[0] == "openinv") OpenInventory(weaps, imgs);
}
function OpenInventory(invWeapons, invImages)
{
if ((this.gName @ "Window0").visible == false) {
new GuiWindowCtrl(this.gName @ "Window0") {
width = 196, height = 177;
x = screenwidth/2 - width/2, y = screenheight/2 - height/2;
canMinimize = false;
canMaximize = false;
canResize = false;
canMove = false;
destroyOnHide = true;
xmod = NULL;
ymod = NULL;
rowcount = NULL;
invItems = NULL;
// Removes old buttons
for (i = 0; i < invItems.size(); i ++) (this.gName @ "Button" @ i).destroy();
// Checks for items to display in inventory
for (i = 0; i < invWeapons.size(); i ++) {
if (!invWeapons[i].starts("-")) invItems.add({invWeapons[i], invImages[i]});
}
// Displays the items
new GuiScrollCtrl(this.gName @ "Scroll0") {
width = 187, height = 150;
x = 5, y = 23;
hScrollBar = "alwaysOff";
vScrollBar = "dynamic";
for (i = 0; i < invItems.size(); i ++) {
temp.var = i / 5;
if (temp.var.length() == 1 && i > 0) {
xmod = NULL;
ymod += 36;
rowcount ++;
}
new GuiBitmapButtonCtrl(this.gName @ "Button" @ i) {
width = 32, height = 32;
x = 5 + xmod, y = 5 + ymod;
this.itemname = invItems[i][0];
this.itemimage = invItems[i][1];
normalbitmap = this.itemimage;
mouseoverbitmap = this.itemimage;
pressedbitmap = this.itemimage;
thiso.catchevent(this, "onMouseDown", "onSlotPressed");
thiso.catchevent(this, "onMouseEnter", "onMouseOverSlot");
thiso.catchevent(this, "onMouseLeave", "onMouseExitSlot");
}
xmod += 32 + 4;
}
}
}
(this.gName @ "Window0").makefirstresponder("false");
} else (this.gName @ "Window0").destroy();
}
function onSlotPressed(obj, keymodifier, mousescreenx, mousescreeny, clickcount)
{
if (clickcount == 2) {
player.chat = "Selected Weapon:" SPC obj.itemname;
selectedweapon = player.weapons.index(findWeapon(obj.itemname));
(this.gName @ "Window0").destroy();
} else if (clickcount == 1) (this.gName @ "Window0").text = obj.itemname;
}
function onMouseOverSlot(obj) (this.gName @ "Window0").text = obj.itemname;
function onMouseExitSlot(obj) (this.gName @ "Window0").text = "";