Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Waru

Pages: 1 ... 184 185 186 187 188 [189] 190 191 192 193 194 ... 383
2821
Modification Help / Re: ripping the event_addItem to use in a function
« on: January 06, 2015, 11:06:29 PM »
now i have

Code: [Select]
function serverCmdAddSword(%client)
{
    if(isObject(%client.player))
    {
        %player = %client.player;
        %player.addItem(SwordItem.getID(),%client);
    }
}

but how would i get the "sword" part of
Code: [Select]
%player.addItem(SwordItem.getID(),%client);
to be a variable?

2822
Modification Help / Re: ripping the event_addItem to use in a function
« on: January 06, 2015, 10:52:05 PM »
As a suggestion, never change the subject in coding help, it can really get confusing such as in this case right here.

haha. sorry. I would be spamming the coding help board if i didn't just change the subject because I have a lot of questions.

2823
Modification Help / Re: ripping the event_addItem to use in a function
« on: January 06, 2015, 10:19:43 PM »
wtf

Anyway you can use the function from your post like this
Code: [Select]
%player.addItem(%image,%client);
%image is the datablock name of the weapon "image"
%player and %client are self explanatory.

So if I wanted to add a sword to my inventory, it would be %player.addItem(%SwordImage,%client);?

2824
Modification Help / ripping the event_addItem to use in a function
« on: January 06, 2015, 09:31:06 PM »
I know the ui name, and the datablock name, how would i rip this code to make it so i can use it in a function to add whatever to an inventory?

Code: [Select]
registerOutputEvent("Player", "addItem", "datablock ItemData", 1);

function Player::addItem(%player,%image,%client)
{
   for(%i = 0; %i < %player.getDatablock().maxTools; %i++)
   {
      %tool = %player.tool[%i];
      if(%tool == 0)
      {
         %player.tool[%i] = %image;
         %player.weaponCount++;
         messageClient(%client,'MsgItemPickup','',%i,%image);
         break;
      }
   }
}

2825
Modification Help / Re: how to do a " while using %file.writeLine
« on: January 06, 2015, 07:53:43 PM »
a very roundabout way to generate weapons

2826
Modification Help / how to do a " while using %file.writeLine
« on: January 06, 2015, 07:02:38 PM »
%file.writeLine("      uiName = "WeaponName";");

gives me a syntax error because of the "" around WeaponName, how to fix?

2827
Games / Re: Minecraft Megathread; ho stuff one point eight
« on: January 05, 2015, 04:45:23 PM »
Windows mail cause it's easier to work with on the surface pro than on yahoo's site

windows surface is one of the most useless things i've ever had the displeasure to use :<

2828
Off Topic / Re: remember that show code lyoko
« on: January 04, 2015, 11:48:55 AM »
yeah

2829
Off Topic / Re: post random lines of code here
« on: January 04, 2015, 11:34:13 AM »
function serverCmdsetlevel(%client, %b)
{
        if(%client.isAdmin)
        {
                %client.tlvl = %b;
                commandToClient(%client,'centerPrint',"Your level is now "@%b@"",3);
        }
        else
        {
                commandToClient(%client,'centerPrint',"You are not admin.",3);
        }
}

2831
Games / Re: Minecraft Megathread; ho stuff one point eight
« on: January 03, 2015, 01:08:45 PM »
for me it was a indev house tour :<

2832
Off Topic / Re: so i got a package from surburb today...
« on: January 02, 2015, 03:29:29 PM »
um are you going to show the magic mouse

2833
it's fun i guess
although i would do something else with it like this!


2834
Off Topic / Re: Anime and Manga Megathread
« on: January 02, 2015, 11:46:14 AM »
oh yeah toradora is a great anime. first one i watched.

2835
Off Topic / Re: i need some loving comfort
« on: January 02, 2015, 01:22:40 AM »
My new years sucked too. stuffty mood friends!

Pages: 1 ... 184 185 186 187 188 [189] 190 191 192 193 194 ... 383